2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

fix: dev: Preserve statement tag order in documentation

This supports bit-for-bit reproducibility of built documentation.

Closes #4886

Merge branch 'issue-4886/order-preserving-documentation-tags' into 'main'

Closes #4886

See merge request isc-projects/bind9!9399
This commit is contained in:
Petr Špaček
2024-08-23 13:57:31 +00:00

View File

@@ -47,6 +47,8 @@ def split_csv(argument, required):
"a non-empty list required; provide at least one value or remove"
" this option"
)
if not len(outlist) == len(set(outlist)):
raise ValueError("duplicate value detected")
return outlist
@@ -73,10 +75,8 @@ def domain_factory(domainname, domainlabel, todolist, grammar):
def run(self):
placeholder = todolist("")
placeholder["isc_filter_tags"] = set(self.options.get("filter_tags", []))
placeholder["isc_filter_blocks"] = set(
self.options.get("filter_blocks", [])
)
placeholder["isc_filter_tags"] = self.options.get("filter_tags", [])
placeholder["isc_filter_blocks"] = self.options.get("filter_blocks", [])
return [placeholder]
class ISCConfDomain(Domain):
@@ -127,7 +127,7 @@ def domain_factory(domainname, domainlabel, todolist, grammar):
@property
def isc_tags(self):
return set(self.options.get("tags", []))
return self.options.get("tags", [])
@property
def isc_short(self):
@@ -475,11 +475,11 @@ def domain_factory(domainname, domainlabel, todolist, grammar):
lambda item: (
(
not acceptable_tags
or item["tags"].intersection(acceptable_tags)
or set(item["tags"]).intersection(acceptable_tags)
)
and (
not acceptable_blocks
or item["block_names"].intersection(
or set(item["block_names"]).intersection(
acceptable_blocks
)
)