From dacd34a55b5f10c82a5255c664f45cb51b9642dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Fri, 15 May 2020 15:14:43 +0100 Subject: [PATCH] Add pre-commit configuration and integration for REUSE.software. pre-commit.com provides a way to configure pre-commit hooks for multiple tools, including `reuse lint` (configured here), isort, black, and more. This is also integrated with GitHub actions in the example configuration. --- .github/workflows/build.yml | 8 ++++++-- .pre-commit-config.yaml | 9 +++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c12ab0..4247542 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,11 +42,15 @@ jobs: # (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.) run: | source actions-ci/install.sh - - name: Pip install pylint, black, & Sphinx + - name: Pip install pylint, black, Sphinx, pre-commit run: | - pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme + pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme pre-commit - name: Library version run: git describe --dirty --always --tags + - name: Pre-commit hooks + run: | + pre-commit install + pre-commit run --all-files - name: Check formatting run: | black --check --target-version=py35 . diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..700085d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò +# +# SPDX-License-Identifier: Unlicense + +repos: +- repo: https://github.com/fsfe/reuse-tool + rev: latest + hooks: + - id: reuse