add code linting and formatting files

pull/294/head
KaiyangZhou 2019-12-01 02:35:26 +00:00
parent aef46a7aa9
commit a118fc2d7f
4 changed files with 26 additions and 0 deletions

4
.flake8 100644
View File

@ -0,0 +1,4 @@
[flake8]
ignore = E261, E501, W293
max-line-length = 79
exclude = __init__.py, build

10
.isort.cfg 100644
View File

@ -0,0 +1,10 @@
[isort]
line_length=79
multi_line_output=3
length_sort=true
known_standard_library=numpy,setuptools
known_myself=torchreid
known_third_party=matplotlib,cv2,torch,torchvision,PIL,yacs
no_lines_before=STDLIB,THIRDPARTY
sections=FUTURE,STDLIB,THIRDPARTY,myself,FIRSTPARTY,LOCALFOLDER
default_section=FIRSTPARTY

9
.style.yapf 100644
View File

@ -0,0 +1,9 @@
[style]
BASED_ON_STYLE = pep8
BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF = true
BLANK_LINE_BEFORE_MODULE_DOCSTRING = true
BLANK_LINE_BEFORE_CLASS_DOCSTRING = true
SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN = true
DEDENT_CLOSING_BRACKETS = true
SPACES_BEFORE_COMMENT = 1
ARITHMETIC_PRECEDENCE_INDICATION = true

3
linter.sh 100644
View File

@ -0,0 +1,3 @@
isort -y -sp .
yapf -i -r -vv . -e build