Add pre-commit config, make tests a requirement for quality checks

pull/121/head
stijndcl 2022-07-19 21:12:04 +02:00
parent 3057222607
commit e371e2cc5c
2 changed files with 47 additions and 3 deletions

View File

@ -62,7 +62,7 @@ jobs:
with:
token: ${{ secrets.CODECOV }}
linting:
needs: [dependencies]
needs: [tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@ -82,7 +82,7 @@ jobs:
- name: Linting
run: flake8
typing:
needs: [dependencies]
needs: [tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@ -102,7 +102,7 @@ jobs:
- name: Typing
run: mypy didier database
formatting:
needs: [dependencies]
needs: [tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

View File

@ -0,0 +1,44 @@
default_language_version:
python: python3.9.5
repos:
- repo: https://github.com/ambv/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-json
- id: end-of-file-fixer
- id: pretty-format-json
- id: trailing-whitespace
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/PyCQA/autoflake
rev: v1.4
hooks:
- id: autoflake
name: autoflake (python)
args:
- "--remove-all-unused-imports"
- "--in-place"
- "--ignore-init-module-imports"
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies:
- "flake8-bandit"
- "flake8-bugbear"
- "flake8-docstrings"
- "flake8-dunder-all"
- "flake8-eradicate"
- "flake8-isort"
- "flake8-simplify"