spotless
spotless copied to clipboard
Implement Gherkin formatting plugin
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
Great idea! Happy to help get a PR for this merged.
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:
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)'
Looks like you need to bump the version you're using https://github.com/diffplug/spotless/pull/928#issuecomment-1498452810
Closed by https://github.com/diffplug/spotless/pull/1649