2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-04 08:35:31 +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" "a non-empty list required; provide at least one value or remove"
" this option" " this option"
) )
if not len(outlist) == len(set(outlist)):
raise ValueError("duplicate value detected")
return outlist return outlist
@@ -73,10 +75,8 @@ def domain_factory(domainname, domainlabel, todolist, grammar):
def run(self): def run(self):
placeholder = todolist("") placeholder = todolist("")
placeholder["isc_filter_tags"] = set(self.options.get("filter_tags", [])) placeholder["isc_filter_tags"] = self.options.get("filter_tags", [])
placeholder["isc_filter_blocks"] = set( placeholder["isc_filter_blocks"] = self.options.get("filter_blocks", [])
self.options.get("filter_blocks", [])
)
return [placeholder] return [placeholder]
class ISCConfDomain(Domain): class ISCConfDomain(Domain):
@@ -127,7 +127,7 @@ def domain_factory(domainname, domainlabel, todolist, grammar):
@property @property
def isc_tags(self): def isc_tags(self):
return set(self.options.get("tags", [])) return self.options.get("tags", [])
@property @property
def isc_short(self): def isc_short(self):
@@ -475,11 +475,11 @@ def domain_factory(domainname, domainlabel, todolist, grammar):
lambda item: ( lambda item: (
( (
not acceptable_tags not acceptable_tags
or item["tags"].intersection(acceptable_tags) or set(item["tags"]).intersection(acceptable_tags)
) )
and ( and (
not acceptable_blocks not acceptable_blocks
or item["block_names"].intersection( or set(item["block_names"]).intersection(
acceptable_blocks acceptable_blocks
) )
) )