antham / ghokin

Parallelized formatter with no external dependencies for gherkin (cucumber, behat...)
MIT License
43 stars 5 forks source link

Description formatting options #64

Closed ealprr closed 1 year ago

ealprr commented 3 years ago

I would suggest a max-line-length: 80 option for description. to break long line in multiple lines.

Another idea would be to also add a space-before-description: true.

With the two options, the file:

Feature: Multiple site support
  Only blog owners can post to a blog, except administrators, who can post to all blogs.

  Scenario: Dr. Bill tries to post to somebody else's blog, and fails
    Given I am logged in as Dr. Bill

would be formatted:

Feature: Multiple site support

  Only blog owners can post to a blog, except administrators, who can post to
  all blogs.

  Scenario: Dr. Bill tries to post to somebody else's blog, and fails
    Given I am logged in as Dr. Bill
antham commented 1 year ago

After coming over this issue, I'm closing it. About the limit on 80 characters, I don't see what it brings to only have it on description. Also I think to tables, you would have arbitrary long tables lines but something that is cropped only for description, it would feel strange in my opinion.

About the last point, I think it's going a bit to far, if we start like that, we could add many flag to specialize various part of the rendering.

Maybe a good solution for all of that, would be to let people define function to override part they want to customize, a linter in the linter, at the moment I think it's fine like that, KISS.