You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add Gherkin (.feature) support — BDD spec files are currently invisible to the graph #2349
.feature files (Gherkin — Cucumber, behave, SpecFlow, pytest-bdd) produce zero nodes. classify_file finds the extension in none of CODE_EXTENSIONS / DOC_EXTENSIONS / PAPER_EXTENSIONS / IMAGE_EXTENSIONS / OFFICE_EXTENSIONS / VIDEO_EXTENSIONS, so it returns None and the walker drops the file entirely.
Observed on 0.9.23 (detect.py, extension sets around lines 31-36, classify_file around 437-471). Line numbers may differ on the current development branch.
Why it matters
In a BDD codebase the .feature files are the executable specification — simultaneously the requirements document and the test suite. They are arguably the highest-value prose in the repo, and they are the one thing the graph cannot see. In our repo that is 131 files describing the contract the entire codebase implements; every one of them is absent from the graph.
This affects any Cucumber / behave / SpecFlow / pytest-bdd project, not just ours.
Why the one-line version isn't enough
Adding .feature to DOC_EXTENSIONS makes the files visible, but with no entry in the _DISPATCH table they get _get_extractor() == None and an empty structural pass — visible but with no captured structure, no better than unstructured text.
Proposed fix
Implement a real Gherkin extractor following the "Adding a new language extractor" checklist in ARCHITECTURE.md:
extract_gherkin() in extractors/gherkin.py, parsing Feature / Background / Rule / Scenario / Scenario Outline / Examples / tags / Given-When-Then-And-But steps, plus docstrings and data tables.
Register .feature in the _DISPATCH table.
Add .feature to DOC_EXTENSIONS.
Fixture + test following the existing tests/test_languages.py convention.
Gherkin's grammar is line-based and small, so this needs no tree-sitter grammar — scope should be comparable to the existing markdown extractor.
Offer
Happy to implement and submit this as a PR. Two questions before I start:
Is Gherkin support something you want in the project?
Which branch should a PR target? I see active development on v8 while PyPI is publishing 0.9.x.
SHAFT_ENGINE still needs .feature as deterministic CODE (ShaftHQ/SHAFT_ENGINE#5120). Tracking the extractor constraint with the other families in #2851.
Activity
feat: add structural Gherkin (.feature) support (Graphify-Labs#2349)
MohabMohie commentedon Aug 18, 2026
SHAFT_ENGINE still needs .feature as deterministic CODE (ShaftHQ/SHAFT_ENGINE#5120). Tracking the extractor constraint with the other families in #2851.