From fd74f8d703399c19cb3616ea3b2656a50cd7a6e5 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sun, 7 Jan 2024 21:14:38 +0100 Subject: [PATCH] switched to ruff for import sorting --- .pre-commit-config.yaml | 4 ---- pyproject.toml | 6 ++---- setup.cfg | 19 ------------------- 3 files changed, 2 insertions(+), 27 deletions(-) delete mode 100644 setup.cfg diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ecef3e9795..764691ede0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,10 +15,6 @@ repos: - id: end-of-file-fixer - id: check-yaml - 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 rev: v0.1.11 hooks: diff --git a/pyproject.toml b/pyproject.toml index 7bc74bf2b9..4ca3975654 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,17 +12,16 @@ exclude = [ ".venv", ".env", ] -src = ["../InvenTree"] +src = ["InvenTree"] # line-length = 120 [tool.ruff.extend-per-file-ignores] "__init__.py" = ["D104"] [tool.ruff.lint] -select = ["A", "B", "C4", "D", "N"] +select = ["A", "B", "C4", "D", "I", "N"] # Things that should be enabled in the future: # - LOG -# - I # - DJ # for Django stuff # - S # for security stuff (bandit) @@ -63,7 +62,6 @@ section-order = [ "first-party", "local-folder", ] -known-first-party = ["src", "plugin", "InvenTree", "common"] [tool.ruff.lint.isort.sections] "django" = ["django"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 95ca4635f6..0000000000 --- a/setup.cfg +++ /dev/null @@ -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