Add pre-commit hooks (#156)

* add pre-commit hooks

* update yapf version
pull/159/head
Kai Chen 2019-12-12 21:40:42 +08:00 committed by GitHub
parent fd3f862edb
commit 2330c4f468
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 3 deletions

View File

@ -0,0 +1,21 @@
repos:
- repo: https://github.com/asottile/seed-isort-config
rev: v1.9.3
hooks:
- id: seed-isort-config
# - repo: https://github.com/pre-commit/mirrors-isort
# rev: v4.3.21
# hooks:
# - id: isort
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.29.0
hooks:
- id: yapf
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: flake8
- id: trailing-whitespace
- id: check-yaml
- id: end-of-file-fixer
- id: requirements-txt-fixer

View File

@ -15,8 +15,8 @@ split_before_expression_after_opening_paren = true
[isort]
line_length = 79
multi_line_output = 0
known_standard_library = setuptools
known_standard_library = pkg_resources,setuptools
known_first_party = mmcv
known_third_party = addict,cv2,matplotlib,numpy,requests,six,torch,yaml
known_third_party = Cython,addict,cv2,mock,numpy,pytest,requests,resnet_cifar,six,terminaltables,torch,torchvision,yaml
no_lines_before = STDLIB,LOCALFOLDER
default_section = THIRDPARTY