Fix pre-commit hook + linting jobs for OAPEN engine (#14)
* sync upstream * isort, black, flake8 precommit hook * Ignore bin * reset bin * reset bin * try to fix black * remove bin! * update gh actionpull/15/head^2
parent
033fc1e56e
commit
1520f08b05
|
@ -0,0 +1,5 @@
|
|||
[flake8]
|
||||
max-line-length = 88
|
||||
max-complexity = 18
|
||||
select = B,C,E,F,W,T4,B9
|
||||
ignore = E203, E266, E501, W503, F403, F401
|
|
@ -22,7 +22,7 @@ jobs:
|
|||
pipenv install --deploy --dev
|
||||
pipenv run isort --profile black src/
|
||||
pipenv run black --check src/ --exclude="lib/*"
|
||||
pipenv run flake8 src/ --ignore="lib/* W"
|
||||
pipenv run flake8 src/ --ignore="lib/*, W, E203, E266, E501, W503, F403, F401"
|
||||
pipenv run pytest
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
[settings]
|
||||
multi_line_output=3
|
||||
include_trailing_comma=True
|
||||
force_grid_wrap=0
|
||||
use_parentheses=True
|
||||
line_length=88
|
||||
skip=[lib/, bin/]
|
||||
profile=black
|
||||
known_third_party = data,lib,model,nltk,pandas,psycopg2,requests
|
|
@ -1,18 +1,14 @@
|
|||
repos:
|
||||
- repo: https://github.com/pycqa/isort
|
||||
rev: 5.10.1
|
||||
- repo: https://github.com/pre-commit/mirrors-isort
|
||||
rev: v5.10.1
|
||||
hooks:
|
||||
- id: isort
|
||||
args: [--profile, black, --filter-files, oapen-engine/src]
|
||||
name: isort (python)
|
||||
- repo: https://github.com/psf/black
|
||||
rev: stable
|
||||
- repo: https://github.com/ambv/black
|
||||
rev: 22.10.0
|
||||
hooks:
|
||||
- id: black
|
||||
language_version: python3.10
|
||||
args: [oapen-engine/src]
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v1.2.3
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v2.3.0
|
||||
hooks:
|
||||
- id: flake8
|
||||
args: [oapen-engine/src]
|
|
@ -162,3 +162,6 @@ cython_debug/
|
|||
database.ini
|
||||
lib/python3.7/
|
||||
lib/python3.10/
|
||||
bin/
|
||||
.pytest_cache
|
||||
lib/
|
|
@ -0,0 +1,22 @@
|
|||
[tool.black]
|
||||
line-length = 88
|
||||
include = '\.pyi?$'
|
||||
exclude = '''
|
||||
/(
|
||||
\.git
|
||||
| \.hg
|
||||
| \.mypy_cache
|
||||
| \.tox
|
||||
| \.venv
|
||||
| _build
|
||||
| buck-out
|
||||
| build
|
||||
| dist
|
||||
| lib
|
||||
| ./oapen-engine/lib
|
||||
| __pycache__
|
||||
| bin
|
||||
| ./oapen-engine/bin
|
||||
|
|
||||
)/
|
||||
'''
|
18
setup.cfg
18
setup.cfg
|
@ -1,18 +0,0 @@
|
|||
[isort]
|
||||
multi_line_output=3
|
||||
include_trailing_comma=True
|
||||
force_grid_wrap=0
|
||||
use_parentheses=True
|
||||
line_length=88
|
||||
skip=[lib/]
|
||||
profile=black
|
||||
|
||||
[flake8]
|
||||
ignore = E203, E266, E501, W503, E501
|
||||
max-line-length = 88
|
||||
max-complexity = 18
|
||||
select = B,C,E,F,W,T4
|
||||
exclude=.git,lib,__pycache__
|
||||
|
||||
[tool:pytest]
|
||||
testpaths=src/test
|
Loading…
Reference in New Issue