{"id":21870,"library":"reformat-gherkin","title":"reformat-gherkin","description":"Formatter for Gherkin language. v3.0.1 supports Python >=3.7,<4.0. Releases are irregular.","status":"active","version":"3.0.1","language":"python","source_language":"en","source_url":"https://github.com/ducminh-phan/reformat-gherkin","tags":["gherkin","bdd","formatter","testing"],"install":[{"cmd":"pip install reformat-gherkin","lang":"bash","label":"latest"}],"dependencies":[{"reason":"core parsing library; major version updates can change formatting behavior","package":"gherkin-official","optional":false},{"reason":"CLI interface","package":"click","optional":false},{"reason":"configuration reading","package":"PyYAML","optional":false},{"reason":"data classes; breaking changes in v22+ required fixes","package":"attrs","optional":false},{"reason":"serialization; known for breaking changes that affect reformat-gherkin","package":"cattrs","optional":false}],"imports":[{"note":"hyphens are invalid in Python identifiers; use underscore","wrong":"from reformat-gherkin import format_feature","symbol":"format_feature","correct":"from reformat_gherkin import format_feature"},{"note":"main is located under the cli module, not top-level","wrong":"from reformat_gherkin import main","symbol":"main","correct":"from reformat_gherkin.cli import main"}],"quickstart":{"code":"from reformat_gherkin import format_feature\n\nfeature_text = \"\"\"Feature: Example\n  Scenario: Test\n    Given a step\n\"\"\"\nformatted = format_feature(feature_text)\nprint(formatted)\n# Or using stdin: echo '...' | reformat-gherkin\n","lang":"python","description":"Format a Gherkin feature string. Also available as CLI: `reformat-gherkin --help`"},"warnings":[{"fix":"Test reformatting on a subset of files first. Use v2.2.1 if compatibility is critical.","message":"v3.0.0 upgraded gherkin-official to 24.0.0 which may change parsing behavior. Back up feature files before reformatting.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Review feature files with triple backticks in docstrings; expected output now escapes them.","message":"v3.0.0 fixed escaping of triple backticks in docstrings. Previously triple backticks were not escaped; now they are escaped to \\`\\`\\`. This may change output for docstrings containing backticks.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Upgrade Python to 3.7+.","message":"Python 3.6 support was dropped in v2.0.2. Python 3.7+ required.","severity":"deprecated","affected_versions":">=2.0.2"},{"fix":"Explicitly pass `--indent` with desired value, e.g. `--indent 4`.","message":"The CLI option `--indent` accepts number of spaces, but the default is 2. Inconsistent indentation in input may be normalized unexpectedly.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade to reformat-gherkin >=3.0.1 or pin cattrs to compatible version.","message":"cattrs has breaking changes that affect reformat-gherkin (fixed in v3.0.1). Using older versions with newer cattrs may cause errors.","severity":"gotcha","affected_versions":"<3.0.1"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use `from reformat_gherkin import ...` (underscore) after installation.","cause":"The package is imported with hyphens in the module name.","error":"ModuleNotFoundError: No module named 'reformat_gherkin'"},{"fix":"Use `format_feature(feature_text, indent=2)` works, but check version. In v2.0.0+ the parameter is available.","cause":"In v2.0.0, the function signature changed. Old code used `indent` parameter but new signature accepts `indent` via `**kwargs` or config.","error":"TypeError: format_feature() got an unexpected keyword argument 'indent'"},{"fix":"Upgrade reformat-gherkin to >=3.0.1 or revert cattrs to a compatible version (e.g., <23.2.0).","cause":"Breaking change in cattrs library. Known issue with reformat-gherkin <3.0.1.","error":"cattrs.errors.ClassValidationError: ..."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}