Skip to content

Commit 5daca02

Browse files
committed
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.
1 parent dd7b4ff commit 5daca02

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,14 @@ jobs:
4242
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
4343
run: |
4444
source actions-ci/install.sh
45-
- name: Pip install pylint, black, & Sphinx
45+
- name: Pip install pylint, black, Sphinx, pre-commit
4646
run: |
47-
pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme
47+
pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme pre-commit
4848
- name: Library version
4949
run: git describe --dirty --always --tags
50+
- name: Pre-commit hooks
51+
run: |
52+
pre-commit run --all-files
5053
- name: Check formatting
5154
run: |
5255
black --check --target-version=py35 .

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
5+
repos:
6+
- repo: https://github.com/fsfe/reuse-tool
7+
rev: latest
8+
hooks:
9+
- id: reuse

0 commit comments

Comments
 (0)