Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Swin-Transformer-Object-Detection
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wanggh
Swin-Transformer-Object-Detection
Commits
9d767a03
Commit
9d767a03
authored
5 years ago
by
Vladimir Iglovikov
Committed by
Kai Chen
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added pre-commit hook (#1536)
* Added pre-commit hook * Trigger CI
parent
6668bf03
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.github/CONTRIBUTING.md
+19
-1
19 additions, 1 deletion
.github/CONTRIBUTING.md
.isort.cfg
+2
-2
2 additions, 2 deletions
.isort.cfg
.pre-commit-config.yaml
+21
-0
21 additions, 0 deletions
.pre-commit-config.yaml
with
42 additions
and
3 deletions
.github/CONTRIBUTING.md
+
19
−
1
View file @
9d767a03
...
...
@@ -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
)
.
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.
### C++ and CUDA
We follow the
[
Google C++ Style Guide
](
https://google.github.io/styleguide/cppguide.html
)
.
\ No newline at end of file
We follow the
[
Google C++ Style Guide
](
https://google.github.io/styleguide/cppguide.html
)
.
This diff is collapsed.
Click to expand it.
.isort.cfg
+
2
−
2
View file @
9d767a03
...
...
@@ -2,6 +2,6 @@
line_length
=
79
multi_line_output
=
0
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
default_section
=
THIRDPARTY
\ No newline at end of file
default_section
=
THIRDPARTY
This diff is collapsed.
Click to expand it.
.pre-commit-config.yaml
0 → 100644
+
21
−
0
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment