Skip to content

Commit 257c5be

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 31e7a15 commit 257c5be

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

sphinx_needs/functions/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def resolve_variants_options(
363363
**needs_config.filter_data
364364
) # Add needs_filter_data to filter context
365365
need_context.update(
366-
**{tag: True for tag in tags}
366+
**dict.fromkeys(tags, True)
367367
) # Add sphinx tags to filter context
368368
location = (need["docname"], need["lineno"]) if need.get("docname") else None
369369

sphinx_needs/needsfile.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ def generate_needs_schema(
7272
}
7373

7474
for name in exclude_properties:
75-
if name in properties:
76-
del properties[name]
75+
properties.pop(name, None)
7776

7877
return {
7978
"$schema": "http://json-schema.org/draft-07/schema#",

sphinx_needs/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def _copy_filtered(
340340
) -> NeedsAndPartsListView:
341341
"""Create a new view with only the needs/parts with the given ids."""
342342
if self._selected_ids is None:
343-
selected_ids = {n: None for n in ids}
343+
selected_ids = dict.fromkeys(ids)
344344
else:
345345
selected_ids = {n: None for n in ids if n in self._selected_ids}
346346
return NeedsAndPartsListView(_indexes=self._indexes, _selected_ids=selected_ids)

0 commit comments

Comments
 (0)