Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
SOLOv2-pytorch
Commits
9d767a03
Commit
9d767a03
authored
Oct 15, 2019
by
Vladimir Iglovikov
Committed by
Kai Chen
Oct 15, 2019
Browse files
Added pre-commit hook (#1536)
* Added pre-commit hook * Trigger CI
parent
6668bf03
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
3 deletions
+42
-3
.github/CONTRIBUTING.md
.github/CONTRIBUTING.md
+19
-1
.isort.cfg
.isort.cfg
+2
-2
.pre-commit-config.yaml
.pre-commit-config.yaml
+21
-0
No files found.
.github/CONTRIBUTING.md
View file @
9d767a03
...
@@ -29,7 +29,25 @@ We use the following tools for linting and formatting:
...
@@ -29,7 +29,25 @@ We use the following tools for linting and formatting:
Style configurations of yapf and isort can be found in
[
.style.yapf
](
../.style.yapf
)
and
[
.isort.cfg
](
../.isort.cfg
)
.
Style configurations of yapf and isort can be found in
[
.style.yapf
](
../.style.yapf
)
and
[
.isort.cfg
](
../.isort.cfg
)
.
We use
[
pre-commit hook
](
https://pre-commit.com/
)
that checks and formats for
`flake8`
,
`yapf`
,
`isort`
,
`trailing whitespaces`
,
fixes
`end-of-files`
, sorts
`requirments.txt`
automatically on every commit.
The config for a pre-commit hook is stored in
[
.pre-commit-config
](
../.pre-commit-config.yaml
)
.
After you clone the repository, you will need to install initialize pre-commit hook.
```
pip install -U pre-commit
```
From the repository folder
```
pre-commit install
```
After this on every commit check code linters and formatter will be enforced.
>Before you create a PR, make sure that your code lints and is formatted by yapf.
>Before you create a PR, make sure that your code lints and is formatted by yapf.
### C++ and CUDA
### C++ and CUDA
We follow the
[
Google C++ Style Guide
](
https://google.github.io/styleguide/cppguide.html
)
.
We follow the
[
Google C++ Style Guide
](
https://google.github.io/styleguide/cppguide.html
)
.
\ No newline at end of file
.isort.cfg
View file @
9d767a03
...
@@ -2,6 +2,6 @@
...
@@ -2,6 +2,6 @@
line_length = 79
line_length = 79
multi_line_output = 0
multi_line_output = 0
known_first_party = mmdet
known_first_party = mmdet
known_third_party =
mmcv,numpy
,matplotlib,pycocotools,
six,seaborn
,terminaltables,torch
,torchvision
known_third_party =
Cython,albumentations,cv2,imagecorruptions
,matplotlib,
mmcv,numpy,
pycocotools,
robustness_eval,roi_align,roi_pool,seaborn,setuptools,six
,terminaltables,torch
no_lines_before = STDLIB,LOCALFOLDER
no_lines_before = STDLIB,LOCALFOLDER
default_section = THIRDPARTY
default_section = THIRDPARTY
\ No newline at end of file
.pre-commit-config.yaml
0 → 100644
View file @
9d767a03
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
:
80b9cd2f0f3b1f3456a77eff3ddbaf08f18c08ae
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment