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

Ability to list all failing files with spotlessCheck #2418

Open
AchrafBelkahla opened this issue Feb 6, 2025 · 6 comments
Open

Ability to list all failing files with spotlessCheck #2418

AchrafBelkahla opened this issue Feb 6, 2025 · 6 comments

Comments

@AchrafBelkahla
Copy link

Hello

Today running spotlessCheck allows the display of maximum 10 files as stated in :

Example of logged error today :

Violations also present in 41 other files.

Run 'gradlew.bat :spotlessApply' to fix these violations.
\* Try:`
\> Run with \-\-stacktrace option to get the stack trace.
\> Run with --info or \-\-debug option to get more log output.

\* Get more help at https://help.gradle.org`

BUILD FAILED in 6s
3 actionable tasks: 1 executed, 1 from cache, 1 up-to-date

For our projects, we need be able to see all files that are breaking the formatting.
Could we remove this limit or raise it ?

Thank you

@jbduncan
Copy link
Member

jbduncan commented Feb 6, 2025

Would you like to see just the filenames or their contents, too?

@AchrafBelkahla
Copy link
Author

AchrafBelkahla commented Feb 6, 2025

@jbduncan The filenames should be enough 👍 like what is displayed today when we have less than 10 files

@jbduncan
Copy link
Member

jbduncan commented Feb 6, 2025

@AchrafBelkahla Great, thanks for clarifying.

I don't contribute to this repo as much as I used to, but I'm sure @nedtwigg wouldn't mind if you wanted to raise a PR.

Having said that, we'll need to agree on an API for this. I only know the Gradle plugin, but I imagine we'd want something like:

spotless {
    maxFilesToReport(9999)
}

We can always skip the Maven plugin until someone asks for this option there, too.

What do you think, both?

@AchrafBelkahla
Copy link
Author

This would be perfect of course if approved by @nedtwigg

@nedtwigg
Copy link
Member

Sorry for the long delay.

  • I don't think a configurable max makes sense. It should either be a brief summary or it should be complete. The default should be brief.
  • Adding a complete mode is fine with me, I lean towards it should be a CLI flag rather than DSL. Maybe --show-all-failures? I'm okay with a DSL change too, but I think it should be boolean rather than an integer max.

@jbduncan
Copy link
Member

I'm fine with it being either a DSL change or a CLI flag (like Ned's suggestion for --show-all-failures or an API change like below), and I agree with hindsight that it should be an on/off switch that's off by default.

spotless {
    showAllFailures()
}

@AchrafBelkahla It seems that neither Ned nor I will have enough time to implement this, so feel free to raise a PR and to ask for help if you get stuck. :)

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

No branches or pull requests

3 participants