ducminh-phan / reformat-gherkin

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

Remove "Outline" from "Scenario Outline" if the scenario has no examples: #58

Open conradogarciaberrotaran opened 2 years ago

conradogarciaberrotaran commented 2 years ago

Is your feature request related to a problem? Please describe. Scenario Outlines without examples pass silently, this can lead to thinking your tests are passing.

Describe the solution you'd like Remove "Outline" from "Scenario Outline" if no example.

Describe alternatives you've considered None.

Additional context Thank you for this tool.

ducminh-phan commented 2 years ago

@conradogarciaberrotaran Thank you for your feedback! However, I don't think it's a formatter's job to automatically remove a file's content. We could add a linting functionality for example, which would warn the user about such cases. What do you think?

Just a side note, I added two warning classes for missing/empty examples since the beginning of the project, but they aren't used yet 😂

conradogarciaberrotaran commented 2 years ago

Hi @ducminh-phan thanks for the quick reply. I agree with you. A warning sounds enough to let the user know. I'd love to help with the implementation/review, please let me know if this is possible.

ducminh-phan commented 1 year ago

@conradogarciaberrotaran @rayjolt As I am implementing the linting functionalities, I'm not sure how to trigger it from the CLI. Either we could reuse the --check flag, or add a new --lint flag. I'm more inclined toward adding --lint flag, as the return status code and report for --check is specific for reformating: they tell the user if there are some files to be reformatted, and show those files if any. Adding linting reports to that would be confusing. What do you think?