mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
switched to ruff for import sorting
This commit is contained in:
parent
f83fedbbb8
commit
fd74f8d703
@ -15,10 +15,6 @@ repos:
|
|||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
- id: mixed-line-ending
|
- id: mixed-line-ending
|
||||||
- repo: https://github.com/pycqa/isort
|
|
||||||
rev: '5.12.0'
|
|
||||||
hooks:
|
|
||||||
- id: isort
|
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.1.11
|
rev: v0.1.11
|
||||||
hooks:
|
hooks:
|
||||||
|
@ -12,17 +12,16 @@ exclude = [
|
|||||||
".venv",
|
".venv",
|
||||||
".env",
|
".env",
|
||||||
]
|
]
|
||||||
src = ["../InvenTree"]
|
src = ["InvenTree"]
|
||||||
# line-length = 120
|
# line-length = 120
|
||||||
|
|
||||||
[tool.ruff.extend-per-file-ignores]
|
[tool.ruff.extend-per-file-ignores]
|
||||||
"__init__.py" = ["D104"]
|
"__init__.py" = ["D104"]
|
||||||
|
|
||||||
[tool.ruff.lint]
|
[tool.ruff.lint]
|
||||||
select = ["A", "B", "C4", "D", "N"]
|
select = ["A", "B", "C4", "D", "I", "N"]
|
||||||
# Things that should be enabled in the future:
|
# Things that should be enabled in the future:
|
||||||
# - LOG
|
# - LOG
|
||||||
# - I
|
|
||||||
# - DJ # for Django stuff
|
# - DJ # for Django stuff
|
||||||
# - S # for security stuff (bandit)
|
# - S # for security stuff (bandit)
|
||||||
|
|
||||||
@ -63,7 +62,6 @@ section-order = [
|
|||||||
"first-party",
|
"first-party",
|
||||||
"local-folder",
|
"local-folder",
|
||||||
]
|
]
|
||||||
known-first-party = ["src", "plugin", "InvenTree", "common"]
|
|
||||||
|
|
||||||
[tool.ruff.lint.isort.sections]
|
[tool.ruff.lint.isort.sections]
|
||||||
"django" = ["django"]
|
"django" = ["django"]
|
||||||
|
19
setup.cfg
19
setup.cfg
@ -1,19 +0,0 @@
|
|||||||
[flake8]
|
|
||||||
ignore =
|
|
||||||
# - W605 - invalid escape sequence
|
|
||||||
W605,
|
|
||||||
# - E501 - line too long (82 characters)
|
|
||||||
E501,
|
|
||||||
# - E722 - do not use bare except
|
|
||||||
E722,
|
|
||||||
# - C901 - function is too complex
|
|
||||||
C901,
|
|
||||||
# - B009 - Do not call getattr with a constant attribute value
|
|
||||||
B009
|
|
||||||
exclude = .git,__pycache__,*/migrations/*,*/lib/*,*/bin/*,*/media/*,*/static/*,InvenTree/plugins/*
|
|
||||||
|
|
||||||
[isort]
|
|
||||||
src_paths=InvenTree
|
|
||||||
skip_glob =*/migrations/*.py
|
|
||||||
known_django=django
|
|
||||||
sections=FUTURE, STDLIB, DJANGO, THIRDPARTY, FIRSTPARTY, LOCALFOLDER
|
|
Loading…
Reference in New Issue
Block a user