ducminh-phan / reformat-gherkin

Formatter for Gherkin language
MIT License
24 stars 13 forks source link

Doc String indention is not right #49

Closed dcendents closed 2 years ago

dcendents commented 2 years ago

Describe the bug

When I format my gherkin files, the doc strings indentation is removed, pytest-bdd fails to read them. In the spec doc strings are indented by one level under the step: https://cucumber.io/docs/gherkin/reference/

To Reproduce

Steps to reproduce the behaviour

Create a scenario with a doc string

Feature: a feature

  Scenario: a scenario
    Given a step with a
      """
      docstring
        with its own indentation
        - item 1
          - sub-item
      """
    When the test

Expected behaviour

Expected the file to remain unchanged

Actual behaviour

The doc string indentation is removed (it is at the same level as the step which is wrong)

Feature: a feature

  Scenario: a scenario
    Given a step with a
    """
    docstring
      with its own indentation
      - item 1
        - sub-item
    """
    When the test

Environment