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

trailing whitespace added after Background: in each feature file #24

Closed
Jiehong opened this issue May 5, 2023 · 6 comments
Closed

trailing whitespace added after Background: in each feature file #24

Jiehong opened this issue May 5, 2023 · 6 comments

Comments

@Jiehong
Copy link

Jiehong commented May 5, 2023

Creating this bug report, because I'm not sure if it's link to spotless or this plugin.

Spotless issue is: diffplug/spotless#1693

@Jiehong
Copy link
Author

Jiehong commented May 19, 2023

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:.

@mpkorstanje
Copy link
Contributor

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.

https://github.com/cucumber/gherkin-utils/blob/69035dc6eb4386d6ae27cf6d8aa754883651fc23/java/src/main/java/io/cucumber/gherkin/utils/pretty/PrettyHandlers.java#LL224C1-L230C6

@blacelle
Copy link
Contributor

Given #20 (comment) 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.

@mpkorstanje
Copy link
Contributor

Please do pick it up!

@blacelle
Copy link
Contributor

The PR is ready

@Jiehong
Copy link
Author

Jiehong commented Jun 6, 2023

thank you!

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

No branches or pull requests

3 participants