mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
e1b670ba57
* replaced flake8 with ruff mostly for speed improvements * fix codespell error * move config section * added isort again * move djlint config to pyproject * moved ruff section * remove flake8 from code base * remove flake8 from code base * fix djlint syntax * fix removed sections * fix requirements file * fix getattr useage * auto fixed docstring * adapted ruff settings to better fit code base * reorder order of operations * adjust checks * disable autofix/format * fixed reqs * remove flake8 section from setup.cfg * moved isort config * added missing toml req * fixed req * fixed source path
88 lines
1.8 KiB
TOML
88 lines
1.8 KiB
TOML
|
|
[tool.ruff]
|
|
exclude = [
|
|
".git",
|
|
"__pycache__",
|
|
"dist",
|
|
"build",
|
|
"test.py",
|
|
"tests",
|
|
"venv",
|
|
"env",
|
|
".venv",
|
|
".env",
|
|
]
|
|
src = ["../InvenTree"]
|
|
# line-length = 120
|
|
|
|
[tool.ruff.extend-per-file-ignores]
|
|
"__init__.py" = ["D104"]
|
|
|
|
[tool.ruff.lint]
|
|
select = ["A", "B", "C4", "D", "N"]
|
|
# Things that should be enabled in the future:
|
|
# - LOG
|
|
# - I
|
|
# - DJ # for Django stuff
|
|
# - S # for security stuff (bandit)
|
|
|
|
ignore = [
|
|
"N999",
|
|
# - N802 - function name should be lowercase
|
|
"N802",
|
|
# - N806 - variable should be lowercase
|
|
"N806",
|
|
# - N812 - lowercase imported as non-lowercase
|
|
"N812",
|
|
# - D202 - No blank lines allowed after function docstring
|
|
"D202",
|
|
# - D415 - First line should end with a period, question mark, or exclamation point
|
|
"D415",
|
|
# - D417 Missing argument descriptions in the docstring
|
|
"D417",
|
|
|
|
# TODO These should be followed up and fixed
|
|
# - B904 Within an `except` clause, raise exceptions
|
|
"B904",
|
|
|
|
# Remove fast
|
|
"A001", "A002","A003","B018"
|
|
]
|
|
|
|
[tool.ruff.lint.pydocstyle]
|
|
convention = "google"
|
|
|
|
[tool.ruff.lint.isort]
|
|
split-on-trailing-comma = false
|
|
combine-as-imports = false
|
|
section-order = [
|
|
"future",
|
|
"standard-library",
|
|
"django",
|
|
"third-party",
|
|
"first-party",
|
|
"local-folder",
|
|
]
|
|
known-first-party = ["src", "plugin", "InvenTree", "common"]
|
|
|
|
[tool.ruff.lint.isort.sections]
|
|
"django" = ["django"]
|
|
|
|
[tool.ruff.format]
|
|
quote-style = "preserve"
|
|
indent-style = "space"
|
|
skip-magic-trailing-comma = true
|
|
line-ending = "auto"
|
|
|
|
[tool.coverage.run]
|
|
source = ["InvenTree", ]
|
|
|
|
[tool.djlint]
|
|
ignore = "D018,H006,H008,H020,H021,H023,H025,H030,H031,T002"
|
|
|
|
[tool.isort]
|
|
src_paths=["InvenTree", ]
|
|
skip_glob ="*/migrations/*.py"
|
|
known_django="django"
|
|
sections=["FUTURE","STDLIB","DJANGO","THIRDPARTY","FIRSTPARTY","LOCALFOLDER"]
|