Static Checking⚓︎
checker
⚓︎
Static validation of Gherkin data tables against talika schemas.
The Gherkin dependency is imported lazily so normal runtime parsing remains
dependency-free. Install the cli extra when using feature-file discovery
or the talika check command.
Info
Static checking still runs schema parsers and validators. Supply deterministic dependencies through parse context when project validators normally depend on services or generators.
FeatureTable
dataclass
⚓︎
One discovered Gherkin step data table.
Attributes:
-
path(Path) –Feature file path.
-
feature(str) –Feature name.
-
scenario(str) –Scenario or background name.
-
step(str) –Step text that owns the data table.
-
table(TableData) –Source-aware table converted from Gherkin AST cells.
Info
The stored TableData uses feature-file line and column coordinates,
not indexes relative to the data table block.
FeatureDiagnostic
dataclass
⚓︎
FeatureDiagnostic(
path: Path, feature: str, scenario: str, step: str, error: TableError
)
One schema diagnostic associated with a feature file and step.
Attributes:
-
path(Path) –Feature file path.
-
feature(str) –Feature name.
-
scenario(str) –Scenario or background name.
-
step(str) –Step text that owns the failing data table.
-
error(TableError) –Structured table error raised by schema parsing.
Info
CLI JSON output is a rendering of this object plus the nested
TableError attributes.
diagnostic
property
⚓︎
diagnostic: Diagnostic
Return the shared immutable Diagnostic Model v1 value.
_gherkin_tools
⚓︎
Load the optional official Gherkin parser and pickle compiler.
Returns:
Raises:
-
TableError–If the optional
clidependency is not installed.
Warning
This dependency is intentionally lazy so core table parsing has no runtime dependency on Gherkin parsing packages.
_table_data
⚓︎
Convert a Gherkin AST data table into TableData.
Parameters:
-
data_table(Mapping[str, Any]) –Gherkin AST mapping containing rows, cells, and locations.
-
source(Path) –Resolved feature file providing the table.
Returns:
-
TableData–Source-aware
TableDatawith feature-file coordinates.
Info
Coordinates come from the official parser's cell locations, so errors point to the feature file rather than to a normalized table index.
_scenario_nodes
⚓︎
Yield scenarios and backgrounds from a Gherkin feature node.
Parameters:
Yields:
Info
Outline expansion is handled separately with the official Gherkin compiler after this traversal identifies the original scenario node.
_example_cells
⚓︎
Map each Examples body-row ID to its parameter source cells.
_compiled_table_data
⚓︎
_compiled_table_data(
source_table: Mapping[str, Any],
compiled_table: Mapping[str, Any],
parameters: Mapping[str, Mapping[str, Any]],
*,
source: Path,
) -> TableData
Combine compiled logical values with precise AST source locations.
_outline_tables
⚓︎
_outline_tables(
*,
source_path: Path,
feature_name: str,
scenario_node: Mapping[str, Any],
pickles: Iterable[Mapping[str, Any]],
step_filter: str | None,
) -> list[FeatureTable]
Expand one scenario outline into logical feature tables.
discover_feature_tables
⚓︎
discover_feature_tables(
path: str | Path, *, step: str | None = None, scenario: str | None = None
) -> list[FeatureTable]
Return matching feature-file data tables.
Parameters:
-
path(str | Path) –Feature file path.
-
step(str | None, default:None) –Optional exact step text filter.
-
scenario(str | None, default:None) –Optional exact scenario/background name filter.
Returns:
-
list[FeatureTable]–Matching
FeatureTableobjects.
Raises:
-
TableError–If discovery cannot read or compile the feature file.
check_feature
⚓︎
check_feature(
path: str | Path,
*,
schema: type[BaseTable],
step: str | None = None,
scenario: str | None = None,
context: Mapping[str, Any] | None = None,
) -> list[FeatureDiagnostic]
Validate matching feature tables without executing pytest scenarios.
Custom parsers and validators still run. Projects whose schemas require
services should supply deterministic checking dependencies through
context or through the CLI's context-factory option.
Parameters:
-
path(str | Path) –Feature file path.
-
schema(type[BaseTable]) –Schema used to parse matching data tables.
-
step(str | None, default:None) –Optional exact step text filter.
-
scenario(str | None, default:None) –Optional exact scenario/background name filter.
-
context(Mapping[str, Any] | None, default:None) –Optional project data passed to schema parsing.
Returns:
-
list[FeatureDiagnostic]–Structured diagnostics for every matching table failure.
Warning
Custom validation code executes during checking. Keep context factories deterministic and free of external side effects in CI/editor workflows.
check_feature_tables
⚓︎
check_feature_tables(
tables: Iterable[FeatureTable],
*,
schema: type[BaseTable],
context: Mapping[str, Any] | None = None,
) -> list[FeatureDiagnostic]
Validate already-discovered feature tables against one schema.
Parameters:
-
tables(Iterable[FeatureTable]) –Feature tables returned by
discover_feature_tables. -
schema(type[BaseTable]) –Schema used to parse each data table.
-
context(Mapping[str, Any] | None, default:None) –Optional project data passed to schema parsing.
Returns:
-
list[FeatureDiagnostic]–Structured diagnostics for every matching table failure.
Info
check_feature discovers tables and delegates here. The CLI calls
this helper after its own discovery pass so it can count matches
without parsing the feature file twice.