From e1bf178b40b3f0d2d59ba92209156c43095959d2 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sun, 7 Jan 2024 20:01:09 +0100 Subject: [PATCH] adapted ruff settings to better fit code base --- .pre-commit-config.yaml | 3 ++- pyproject.toml | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2ec685545e..466e53c58c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,8 +19,9 @@ repos: rev: v0.1.11 hooks: - id: ruff - args: [--fix] + args: [--fix, --preview] - id: ruff-format + args: [--preview] - repo: https://github.com/pycqa/isort rev: '5.12.0' hooks: diff --git a/pyproject.toml b/pyproject.toml index 4acf097dc7..85e100fc43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ exclude = [ ".env", ] src = ["../InvenTree"] +# line-length = 120 [tool.ruff.extend-per-file-ignores] "__init__.py" = ["D104"] @@ -35,6 +36,8 @@ ignore = [ "D202", # - D415 - First line should end with a period, question mark, or exclamation point "D415", + # - S101 - Use of `assert` detected + "S101" ] [tool.ruff.lint.pydocstyle] @@ -57,15 +60,11 @@ known-first-party = ["src", "plugin", "InvenTree", "common"] "django" = ["django"] [tool.ruff.format] -quote-style = "single" +quote-style = "preserve" indent-style = "space" -skip-magic-trailing-comma = false +skip-magic-trailing-comma = true line-ending = "auto" -[tool.ruff.flake8-quotes] -docstring-quotes = "double" -inline-quotes = "double" - [tool.coverage.run] source = "InvenTree"