-
-
Notifications
You must be signed in to change notification settings - Fork 931
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from NanoCode012/feat/pre-commit
Add pre-commit: black+flake8+pylint+mypy+isort+bandit
- Loading branch information
Showing
41 changed files
with
885 additions
and
382 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,3 @@ | ||
[bandit] | ||
exclude = tests | ||
skips = B101 |
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,5 @@ | ||
[flake8] | ||
max-line-length = 88 | ||
|
||
select = C,E,F,W,B,B950 | ||
extend-ignore = E203, E501, W503 |
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,16 @@ | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
cache: 'pip' # caching pip dependencies | ||
- uses: pre-commit/action@v3.0.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[settings] | ||
profile=black |
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,33 @@ | ||
[mypy] | ||
|
||
exclude = venv | ||
|
||
[mypy-alpaca_lora_4bit.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-flash_attn.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-huggingface_hub] | ||
ignore_missing_imports = True | ||
|
||
[mypy-transformers.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-peft] | ||
ignore_missing_imports = True | ||
|
||
[mypy-bitsandbytes] | ||
ignore_missing_imports = True | ||
|
||
[mypy-datasets] | ||
ignore_missing_imports = True | ||
|
||
[mypy-fire] | ||
ignore_missing_imports = True | ||
|
||
[mypy-setuptools] | ||
ignore_missing_imports = True | ||
|
||
[mypy-addict] | ||
ignore_missing_imports = True |
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,42 @@ | ||
default_language_version: | ||
python: python3.9 | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/psf/black | ||
rev: 23.3.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 | ||
- repo: https://github.com/PyCQA/pylint | ||
rev: v2.17.4 | ||
hooks: | ||
- id: pylint | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.3.0 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: | ||
[ | ||
'types-PyYAML', | ||
] | ||
- repo: https://github.com/PyCQA/bandit | ||
rev: 1.7.5 | ||
hooks: | ||
- id: bandit | ||
args: [ | ||
'--ini', | ||
'.bandit', | ||
] |
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,14 @@ | ||
[MASTER] | ||
init-hook="from pylint.config import find_pylintrc; import os, sys; sys.path.append(os.path.dirname(find_pylintrc()))" | ||
|
||
[TYPECHECK] | ||
|
||
# List of members which are set dynamically and missed by Pylint inference | ||
# system, and so shouldn't trigger E1101 when accessed. | ||
generated-members=numpy.*, torch.* | ||
|
||
|
||
[pylint.messages_control] | ||
disable=missing-function-docstring, line-too-long, import-error, | ||
too-many-arguments, too-many-locals, too-many-statements, too-many-branches, too-few-public-methods, | ||
too-many-instance-attributes, fixme, import-outside-toplevel, logging-fstring-interpolation, |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,4 +61,3 @@ special_tokens: | |
pad_token: "<|endoftext|>" | ||
bos_token: ">>ABSTRACT<<" | ||
eos_token: "<|endoftext|>" | ||
|
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 |
---|---|---|
|
@@ -61,4 +61,3 @@ special_tokens: | |
pad_token: "<|endoftext|>" | ||
bos_token: ">>ABSTRACT<<" | ||
eos_token: "<|endoftext|>" | ||
|
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,3 @@ | ||
pre-commit | ||
black | ||
mypy |
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 |
---|---|---|
|
@@ -4,7 +4,6 @@ bitsandbytes>=0.39.0 | |
addict | ||
fire | ||
PyYAML==6.0 | ||
black | ||
datasets | ||
accelerate>=0.19.0 | ||
sentencepiece | ||
|
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
Oops, something went wrong.