Add config for flake, black, and isort

and pre-commit config
This commit is contained in:
mehrad 2021-05-23 00:20:49 -07:00
parent f1e722b049
commit 0e9efa10dd
No known key found for this signature in database
GPG Key ID: AAF81F778210AE42
4 changed files with 48 additions and 0 deletions

5
.flake8 Normal file
View File

@ -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

7
.isort.cfg Normal file
View File

@ -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

21
.pre-commit-config.yaml Normal file
View File

@ -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

15
pyproject.toml Normal file
View File

@ -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
)/
'''