--- id: reformat-gherkin version: "3.0.1" license: MIT license_treatment: permissive maintenance: active --- # reformat-gherkin — Formatter for Gherkin language License: permissive · Maintenance: active · Downloads: 170.5K/mo ## What it is and what it does Reformat-gherkin is a command-line formatter for Gherkin feature files used in behavior-driven development (BDD) testing. It reads .feature files and applies consistent formatting rules—controlling keyword alignment, indentation width, line endings, and tag layout—so that teams maintain a uniform style regardless of who wrote the file. The tool wraps gherkin-official for parsing and uses click for CLI handling. It operates as a standalone command-line utility or integrates into pre-commit workflows. You can run it on individual files, directories, or stdin/stdout; use --check to validate without modifying; and configure defaults via a .reformat-gherkin.yaml file in your project. The tool follows Unix conventions: exits 0 on success, 1 if --check finds differences, and 123 on internal errors. Use it for: - Enforce consistent Gherkin formatting across a team's BDD test suite before commits via pre-commit hooks. - Reformat legacy feature files to a standard style when adopting a new BDD framework or coding standard. - Validate feature file formatting in CI/CD pipelines using the --check flag to catch style violations. - Adjust indentation and keyword alignment in bulk across many feature files with a single command. - Standardize line endings (LF vs. CRLF) across feature files in multi-platform development teams. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Automatically formats Gherkin feature files to enforce consistent style and indentation, available as a command-line tool or pre-commit hook. Yes, if you maintain Gherkin feature files and want automated, consistent formatting. The package is lightweight, actively maintained, has no known vulnerabilities, and integrates cleanly with pre-commit workflows. The only caveat is that the last release was over 3 years ago; verify that it handles your specific Gherkin syntax and framework before relying on it in production pipelines. ## Install pip install reformat-gherkin uv add reformat-gherkin poetry add reformat-gherkin ## Installing reformat-gherkin Before you install: Low friction: pure Python wheel with six runtime dependencies (PyYAML, attrs, cattrs, click, gherkin-official, wcwidth). Actively maintained with recent commits; last release was over 3 years ago but repository remains active. License in practice: MIT license (permissive) places no restrictions on use, modification, or distribution in commercial or private projects. Quickstart: pip install reformat-gherkin reformat-gherkin path/to/feature.feature # or with options: reformat-gherkin --alignment right --tab-width 4 path/to/features/ Requires Python 3.7 or later. Verify before relying: - Whether the package handles all Gherkin syntax variants (e.g., multiple languages, scenario outlines) without data loss. - Performance characteristics on large feature file collections or deeply nested scenarios. - Compatibility with specific BDD frameworks (Behave, pytest-bdd, etc.) beyond generic Gherkin parsing. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 170.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags gherkin formatter, feature file formatting, bdd test formatting, gherkin code style, pre-commit gherkin, cucumber feature formatter, gherkin linter, bdd-testing, code-formatter, pre-commit-hook [View on SkillFed](https://skillfed.io/packages/reformat-gherkin) · [View on PyPI](https://pypi.org/project/reformat-gherkin/)