Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[1.1.0] - 2026-10-03¶
Added¶
Validator.remove_rule(name)— the counterpart toadd_rule.
Fixed¶
- Validation rules now cover scenarios, backgrounds, and tables inside
Gherkin v6 Rules:
EmptyFeatureRuleno longer reports a false positive on features whose scenarios live only inside rules, andDuplicateScenarioNamesRule,EmptyScenarioRule, andInvalidTableRulecheck rule contents. - Transformations (
rename_tag,remove_tag,sort_tags,rename_scenario,normalize_whitespace,sort_scenarios) now apply inside Rules as well. sort_scenarios(key=...)no longer silently ignores itskeyargument; it accepts"name"(default) or"line"and raisesTransformationErrorotherwise.- Visitor traversal via
accept()now reaches tags, tables, docstrings, and comments —visit_tag,visit_table,visit_docstring, and the newvisit_commentare actually invoked.CollectingVisitoralso collectsproject,examples,table,docstring, andcommentnodes. Project.walk()now yieldsExamplestags and comments.Metadata.tool_versionnow defaults to the installed behave-model version instead of the hardcoded"0.1.0".find_scenarios(tag=)andfind_scenarios_with_tag()match inherited tags (feature, rule, andExamplestags apply to their scenarios), matching Behave's tag semantics. Exactname=matching is now case-insensitive, consistent withfind_feature.TagandCommentusefield(default_factory=Location)instead of a sharedLocation()default.load_featurenow raisesNotADirectoryErrorwhen given a directory, andload_projectwhen given a file — previously a file path silently produced an empty project and a directory raised an opaque read error.Project.walk(strategy=...)raisesValueErrorfor unknown strategies instead of silently falling back to DFS.BehaveParserAdapterdetectsScenarioOutlinewithisinstanceinstead of comparing class-name strings.DictSerializer.serialize_projectnow includesmetadata.created_atandmetadata.extra, andserialize_tableemits arow_locationslist so table-row locations are no longer dropped.
Changed¶
- Duplicate-name validation is now case-insensitive.
add_tag_to_featureandrename_scenariomatch names case-insensitively.
Documentation¶
- Corrected multiple API inaccuracies:
ValidationIssue.rule(was documented asrule_name),Location.__str__format,statistics()keys,PrettyPrinterpublic methods,parse_projectsignature, serializer and visitor method names, andMetadatafields. - Removed the incorrect claim that all model classes are frozen
dataclasses (only
Locationis frozen). - Fixed the project structure listing and dev-dependency claims in the contributing guide.
Build¶
- Added
buildandtwineto thedevextra. tox.inirewritten for tox 4 (package = editable+extras = dev).- Pinned ruff
v0.16.10in pre-commit and CI lint to keep them in sync. release.yml: removedcontinue-on-erroron the PyPI publish job so publish failures fail the workflow.docs.yml: also triggers onmasterand on changes to the workflow itself.
[1.0.1] - 2026-07-02¶
Fixed¶
__version__was stuck at0.1.0— now correctly reports1.0.1.- README
make docscommand fixed tomake docs-serve(the actual serve target). - Removed non-existent
.pre-commit-config.yamlfrom changelog. - Replaced hardcoded coverage badge with dynamic Codecov badge.
Changed¶
- Simplified README: removed duplicated content that lives in the documentation site.
- Simplified MkDocs config: removed Material-specific features (icons, tabs, tooltips) that required extra configuration. Navigation is now sidebar-only.
- Cleaned all docs: replaced
:material-*:icons and===tabbed sections with plain markdown. - Removed empty
docs/assets/directory.
[1.0.0] - 2026-07-02¶
Added¶
Rulemodel class for Gherkin v6Rulekeyword support.Feature.ruleslist andFeature.all_scenarios()now includes rule scenarios.BehaveParserAdapter._adapt_rule()to parse Behave Rule objects.Visitor.visit_rule()in base visitor,CountingVisitor, andCollectingVisitor.ProjectDFS/BFS traversal now includes Rule nodes.DictSerializer.serialize_rule()and rules inserialize_feature().PrettyPrinter._print_rule()with proper indentation for rule scenarios.Ruleexported in public API (behave_model.Rule).- Example feature file
examples/rules.featuredemonstrating Gherkin v6 Rules. - 31 new tests for Rule support in
tests/test_rules.py. - MkDocs Material documentation site with GitHub Pages deployment.
- CI/CD workflows:
ci.yml,release.yml,docs.yml. .gitignore,tox.ini,Makefile,conftest.py.
Changed¶
- Tests moved from
behave_model/tests/totests/at project root. pyproject.tomltestpathsupdated to["tests"].PrettyPrinterscenario/outline/examples methods now acceptindentparameter.Project.all_scenarios()delegates toFeature.all_scenarios()for rule inclusion.- README rewritten with badges, compatibility table, and architecture overview.
Compatibility¶
- Verified full compatibility with Behave 1.3.3.
- Verified Tag Expression v2 support (both v1 and v2 parsers present in Behave).
- Verified Gherkin v6
Rulekeyword parsing and roundtrip.
[0.1.0] - 2026-07-01¶
Added¶
- Initial release of
behave-model. - Domain model:
Project,Feature,Background,Scenario,ScenarioOutline,Examples,Step,Table,Tag,DocString,Comment,Location,Metadata. - Parser adapter over Behave's built-in parser with
load_projectandload_feature. - Visitor pattern with depth-first and breadth-first traversal.
- Query API:
find_feature,find_tag,find_steps,find_scenarios. - Serializers: dictionary and JSON.
- Transformations: rename tag, rename scenario, sort tags, sort features, normalize whitespace.
- Validation framework with pluggable rules.
- Statistics: feature count, scenario count, step count, average steps per scenario, tag count.
- Pretty printer that generates valid
.featurefiles. - Exception hierarchy:
BehaveModelError,ParseError,ValidationError,TransformationError,SerializationError.