diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57b4ae1..2280493 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,25 +42,19 @@ 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, pre-commit + - name: Pip install pylint, Sphinx, pre-commit run: | - pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme pre-commit + pip install --force-reinstall pylint 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 . - name: PyLint run: | pylint $( find . -path './adafruit*.py' ) ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" )) - - name: Check formatting - run: | - black --check --target-version=py35 . - name: Build assets run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location . - name: Build docs diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 700085d..42c3715 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,6 +3,10 @@ # SPDX-License-Identifier: Unlicense repos: +- repo: https://github.com/python/black + rev: 19.10b0 + hooks: + - id: black - repo: https://github.com/fsfe/reuse-tool rev: latest hooks: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..f3c35ae --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò +# +# SPDX-License-Identifier: Unlicense + +[tool.black] +target-version = ['py35']