-
-
Notifications
You must be signed in to change notification settings - Fork 46.9k
Add pre-commit hook for TheAlgorithms/Python #2511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
db02da8
Add pre-commit basic config file
dhruvmanila a3e1daf
Add pre-commit to requirements.txt
dhruvmanila dd18484
Small tweaks and use stable for black
dhruvmanila fdbb8aa
Fix isort section in pre-commit-config file
dhruvmanila da8990d
Fix errors and EOF only for Python files
dhruvmanila File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,55 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
hooks: | ||
- id: check-executables-have-shebangs | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: requirements-txt-fixer | ||
- repo: https://github.com/psf/black | ||
rev: stable | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.5.3 | ||
hooks: | ||
- id: isort | ||
args: | ||
- --profile black | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.8.3 | ||
hooks: | ||
- id: flake8 | ||
args: | ||
- --ignore=E203,W503 | ||
- --max-complexity=25 | ||
- --max-line-length=88 | ||
# FIXME: fix mypy errors and then uncomment this | ||
# - repo: https://github.com/pre-commit/mirrors-mypy | ||
# rev: v0.782 | ||
# hooks: | ||
# - id: mypy | ||
# args: | ||
# - --ignore-missing-imports | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v1.17.1 | ||
hooks: | ||
- id: codespell | ||
args: | ||
- --ignore-words-list=ans,fo,followings,hist,iff,secant,som,tim | ||
- --skip="./.*,./other/dictionary.txt,./other/words,./project_euler/problem_22/p022_names.txt" | ||
- --quiet-level=2 | ||
exclude: | | ||
(?x)^( | ||
other/dictionary.txt | | ||
other/words | | ||
project_euler/problem_22/p022_names.txt | ||
)$ | ||
- repo: local | ||
hooks: | ||
- id: validate-filenames | ||
name: Validate filenames | ||
entry: ./scripts/validate_filenames.py | ||
language: script | ||
pass_filenames: false |
This file contains hidden or 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 |
---|---|---|
|
@@ -10,6 +10,7 @@ numpy | |
opencv-python | ||
pandas | ||
pillow | ||
pre-commit | ||
pytest | ||
pytest-cov | ||
requests | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.