From a29027c3323cf8c3ab46549e8656bfdfce293241 Mon Sep 17 00:00:00 2001 From: jr-hartono <130978844+jr-hartono@users.noreply.github.com> Date: Wed, 28 Feb 2024 08:31:23 +0100 Subject: [PATCH] Move ruff config to pyproject.toml --- .ruff.toml | 39 --------------------------------------- pyproject.toml | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 39 deletions(-) delete mode 100644 .ruff.toml diff --git a/.ruff.toml b/.ruff.toml deleted file mode 100644 index 062ff32..0000000 --- a/.ruff.toml +++ /dev/null @@ -1,39 +0,0 @@ -include = ["ensysmod/**/*.py", "tests/**/*.py"] - -line-length = 150 -target-version = "py311" - -[lint] -select = ["ALL"] -ignore = ["N", "D", "ANN", "S", "BLE", "A", "EM", "TD", "FIX", "PL", "TRY"] - -# conflicting lint rules: https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules -extend-ignore = [ - "W191", - "E111", - "E114", - "E117", - "D206", - "D300", - "Q000", - "Q001", - "Q002", - "Q003", - "COM812", - "COM819", - "ISC001", - "ISC002", -] - -[lint.per-file-ignores] -"__init__.py" = [ - "I001", # allow unsorted imports in __init__.py - "F401", # allow unused imports in __init__.py -] -"tests/*" = [ - "S101", # allow assert statements for pytest - "ARG", # allow unused arguments for pytest fixtures -] -"ensysmod/api/endpoints/*" = [ - "B008", # allow function calls (Depends, File) in API endpoints -] diff --git a/pyproject.toml b/pyproject.toml index 2272ac3..0bebbdd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,3 +85,44 @@ exclude_lines = [ ] skip_covered = true skip_empty = true + +[tool.ruff] +include = ["ensysmod/**/*.py", "tests/**/*.py"] + +line-length = 150 +target-version = "py311" + +[tool.ruff.lint] +select = ["ALL"] +ignore = ["N", "D", "ANN", "S", "BLE", "A", "EM", "TD", "FIX", "PL", "TRY"] + +# conflicting lint rules: https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules +extend-ignore = [ + "W191", + "E111", + "E114", + "E117", + "D206", + "D300", + "Q000", + "Q001", + "Q002", + "Q003", + "COM812", + "COM819", + "ISC001", + "ISC002", +] + +[tool.ruff.lint.per-file-ignores] +"__init__.py" = [ + "I001", # allow unsorted imports in __init__.py + "F401", # allow unused imports in __init__.py +] +"tests/*" = [ + "S101", # allow assert statements for pytest + "ARG", # allow unused arguments for pytest fixtures +] +"ensysmod/api/endpoints/*" = [ + "B008", # allow function calls (Depends, File) in API endpoints +]