feat: add black, flake config and pre-commit

pull/83/head
Martin Eigenmann 2021-10-11 09:49:29 +02:00
rodzic 74b2bdcd09
commit 5f51f18968
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 069D1EE3806CA368
3 zmienionych plików z 27 dodań i 7 usunięć

3
.flake8 100644
Wyświetl plik

@ -0,0 +1,3 @@
[flake8]
max-complexity = 10
select = E9,F63,F7,F82

Wyświetl plik

@ -22,14 +22,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest coverage
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
pip install pipenv==v2021.5.29
pipenv install --dev --deploy
- name: Lint with black and flake
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
black --check icalevents
flake8 . --count --exit-zero
- name: Test with pytest
run: |
coverage run test.py

Wyświetl plik

@ -0,0 +1,19 @@
ci:
skip: [pylint]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 21.9b0
hooks:
- id: black
args: ['--check']
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
hooks:
- id: flake8