Skip to content

Commit

Permalink
🔧 Add strict typing for `sphinx_needs.directives.needlist
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Aug 28, 2023
1 parent e45bc1a commit a0203e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Expand Up @@ -105,7 +105,6 @@ module = [
'sphinx_needs.directives.needextract',
'sphinx_needs.directives.needfilter',
'sphinx_needs.directives.needflow',
'sphinx_needs.directives.needlist',
'sphinx_needs.directives.needpie',
'sphinx_needs.directives.needtable',
'sphinx_needs.directives.needuml',
Expand Down
5 changes: 2 additions & 3 deletions sphinx_needs/directives/needlist.py
Expand Up @@ -34,7 +34,7 @@ class NeedlistDirective(FilterBase):
}

# Update the options_spec with values defined in the FilterBase class
option_spec.update(FilterBase.base_option_spec) # type: ignore[arg-type]
option_spec.update(FilterBase.base_option_spec)

def run(self) -> Sequence[nodes.Node]:
env = self.env
Expand Down Expand Up @@ -83,9 +83,8 @@ def process_needlist(app: Sphinx, doctree: nodes.document, fromdocname: str, fou

id = node.attributes["ids"][0]
current_needfilter = SphinxNeedsData(env).get_or_create_lists()[id]
all_needs = SphinxNeedsData(env).get_or_create_needs()
content: List[nodes.Node] = []
all_needs = list(all_needs.values())
all_needs = list(SphinxNeedsData(env).get_or_create_needs().values())
found_needs = process_filters(app, all_needs, current_needfilter)

line_block = nodes.line_block()
Expand Down

0 comments on commit a0203e7

Please sign in to comment.