-
Notifications
You must be signed in to change notification settings - Fork 18
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 hooks add lint docs (#51)
fix #48 * add pre-commit hooks * add black to CI * add contributor guidelines re: linting * reformat code using black * address mypy warnings re: generators ### Testing: 1. ``` pip install -r requirements-dev.txt pre-commit install pre-commit run --all-files ``` <img width="582" alt="image" src="https://github.com/pytorch-labs/torchfix/assets/108101595/734960dd-4ca2-4d8a-b58e-dc917332b7f9"> 2. ``` git commit -m 'test' ``` 3. Black CI works: https://github.com/pytorch-labs/torchfix/actions/runs/8791096314/job/24124561579?pr=51
- Loading branch information
1 parent
a71baf1
commit effb27e
Showing
10 changed files
with
79 additions
and
20 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 |
---|---|---|
|
@@ -3,3 +3,4 @@ exclude = ./tests/fixtures/ | |
|
||
# Match black tool's default. | ||
max-line-length = 88 | ||
extend-ignore = E203 |
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 |
---|---|---|
|
@@ -25,3 +25,6 @@ jobs: | |
- name: Run mypy | ||
run: | | ||
mypy . | ||
- name: Run black | ||
run: | | ||
black --check . |
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,23 @@ | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: black | ||
name: black | ||
entry: black | ||
language: system | ||
types: [python] | ||
args: ["--config=./pyproject.toml"] | ||
exclude: ^tests/fixtures/ | ||
- id: flake8 | ||
name: flake8 | ||
entry: flake8 | ||
language: system | ||
types: [python] | ||
args: ["--config=./.flake8"] | ||
exclude: ^tests/fixtures/ | ||
- id: mypy | ||
name: mypy | ||
entry: mypy | ||
language: system | ||
types: [python] | ||
exclude: ^tests/fixtures/ |
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 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 |
---|---|---|
|
@@ -3,3 +3,5 @@ pytest==7.2.0 | |
libcst==1.1.0 | ||
types-PyYAML==6.0.7 | ||
mypy==1.7.0 | ||
black==24.4.0 | ||
pre-commit==3.7.0 |
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 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 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 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 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