Skip to content

Commit 2077d83

Browse files
committed
Move black testing definition as part of pre-commit.
For this to work, the black command line options need to be replaced with a pyproject.toml file defining the settings, that can be reused.
1 parent 5daca02 commit 2077d83

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +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, pre-commit
45+
- name: Pip install pylint, Sphinx, pre-commit
4646
run: |
47-
pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme pre-commit
47+
pip install --force-reinstall pylint Sphinx sphinx-rtd-theme pre-commit
4848
- name: Library version
4949
run: git describe --dirty --always --tags
5050
- name: Pre-commit hooks
5151
run: |
5252
pre-commit run --all-files
53-
- name: Check formatting
54-
run: |
55-
black --check --target-version=py35 .
5653
- name: PyLint
5754
run: |
5855
pylint $( find . -path './adafruit*.py' )

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# SPDX-License-Identifier: Unlicense
44

55
repos:
6+
- repo: https://github.com/python/black
7+
rev: 19.10b0
8+
hooks:
9+
- id: black
610
- repo: https://github.com/fsfe/reuse-tool
711
rev: latest
812
hooks:

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
5+
[tool.black]
6+
target-version = ['py35']

0 commit comments

Comments
 (0)