From 09680c811268d8fbf13f309426b1e16dd6e83994 Mon Sep 17 00:00:00 2001 From: Jan Snasel Date: Tue, 16 Jan 2024 12:45:58 +0000 Subject: [PATCH 1/4] fix: Ruff ignores --- pyproject.toml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 95cb3e8..ad405a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -114,9 +114,6 @@ supported_nautobot_versions = [ [tool.ruff] line-length = 120 target-version = "py38" -exclude = [ - "migrations", -] [tool.ruff.lint] select = [ @@ -137,8 +134,24 @@ ignore = [ "D212", # Multi-line docstring summary should start at the first line "D213", # Multi-line docstring summary should start at the second line - # Produces a lot of issues in the current codebase. + # Produces issues in the current codebase. "D401", # First line of docstring should be in imperative mood + "D407", # Missing dashed underline after section + "D416", # Section name ends in colon +] + +[tool.ruff.per-file-ignores] +"nautobot_firewall_models/migrations/*" = [ + "D1", # pydocstyle + "D2", # pydocstyle + "D3", # pydocstyle + "D4", # pydocstyle +] +"nautobot_firewall_models/tests/*" = [ + "D1", # pydocstyle + "D2", # pydocstyle + "D3", # pydocstyle + "D4", # pydocstyle ] [build-system] From 0dc044678e57c5702aafc234418b5fee40565189 Mon Sep 17 00:00:00 2001 From: Jan Snasel Date: Tue, 16 Jan 2024 12:51:08 +0000 Subject: [PATCH 2/4] fix: Add changelog fragment --- changes/212.fixed | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/212.fixed diff --git a/changes/212.fixed b/changes/212.fixed new file mode 100644 index 0000000..fa47a22 --- /dev/null +++ b/changes/212.fixed @@ -0,0 +1 @@ +Fixed ruff excludes to use per-file excludes instead of global excludes. From bfdd87bacdeca167f0ac7b72b82dee14ddd0dea2 Mon Sep 17 00:00:00 2001 From: Jan Snasel Date: Tue, 16 Jan 2024 13:16:46 +0000 Subject: [PATCH 3/4] chore: Set `google` convention for ruff.pydocstyle --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index ad405a8..cf196e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -140,6 +140,9 @@ ignore = [ "D416", # Section name ends in colon ] +[tool.ruff.lint.pydocstyle] +convention = "google" + [tool.ruff.per-file-ignores] "nautobot_firewall_models/migrations/*" = [ "D1", # pydocstyle From 42a0c412200ebf11e27033d6d9c68951fdbd020d Mon Sep 17 00:00:00 2001 From: Jan Snasel Date: Fri, 19 Jan 2024 09:28:01 +0000 Subject: [PATCH 4/4] fix: Use "D" only --- pyproject.toml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cf196e7..871a834 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -117,10 +117,7 @@ target-version = "py38" [tool.ruff.lint] select = [ - "D1", # pydocstyle - "D2", # pydocstyle - "D3", # pydocstyle - "D4", # pydocstyle + "D", # pydocstyle ] ignore = [ # warning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. @@ -145,16 +142,10 @@ convention = "google" [tool.ruff.per-file-ignores] "nautobot_firewall_models/migrations/*" = [ - "D1", # pydocstyle - "D2", # pydocstyle - "D3", # pydocstyle - "D4", # pydocstyle + "D", # pydocstyle ] "nautobot_firewall_models/tests/*" = [ - "D1", # pydocstyle - "D2", # pydocstyle - "D3", # pydocstyle - "D4", # pydocstyle + "D", # pydocstyle ] [build-system]