Skip to content

Commit

Permalink
Add pre-commit configuration and integration for REUSE.software.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Flameeyes committed May 15, 2020
1 parent c47eb19 commit dacd34a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit dacd34a

Please sign in to comment.