From: Štěpán Balážik Date: Wed, 28 Jan 2026 16:08:44 +0000 (+0100) Subject: Lint code in doc directory X-Git-Tag: v9.21.19~15^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fb7403ef42d3a795bb21ca3c481e139491384bb;p=thirdparty%2Fbind9.git Lint code in doc directory Adjust ignore lists of linters to check more code. --- diff --git a/doc/arm/_ext/iscconf.py b/doc/arm/_ext/iscconf.py index 43131941194..06ade142692 100644 --- a/doc/arm/_ext/iscconf.py +++ b/doc/arm/_ext/iscconf.py @@ -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, diff --git a/pyproject.toml b/pyproject.toml index 60e51cebbef..9946ac8df80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", ]