kopia lustrzana https://github.com/jazzband/icalevents
feat: add black, flake config and pre-commit
rodzic
74b2bdcd09
commit
5f51f18968
|
@ -0,0 +1,3 @@
|
|||
[flake8]
|
||||
max-complexity = 10
|
||||
select = E9,F63,F7,F82
|
|
@ -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
|
||||
|
|
|
@ -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
|
Ładowanie…
Reference in New Issue