]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Lint code in doc directory
authorŠtěpán Balážik <stepan@isc.org>
Wed, 28 Jan 2026 16:08:44 +0000 (17:08 +0100)
committerŠtěpán Balážik <stepan@isc.org>
Fri, 20 Feb 2026 14:17:32 +0000 (15:17 +0100)
Adjust ignore lists of linters to check more code.

doc/arm/_ext/iscconf.py
pyproject.toml

index 431319411945bd376d8f9d4dddaa3b0027087cf3..06ade1426924ca6573d92fee65812f7ef686acf6 100644 (file)
@@ -355,7 +355,7 @@ def domain_factory(domainname, domainlabel, todolist, grammar):
             )
 
         def get_statement_name(self, signature):
-            return "{}.{}.{}".format(domainname, "statement", signature)
+            return f"{domainname}.statement.{signature}"
 
         def add_statement(self, signature, tags, short, short_node, lineno):
             """
@@ -363,7 +363,7 @@ def domain_factory(domainname, domainlabel, todolist, grammar):
             No visible effect.
             """
             name = self.get_statement_name(signature)
-            anchor = "{}-statement-{}".format(domainname, signature)
+            anchor = f"{domainname}-statement-{signature}"
 
             new = {
                 "tags": tags,
index 60e51cebbef06203c2e6824ed3db9e19ca94f14e..9946ac8df80bce4053e9f221cb7530d791052cce 100644 (file)
@@ -38,21 +38,27 @@ disable = [
 [tool.pylint.main]
 ignore-paths = [
   ".git",
+  # Temporary directories created by the system test runner
+  # (see bin/tests/system/conftest.py:system_test_dir)
+  "bin/tests/system/.*_tmp_.*/",
   "bin/tests/system/vulture_ignore_list.py",
   "contrib",
   "dangerfile.py",
-  "doc",
+  "doc/arm/conf.py",
+  "doc/man/conf.py",
 ]
-ignore-patterns = [
-  "^.*_tmp_.*\\.py$",
+
+# Both `init-hook` and `source-roots` are needed to avoid import errors,
+# enable plugin loading and calling pylint from CI as `pylint $(git ls-files '*.py')`
+init-hook = "import sys; sys.path.extend(('bin/tests/system', 'doc/misc', 'doc/arm/_ext'));"
+source-roots = [
+  "bin/tests/system",
+  "doc/misc",
+  "doc/arm/_ext",
 ]
-init-hook = "import sys; sys.path.append('bin/tests/system')"
 load-plugins = [
   "re_compile_checker",
 ]
-source-roots = [
-  "bin/tests/system/",
-]
 
 [tool.vulture]
 paths = [
@@ -92,5 +98,6 @@ extend-exclude = [
   "bin/tests/system/vulture_ignore_list.py",
   "contrib",
   "dangerfile.py",
-  "doc",
+  "doc/arm/conf.py",
+  "doc/man/conf.py",
 ]