ducminh-phan / reformat-gherkin

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

with cattrs==22.2.0, fails to parse gherkin tables #59

Closed dong-brian closed 1 year ago

dong-brian commented 1 year ago

Describe the bug

A new version of cattrs 22.2.0 was just published to PyPi.

As a result, new installations of reformat-gherkin, will fail to parse tables in feature files with errors such as:

ClassValidationError: While structuring GherkinDocument (1 sub-exception)

and sometimes even go as far as to reformat the file but without the tables. This happens for both step data tables and example tables in scenario outlines.

We are using v3.0.0.

Config file:

check: false
alignment: left
tab_width: 2

To Reproduce

Steps to reproduce the behaviour

  1. New pyenv installation of reformat-gherkin
  2. Create a feature file with a table
  3. Attempt to reformat the table
  4. See ClassValidationError, reformat fails

Expected behaviour

Successfully reformat Gherkin feature files containing tables

Actual behaviour

Gherkin feature files containing tables either:

Environment

Additional context

Seems like a breaking change in the latest cattrs

reformat-gherkin was working fine before this morning

ducminh-phan commented 1 year ago

Just released v3.0.1 as a hotfix for cattrs' breaking changes. I will look into upgrading cattrs to 22.2.0 in v3.1.0.