]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Centralize Python tooling configuration in pyproject.toml
authorŠtěpán Balážik <stepan@isc.org>
Tue, 27 Jan 2026 19:39:17 +0000 (20:39 +0100)
committerŠtěpán Balážik <stepan@isc.org>
Fri, 20 Feb 2026 14:17:31 +0000 (15:17 +0100)
This allows easy running of the tools from the project root both in CI
and locally.

.gitlab-ci.yml
.pylintrc [deleted file]
pyproject.toml [new file with mode: 0644]

index 35854bbc079ddad4b89160a3bb8764a4e6cee32b..6710a32558f5eb0d6fbb952bf2e8d233179e11e3 100644 (file)
@@ -669,7 +669,7 @@ vulture:
   <<: *quick_checks_job
   <<: *python_triggering_rules
   script:
-    - vulture --exclude "*ans.py,conftest.py,re_compile_checker.py,isctest" --ignore-names "after_servers_start,bootstrap,pytestmark,autouse_*" bin/tests/system/
+    - vulture
 
 ci-variables:
   <<: *quick_checks_job
@@ -767,12 +767,8 @@ doctest:
 pylint:
   <<: *quick_checks_job
   <<: *python_triggering_rules
-  variables:
-    PYTHONPATH: "${CI_PROJECT_DIR}/bin/tests/system"
   script:
-    - pylint --rcfile $CI_PROJECT_DIR/.pylintrc $(git ls-files '*.py' | grep -vE '(ans\.py|dangerfile\.py|^bin/tests/system/|^contrib/)')
-      # Ignore Pylint wrong-import-position error in system test to enable use of pytest.importorskip
-    - pylint --rcfile $CI_PROJECT_DIR/.pylintrc --load-plugins re_compile_checker --disable=wrong-import-position $(git ls-files 'bin/tests/system/*.py' | grep -vE '(ans\.py|vulture_ignore_list\.py)')
+    - pylint $(git ls-files '*.py')
 
 reuse:
   <<: *quick_checks_job
diff --git a/.pylintrc b/.pylintrc
deleted file mode 100644 (file)
index 3fb33f3..0000000
--- a/.pylintrc
+++ /dev/null
@@ -1,28 +0,0 @@
-[IMPORTS]
-
-deprecated-modules=
-    dns.resolver,
-
-[MESSAGES CONTROL]
-
-disable=
-    C0103, # invalid-name
-    C0114, # missing-module-docstring
-    C0115, # missing-class-docstring
-    C0116, # missing-function-docstring
-    C0209, # consider-using-f-string
-    C0301, # line-too-long, handled better by black
-    C0302, # too-many-lines
-    C0415, # import-outside-toplevel
-    R0801, # duplicate-code
-    R0901, # too-many-ancestors
-    R0902, # too-many-instance-attributes
-    R0903, # too-few-public-methods
-    R0904, # too-many-public-methods
-    R0911, # too-many-return-statements
-    R0912, # too-many-branches
-    R0913, # too-many-arguments
-    R0914, # too-many-locals
-    R0915, # too-many-statements
-    R0916, # too-many-boolean-expressions
-    R0917, # too-many-positional-arguments
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644 (file)
index 0000000..65ce8ba
--- /dev/null
@@ -0,0 +1,73 @@
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+#
+# SPDX-License-Identifier: MPL-2.0
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, you can obtain one at https://mozilla.org/MPL/2.0/.
+#
+# See the COPYRIGHT file distributed with this work for additional
+# information regarding copyright ownership.
+
+[tool.pylint.imports]
+deprecated-modules = [
+  "dns.resolver",
+]
+[tool.pylint.messages_control]
+disable = [
+  "C0103", # invalid-name
+  "C0209", # consider-using-f-string
+  "C0114", # missing-module-docstring
+  "C0115", # missing-class-docstring
+  "C0116", # missing-function-docstring
+  "C0301", # line-too-long, handled better by black
+  "C0302", # too-many-lines
+  "C0415", # import-outside-toplevel
+  "R0801", # duplicate-code
+  "R0901", # too-many-ancestors
+  "R0902", # too-many-instance-attributes
+  "R0903", # too-few-public-methods
+  "R0904", # too-many-public-methods
+  "R0911", # too-many-return-statements
+  "R0912", # too-many-branches
+  "R0913", # too-many-arguments
+  "R0914", # too-many-locals
+  "R0915", # too-many-statements
+  "R0916", # too-many-boolean-expressions
+  "R0917", # too-many-positional-arguments
+]
+[tool.pylint.main]
+ignore-paths = [
+  ".git",
+  "bin/tests/system/vulture_ignore_list.py",
+  "contrib",
+  "dangerfile.py",
+  "doc",
+]
+ignore-patterns = [
+  "^.*_tmp_.*\\.py$",
+]
+init-hook = "import sys; sys.path.append('bin/tests/system')"
+load-plugins = [
+  "re_compile_checker",
+]
+source-roots = [
+  "bin/tests/system/",
+]
+
+[tool.vulture]
+paths = [
+  "bin/tests/system/",
+]
+exclude = [
+  "*ans.py",
+  "conftest.py",
+  "re_compile_checker.py",
+  "isctest",
+]
+ignore_names = [
+  "after_servers_start",
+  "bootstrap",
+  "pytestmark",
+  "autouse_*",
+]