Add config for flake, black, and isort
and pre-commit config
This commit is contained in:
parent
f1e722b049
commit
0e9efa10dd
|
@ -0,0 +1,5 @@
|
|||
[flake8]
|
||||
max-line-length = 127
|
||||
max-complexity = 18
|
||||
select = B, C, E, F, W, T4, B9
|
||||
ignore = E203, E266, E501, W503, F403, F401, W605, E722, C901
|
|
@ -0,0 +1,7 @@
|
|||
[settings]
|
||||
line_length=127
|
||||
multi_line_output=3
|
||||
include_trailing_comma=True
|
||||
;force_grid_wrap=0
|
||||
known_first_party = tests
|
||||
known_third_party = bootleg,datasets,dill,elasticsearch,kfserving,marisa_trie,nltk,numpy,pathos,pyrouge,requests,sacrebleu,sentence_transformers,seqeval,setuptools,sklearn,tensorboardX,torch,tqdm,transformers,ujson,xgboost
|
|
@ -0,0 +1,21 @@
|
|||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.0.1
|
||||
hooks:
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- repo: https://github.com/PyCQA/isort
|
||||
rev: 5.8.0
|
||||
hooks:
|
||||
- id: isort
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 21.5b1
|
||||
hooks:
|
||||
- id: black
|
||||
language_version: python3.8
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v2.3.0
|
||||
hooks:
|
||||
- id: flake8
|
||||
verbose: true
|
|
@ -0,0 +1,15 @@
|
|||
[tool.black]
|
||||
line-length = 127
|
||||
target-version = ['py38']
|
||||
skip-string-normalization = true
|
||||
exclude = '''
|
||||
/(
|
||||
\.git
|
||||
| \.mypy_cache
|
||||
| \.venv
|
||||
| _build
|
||||
| buck-out
|
||||
| build
|
||||
| dist
|
||||
)/
|
||||
'''
|
Loading…
Reference in New Issue