diff options
author | 2020-03-04 20:37:58 -0800 | |
---|---|---|
committer | 2021-01-09 19:14:42 -0800 | |
commit | b9181f440d97bc092e535675a1550e5abb5113e8 (patch) | |
tree | cf18685aa90fb205b8e9fe0021c35a746aa75426 | |
parent | Install pep8-naming (diff) |
Add more pre-commit hooks
Hooks added:
* check-merge-conflict - checks for files with merge conflict strings
* check-toml - attempts to load all toml files to verify syntax
* check-yaml - attempts to load all yaml files to verify syntax
* end-of-file-fixer - ensures files end in a newline and only a newline
* mixed-line-ending - replaces mixed line endings with LF
* trailing-whitespace - trims trailing whitespace
* python-check-blanket-noqa - enforces that noqa annotations always
occur with specific codes
See: python-discord/organisation#138
-rw-r--r-- | .pre-commit-config.yaml | 15 | ||||
-rw-r--r-- | Pipfile | 2 | ||||
-rwxr-xr-x | scripts/dev.sh | 1 |
3 files changed, 17 insertions, 1 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b7cf9ee..33921bd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,19 @@ repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: check-merge-conflict + - id: check-toml + - id: check-yaml + - id: end-of-file-fixer + - id: mixed-line-ending + args: [--fix=lf] + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + - repo: https://github.com/pre-commit/pygrep-hooks + rev: v1.6.0 + hooks: + - id: python-check-blanket-noqa - repo: local hooks: - id: flake8 @@ -29,7 +29,7 @@ pydocstyle = "~= 5.1" python_version = "3.9" [scripts] -lint = "flake8" +lint = "pre-commit run --all-files" precommit = "pre-commit install" test = "sh scripts/dev.sh -c 'pipenv run coverage run -m unittest'" testb = """ diff --git a/scripts/dev.sh b/scripts/dev.sh index f9cd28e..3f94874 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -24,6 +24,7 @@ if [ "$1" = "--build" ]; then if [ -n "${dangling_imgs}" ]; then printf "Removing dangling images..." + # shellcheck disable=SC2086 docker rmi $dangling_imgs >/dev/null \ && printf " done!\n" || exit "$?" fi |