Closed Jiehong closed 1 year ago
issue is confirmed to come from this repository: when running mvn spotless:apply
, this plugin is adding a trailing whitespace:
Creating a feature file with the following content:
Feature: my_feature
Background:
def thing = "hello"
and running mvn spotless:check
will generate the following error:
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.36.0:check (default-cli) on project maestro_server_qa_karate: The following files had format violations:
[ERROR] src\test\java\my_feature.feature
[ERROR] @@ -1,6 +1,6 @@
[ERROR] Feature:·my_feature
[ERROR]
[ERROR] -··Background:
[ERROR] +··Background:·
[ERROR] ····*·def·thing·=·"hello"
Note the trailing space added after Background:
.
The code here naively assumes that all backgrounds, (and presumably all scenarios and examples too) have a name. Happy to take a pull requests that updates the tests and fixes this.
Given https://github.com/cucumber/gherkin-utils/pull/20#event-9340877116 is now merged, I can be a bit more active in this repo. Still happy to taker over this @mpkorstanje? Else I'll handle it.
Please do pick it up!
The PR is ready
thank you!
Creating this bug report, because I'm not sure if it's link to spotless or this plugin.
Spotless issue is: https://github.com/diffplug/spotless/issues/1693