Skip to content

Commit f72c4ee

Browse files
committed
Add pre-commit configuration.
The configuration is taken directly from adafruit/Adafruit_CircuitPython_TestRepo.
1 parent 480429d commit f72c4ee

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +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, Sphinx, pre-commit
4646
run: |
47-
pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme
47+
pip install --force-reinstall pylint Sphinx sphinx-rtd-theme pre-commit
4848
- name: Library version
4949
run: git describe --dirty --always --tags
50-
- name: Check formatting
50+
- name: Pre-commit hooks
5151
run: |
52-
black --check --target-version=py35 .
52+
pre-commit run --all-files
5353
- name: PyLint
5454
run: |
5555
pylint $( find . -path './adafruit*.py' )

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ bundles
1212
*.DS_Store
1313
.eggs
1414
dist
15-
**/*.egg-info
15+
**/*.egg-info

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
5+
repos:
6+
- repo: https://github.com/python/black
7+
rev: 19.10b0
8+
hooks:
9+
- id: black
10+
- repo: https://github.com/fsfe/reuse-tool
11+
rev: latest
12+
hooks:
13+
- id: reuse
14+
- repo: https://github.com/pre-commit/pre-commit-hooks
15+
rev: v2.3.0
16+
hooks:
17+
- id: check-yaml
18+
- id: end-of-file-fixer
19+
- id: trailing-whitespace

0 commit comments

Comments
 (0)