spotless icon indicating copy to clipboard operation
spotless copied to clipboard

Implement Gherkin formatting plugin

Open jamietanna opened this issue 3 years ago • 2 comments

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

jamietanna avatar Aug 04 '21 17:08 jamietanna

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

nedtwigg avatar Aug 04 '21 19:08 nedtwigg

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 :+1:

jamietanna avatar Aug 04 '21 20:08 jamietanna

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)'

Jiehong avatar May 05 '23 11:05 Jiehong

Looks like you need to bump the version you're using https://github.com/diffplug/spotless/pull/928#issuecomment-1498452810

jamietanna avatar May 05 '23 11:05 jamietanna

Closed by https://github.com/diffplug/spotless/pull/1649

jamietanna avatar May 05 '23 11:05 jamietanna