Skip to content

Commit

Permalink
add code linting and formatting files
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiyangZhou committed Dec 1, 2019
1 parent aef46a7 commit a118fc2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
ignore = E261, E501, W293
max-line-length = 79
exclude = __init__.py, build
10 changes: 10 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -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 changes: 9 additions & 0 deletions .style.yapf
Original file line number Diff line number Diff line change
@@ -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 changes: 3 additions & 0 deletions linter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
isort -y -sp .

yapf -i -r -vv . -e build

0 comments on commit a118fc2

Please sign in to comment.