Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Gherkin formatting plugin #907

Closed
jamietanna opened this issue Aug 4, 2021 · 5 comments
Closed

Implement Gherkin formatting plugin #907

jamietanna opened this issue Aug 4, 2021 · 5 comments

Comments

@jamietanna
Copy link
Contributor

Something that @goughy000 mentioned recently is that having the ability for Spotless to format our Gherkin files for Cucumber testing would be super useful.

Between the two of us we're looking at getting this implemented for Gradle.

Working thoughts

https://github.com/cucumber/cucumber-jvm/blob/main/gherkin-messages/src/main/java/io/cucumber/core/gherkin/messages/GherkinMessagesFeatureParser.java
https://github.com/JetBrains/intellij-plugins/tree/master/cucumber/src/org/jetbrains/plugins/cucumber
https://github.com/cucumber/cucumber-eclipse/blob/main/cucumber.eclipse.editor/src/main/java/cucumber/eclipse/editor/editors/PrettyFormatter.java
https://github.com/podnov/gherkin/tree/main/utils/src/main/java/com/evanzeimet/gherkin/formatter

@nedtwigg
Copy link
Member

nedtwigg commented Aug 4, 2021

Great idea! Happy to help get a PR for this merged.

@jamietanna
Copy link
Contributor Author

Thanks Ned! Looking at the options available, I think it'll be a case of creating a new package to provide the pretty-printing functionality as a standalone package so will look at doing that first, then contributing the Spotless bindings 👍

jamietanna added a commit to jamietanna/spotless that referenced this issue Sep 6, 2021
As part of diffplug#907, we want to be able to format our Gherkin source files
automagically.

To do this, we can utilise the upstream gherkin-formatter project to do
the heavy lifting, and add a few test cases within this project to make
sure that functionality looks correct.

We're calling this a `simple` formatter as it doesn't allow much to be
configured other than the indentation size in spaces.
jamietanna added a commit to jamietanna/spotless that referenced this issue Sep 6, 2021
As we've created a Gherkin formatter as part of diffplug#907, we should make it
possible to use it natively in Gradle, which requires we add it as a new
supported type in `SpotlessExtension`.
jamietanna added a commit to jamietanna/spotless that referenced this issue Sep 6, 2021
As part of diffplug#907, we want to be able to format our Gherkin source files
automagically.

To do this, we can utilise the upstream gherkin-formatter project to do
the heavy lifting, and add a few test cases within this project to make
sure that functionality looks correct.

We're calling this a `simple` formatter as it doesn't allow much to be
configured other than the indentation size in spaces.
jamietanna added a commit to jamietanna/spotless that referenced this issue Sep 6, 2021
As we've created a Gherkin formatter as part of diffplug#907, we should make it
possible to use it natively in Gradle, which requires we add it as a new
supported type in `SpotlessExtension`.
jamietanna added a commit to jamietanna/spotless that referenced this issue Sep 7, 2021
As part of diffplug#907, we want to be able to format our Gherkin source files
automagically.

To do this, we can utilise the upstream gherkin-formatter project to do
the heavy lifting, and add a few test cases within this project to make
sure that functionality looks correct.

We're calling this a `simple` formatter as it doesn't allow much to be
configured other than the indentation size in spaces.
jamietanna added a commit to jamietanna/spotless that referenced this issue Sep 7, 2021
As we've created a Gherkin formatter as part of diffplug#907, we should make it
possible to use it natively in Gradle, which requires we add it as a new
supported type in `SpotlessExtension`.
@Jiehong
Copy link

Jiehong commented May 5, 2023

What's the status for that?

The doc has a gherkin section (https://github.com/diffplug/spotless/tree/main/plugin-maven#gherkin), but when trying to use it, it ignores it with:

[WARNING] Parameter 'gherkin' is unknown for plugin 'spotless-maven-plugin:2.34.0:check (default-cli)'

@jamietanna
Copy link
Contributor Author

Looks like you need to bump the version you're using #928 (comment)

@jamietanna
Copy link
Contributor Author

Closed by #1649

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants