Skip to content

Commit

Permalink
🔧 Remove unused configuration variables (#1303)
Browse files Browse the repository at this point in the history
Remove defined configuration variables that are not used anywhere in the codebase.
They are likely legacy configurations that were used once but no more.
  • Loading branch information
chrisjsewell authored Sep 16, 2024
1 parent d48e8e4 commit d25bd33
Showing 1 changed file with 39 additions and 19 deletions.
58 changes: 39 additions & 19 deletions sphinx_needs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from typing_extensions import NotRequired, Required

from sphinx_needs.data import NeedsInfoType
from sphinx_needs.functions.functions import DynamicFunction


@dataclass
Expand Down Expand Up @@ -255,73 +256,76 @@ def __setattr__(self, name: str, value: Any) -> None:
include_needs: bool = field(
default=True, metadata={"rebuild": "html", "types": (bool,)}
)
need_name: str = field(
default="Need", metadata={"rebuild": "html", "types": (str,)}
)
spec_name: str = field(
default="Specification", metadata={"rebuild": "html", "types": (str,)}
)
id_prefix_needs: str = field(
default="", metadata={"rebuild": "html", "types": (str,)}
)
id_prefix_specs: str = field(
default="", metadata={"rebuild": "html", "types": (str,)}
)
id_length: int = field(default=5, metadata={"rebuild": "html", "types": (int,)})
"""Length of auto-generated IDs (without prefix)"""
id_from_title: bool = field(
default=False, metadata={"rebuild": "html", "types": (bool,)}
)
specs_show_needlist: bool = field(
default=False, metadata={"rebuild": "html", "types": (bool,)}
)
"""Base auto-generated IDs on the title."""
id_required: bool = field(
default=False, metadata={"rebuild": "html", "types": (bool,)}
)
"""Require an ID for each need."""
id_regex: str = field(
default="^[A-Z0-9_]{5,}", metadata={"rebuild": "html", "types": ()}
)
"""Regex to validate need IDs."""
show_link_type: bool = field(
default=False, metadata={"rebuild": "html", "types": (bool,)}
)
"""Show the link type in the need incoming/outgoing roles."""
show_link_title: bool = field(
default=False, metadata={"rebuild": "html", "types": (bool,)}
)
"""Show the link title in the need incoming/outgoing roles."""
show_link_id: bool = field(
default=True, metadata={"rebuild": "html", "types": (bool,)}
)
"""Show the link ID in the need incoming/outgoing roles."""
file: None | str = field(default=None, metadata={"rebuild": "html", "types": ()})
"""Path to the needs builder input file."""
table_columns: str = field(
default="ID;TITLE;STATUS;TYPE;OUTGOING;TAGS",
metadata={"rebuild": "html", "types": (str,)},
)
"""Default columns to show in the needtable."""
table_style: str = field(
default="DATATABLES", metadata={"rebuild": "html", "types": (str,)}
)
"""Default style for the needtable."""
role_need_template: str = field(
default="{title} ({id})", metadata={"rebuild": "html", "types": (str,)}
)
"""Template for the need role output."""
role_need_max_title_length: int = field(
default=30, metadata={"rebuild": "html", "types": (int,)}
)
"""Maximum length of the title in the need role output."""
extra_options: list[str] = field(
default_factory=list, metadata={"rebuild": "html", "types": (list,)}
)
"""List of extra options for needs, that get added as directive options and need fields."""
title_optional: bool = field(
default=False, metadata={"rebuild": "html", "types": (bool,)}
)
"""If True, the title of a need directive is optional."""
max_title_length: int = field(
default=-1, metadata={"rebuild": "html", "types": (int,)}
)
"""Maximum length of an auto-generated need title."""
title_from_content: bool = field(
default=False, metadata={"rebuild": "html", "types": (bool,)}
)
"""Create auto-generated titles from the first sentence of content."""
diagram_template: str = field(
default=DEFAULT_DIAGRAM_TEMPLATE,
metadata={"rebuild": "html", "types": (str,)},
)
functions: list[Callable[..., Any]] = field(
"""Template for node content in needflow diagrams (with plantuml engine)."""
functions: list[DynamicFunction] = field(
default_factory=list, metadata={"rebuild": "html", "types": (list,)}
)
"""List of dynamic functions."""
global_options: GlobalOptionsType = field(
default_factory=dict, metadata={"rebuild": "html", "types": (dict,)}
)
Expand All @@ -337,6 +341,7 @@ def __setattr__(self, name: str, value: Any) -> None:
needextend_strict: bool = field(
default=False, metadata={"rebuild": "html", "types": (bool,)}
)
"""Raise exceptions if a needextend filter does not match any needs."""
statuses: list[dict[str, str]] = field(
default_factory=list, metadata={"rebuild": "html", "types": ()}
)
Expand Down Expand Up @@ -374,66 +379,79 @@ def __setattr__(self, name: str, value: Any) -> None:
filter_data: dict[str, Any] = field(
default_factory=dict, metadata={"rebuild": "html", "types": ()}
)
"""Additional context data for filters."""
allow_unsafe_filters: bool = field(
default=False, metadata={"rebuild": "html", "types": (bool,)}
)
"""Allow filters to change the need data."""
flow_engine: Literal["plantuml", "graphviz"] = field(
default="plantuml", metadata={"rebuild": "env", "types": (str,)}
)
"""The rendering engine to use for needflow diagrams."""
flow_show_links: bool = field(
default=False, metadata={"rebuild": "html", "types": (bool,)}
)
"""If True, show links in needflow diagrams by default."""
flow_link_types: list[str] = field(
default_factory=lambda: ["links"], metadata={"rebuild": "html", "types": ()}
)
"""Defines the link_types to show in a needflow diagram."""
warnings: dict[str, Any] = field(
default_factory=dict, metadata={"rebuild": "html", "types": ()}
)
"""Defines warnings to be checked at the end of the build (name -> string filter / filter function)."""
warnings_always_warn: bool = field(
default=False, metadata={"rebuild": "html", "types": (bool,)}
)
"""If True, log individual warnings per warning check failed."""
layouts: dict[str, dict[str, Any]] = field(
default_factory=dict, metadata={"rebuild": "html", "types": ()}
)
"""Defines custom layouts for needs rendering."""
default_layout: str = field(
default="clean", metadata={"rebuild": "html", "types": (str,)}
)
"""The default layout to use for needs rendering."""
default_style: None | str = field(
default=None, metadata={"rebuild": "html", "types": ()}
)
"""The default style to use for needs rendering."""
flow_configs: dict[str, str] = field(
default_factory=dict, metadata={"rebuild": "html", "types": ()}
)
"""Additional configuration for needflow diagrams (plantuml engine)."""
graphviz_styles: dict[str, GraphvizStyleType] = field(
default_factory=dict, metadata={"rebuild": "html", "types": ()}
)
"""Additional configuration for needflow diagrams (graphviz engine)."""
template_folder: str = field(
default="needs_templates/", metadata={"rebuild": "html", "types": (str,)}
)
"""Path to the template folder for needs rendering templates."""
services: dict[str, dict[str, Any]] = field(
default_factory=dict, metadata={"rebuild": "html", "types": ()}
)
"""Extra configuration options for services."""
service_all_data: bool = field(
default=False, metadata={"rebuild": "html", "types": (bool,)}
)
debug_no_external_calls: bool = field(
default=False, metadata={"rebuild": "html", "types": (bool,)}
)
"""If True, unknown sevice option data is shown in the need content."""
external_needs: list[ExternalSource] = field(
default_factory=list, metadata={"rebuild": "html", "types": (list,)}
)
"""List of external sources to load needs from."""
builder_filter: str = field(
default="is_external==False", metadata={"rebuild": "html", "types": (str,)}
)
"""Filter string to use for the needs builder."""
table_classes: list[str] = field(
default_factory=list, metadata={"rebuild": "html", "types": (list,)}
)
"""Additional classes to set for needs and needtable."""
string_links: dict[str, dict[str, Any]] = field(
default_factory=dict, metadata={"rebuild": "html", "types": (dict,)}
)
"""In the need representation, find and render links in field values."""
build_json: bool = field(
default=False, metadata={"rebuild": "html", "types": (bool,)}
)
Expand Down Expand Up @@ -495,9 +513,11 @@ def __setattr__(self, name: str, value: Any) -> None:
variants: dict[str, str] = field(
default_factory=dict, metadata={"rebuild": "html", "types": (dict,)}
)
"""Mapping of variant name to filter string."""
variant_options: list[str] = field(
default_factory=list, metadata={"rebuild": "html", "types": (list,)}
)
"""List of need fields that may contain variants."""

# add render context option
render_context: dict[str, Any] = field(
Expand Down

0 comments on commit d25bd33

Please sign in to comment.