Skip to content

Enable toggleOffOn feature for spotless #1123

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

Merged
merged 1 commit into from
May 1, 2025

Conversation

strangelookingnerd
Copy link
Contributor

@strangelookingnerd strangelookingnerd commented Apr 16, 2025

I ran into some cases where the formatting of com.diffplug.spotless:spotless-maven-plugin simply did not produce satisfying results.
There is a feature that allows comments to toggle spotless formatting on and off (disabled by default):

  public void doNotFormatThisPlease() {
    // spotless:off
   ...
    // spotless:on
  }

While I can override the config in my plugin pom.xml I don't see a reason to not enable the feature by default here.

Testing done

Manually verified that changes have no impact if the feature is not being used.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@timja timja merged commit 4f2cd6c into jenkinsci:master May 1, 2025
2 checks passed
@strangelookingnerd strangelookingnerd deleted the patch-1 branch May 1, 2025 20:51
@jglick
Copy link
Member

jglick commented May 19, 2025

The affected code involved switch statements. I think the real issue is that #1120 pulled in what I consider a regression: diffplug/spotless#2447 (comment)

(We could hard-code a version of the formatter in this POM, but then we would need to find a way to keep it up to date.)

@timja
Copy link
Member

timja commented May 19, 2025

The affected code involved switch statements. I think the real issue is that #1120 pulled in what I consider a regression: diffplug/spotless#2447 (comment)

I have vague memories of us hitting this before (specifically the per language different default versions)

(We could hard-code a version of the formatter in this POM, but then we would need to find a way to keep it up to date.)

I'm sure renovate can handle it

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

Successfully merging this pull request may close these issues.

3 participants