diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d7298f864..408025c73 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -45,16 +45,6 @@ jobs: run: | tox -e dist-check - - name: Codestyle - if: ${{ matrix.python-version == '3.9' }} - run: | - tox -e codestyle - - - name: Lint - sort - if: ${{ matrix.python-version == '3.9' }} - run: | - tox -e sort - - name: Security if: ${{ matrix.python-version == '3.9' }} run: | @@ -64,3 +54,12 @@ jobs: if: ${{ matrix.python-version == '3.9' }} run: | tox -e docs + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v4 + with: + python-version: "3.9" + - uses: pre-commit/action@v3.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..ca5d8dfe0 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,18 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +exclude: "^docs/.*$" +default_stages: [commit] + +ci: + autofix_commit_msg: "chore(pre-commit.ci): auto fixes" + autoupdate_commit_msg: "chore(pre-commit.ci): pre-commit autoupdate" + +repos: + - repo: https://github.com/PyCQA/isort + rev: 5.10.1 + hooks: + - id: isort + - repo: https://github.com/psf/black + rev: 22.6.0 + hooks: + - id: black