Skip to content

Commit

Permalink
🔧 Remove NeedList.JSON_KEY_EXCLUSIONS_FILTERS (#1245)
Browse files Browse the repository at this point in the history
This mistakenly contains a set of keys related to `NeedsInfoType`, not `NeedsFilterType`, and there should be no reason to exclude any keys from `NeedsFilterType`
  • Loading branch information
chrisjsewell authored Aug 27, 2024
1 parent cd77ec7 commit 5f706dc
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions sphinx_needs/needsfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,6 @@ class NeedsList:
name for name, params in NeedsCoreFields.items() if params.get("exclude_json")
}

JSON_KEY_EXCLUSIONS_FILTERS = {
"links_back",
"type_color",
"hide_status",
"hide",
"type_prefix",
"lineno",
"lineno_content",
"collapse",
"type_style",
"hide_tags",
"content",
"content_node",
}

def __init__(
self, config: Config, outdir: str, confdir: str, add_schema: bool = True
) -> None:
Expand Down Expand Up @@ -129,7 +114,6 @@ def __init__(
# also exclude back links for link types dynamically set by the user
back_link_keys = {x["option"] + "_back" for x in self.needs_config.extra_links}
self._exclude_need_keys = self.JSON_KEY_EXCLUSIONS_NEEDS | back_link_keys
self._exclude_filter_keys = self.JSON_KEY_EXCLUSIONS_FILTERS | back_link_keys

def update_or_add_version(self, version: str) -> None:
if version not in self.needs_list["versions"].keys():
Expand Down Expand Up @@ -173,11 +157,7 @@ def add_need(self, version: str, need_info: NeedsInfoType) -> None:

def add_filter(self, version: str, need_filter: NeedsFilterType) -> None:
self.update_or_add_version(version)
writable_filters = {
key: need_filter[key] # type: ignore[literal-required]
for key in need_filter
if key not in self._exclude_filter_keys
}
writable_filters = {**need_filter}
self.needs_list["versions"][version]["filters"][
need_filter["export_id"].upper()
] = writable_filters
Expand Down

0 comments on commit 5f706dc

Please sign in to comment.