This repository has been archived by the owner on Jul 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
pre-commit
and reformat code (#21)
- Loading branch information
Zhijian Liu
authored
Sep 26, 2021
1 parent
828fe85
commit aac73c0
Showing
71 changed files
with
894 additions
and
1,302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: sudo apt-get update | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
docs/build | ||
.vscode/ | ||
.idea/ | ||
__pycache__/ | ||
__pycache__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: trailing-whitespace | ||
name: (Common) Remove trailing whitespaces | ||
- id: mixed-line-ending | ||
name: (Common) Fix mixed line ending | ||
args: ['--fix=lf'] | ||
- id: end-of-file-fixer | ||
name: (Common) Remove extra EOF newlines | ||
- id: check-merge-conflict | ||
name: (Common) Check for merge conflicts | ||
- id: requirements-txt-fixer | ||
name: (Common) Sort "requirements.txt" | ||
- id: fix-encoding-pragma | ||
name: (Python) Remove encoding pragmas | ||
args: ['--remove'] | ||
- id: double-quote-string-fixer | ||
name: (Python) Fix double-quoted strings | ||
- id: debug-statements | ||
name: (Python) Check for debugger imports | ||
- id: check-json | ||
name: (JSON) Check syntax | ||
- id: check-yaml | ||
name: (YAML) Check syntax | ||
- id: check-toml | ||
name: (TOML) Check syntax | ||
- repo: https://github.com/executablebooks/mdformat | ||
rev: 0.7.7 | ||
hooks: | ||
- id: mdformat | ||
name: (Markdown) Format with mdformat | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v2.19.4 | ||
hooks: | ||
- id: pyupgrade | ||
name: (Python) Update syntax for newer versions | ||
args: ['--py36-plus'] | ||
- repo: https://github.com/google/yapf | ||
rev: v0.31.0 | ||
hooks: | ||
- id: yapf | ||
name: (Python) Format with yapf | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.8.0 | ||
hooks: | ||
- id: isort | ||
name: (Python) Sort imports with isort (torchpack) | ||
exclude: examples/ | ||
- id: isort | ||
name: (Python) Sort imports with isort (examples) | ||
files: ^examples/ | ||
args: [--sp, examples/setup.cfg] | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
name: (Python) Check with flake8 | ||
additional_dependencies: [flake8-bugbear, flake8-comprehensions, flake8-docstrings, flake8-executable, flake8-quotes] | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.902 | ||
hooks: | ||
- id: mypy | ||
name: (Python) Check with mypy | ||
additional_dependencies: [tokenize-rt, types-pyyaml, types-toml] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.