add more hooks, reorder hooks, update .flake8

This commit is contained in:
mauwii 2023-02-18 03:01:05 +01:00
parent 4e0fe4ad6e
commit b4fd02b910
No known key found for this signature in database
GPG Key ID: D923DB04ADB3F5AB
2 changed files with 23 additions and 13 deletions

View File

@ -1,6 +1,5 @@
[flake8]
# line length is intentionally set to 80 here because black uses Bugbear
max-line-length = 80
max-line-length = 88
extend-ignore =
# See https://github.com/PyCQA/pycodestyle/issues/373
E203,
@ -33,13 +32,12 @@ per-file-ignores =
# F841 assigned to but never used
# F401 imported but unused
tests/test_prompt_parser.py: B950, W605, F401
tests/test_textual_inversion.py: F841
tests/test_textual_inversion.py: F841, B950
# B023 Function definition does not bind loop variable
scripts/legacy_api.py: F401, B950, B023, F841
ldm/invoke/__init__.py: F401
# B010 Do not call setattr with a constant attribute value
ldm/invoke/server_legacy.py: B010
# =====================
# flake-quote settings:
# =====================

View File

@ -4,20 +4,36 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-ast
- id: check-yaml
args: [--unsafe]
- id: check-added-large-files
- id: check-ast
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-yaml
args: ['--unsafe']
- id: end-of-file-fixer
# files: \.(py|sh|rst|md|yml|yaml)$
exclude: \.(json|jsonc|js|map)$
- id: trailing-whitespace
exclude: \.(json|jsonc|js|map)$
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 'v3.0.0-alpha.4'
hooks:
- id: prettier
- repo: https://github.com/psf/black
rev: 23.1.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:
@ -25,7 +41,3 @@ repos:
additional_dependencies:
- flake8-black
- flake8-bugbear
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 'v2.7.1'
hooks:
- id: prettier