Skip to content

use default field for default test path#2574

Closed
Pankraz76 wants to merge 1 commit intodiffplug:mainfrom
Pankraz76:fix-PATH
Closed

use default field for default test path#2574
Pankraz76 wants to merge 1 commit intodiffplug:mainfrom
Pankraz76:fix-PATH

Conversation

@Pankraz76
Copy link
Copy Markdown

@Pankraz76 Pankraz76 commented Jul 23, 2025

consolidating common field access.

After creating the PR, please add a commit that adds a bullet-point under the [Unreleased] section of CHANGES.md, plugin-gradle/CHANGES.md, and plugin-maven/CHANGES.md which includes:

  • a summary of the change
  • either
    • a link to the issue you are resolving (for small changes)
    • a link to the PR you just created (for big changes likely to have discussion)

If your change only affects a build plugin, and not the lib, then you only need to update the plugin-foo/CHANGES.md for that plugin.

If your change affects lib in an end-user-visible way (fixing a bug, updating a version) then you need to update CHANGES.md for both the lib and all build plugins. Users of a build plugin shouldn't have to refer to lib to see changes that affect them.

This makes it easier for the maintainers to quickly release your changes :)

@iddeepak

if this is acceptable then i would update changed as well.

@Pankraz76 Pankraz76 force-pushed the fix-PATH branch 2 times, most recently from 95e4f19 to 9d3735a Compare July 23, 2025 09:44
@Pankraz76 Pankraz76 marked this pull request as ready for review July 23, 2025 09:46
@iddeepak
Copy link
Copy Markdown
Contributor

If we expect more constants like this to be reused across classes, it might be worth adding TestConstants class.
@Pankraz76

@iddeepak
Copy link
Copy Markdown
Contributor

@Pankraz76
Update with diffplug/spotless:main to fix ci-build

@Pankraz76 Pankraz76 force-pushed the fix-PATH branch 5 times, most recently from 2e5c5ba to 12f5197 Compare July 23, 2025 14:41
Comment on lines +46 to +49
/**
* default test testPath.
*/
protected String testPath = "src/main/java/test.java";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mutable state is bad. Before this PR, it might be possible to enable method-level parallelism, after this PR it is definitely impossible. For Spotless we prefer functional style whenever possible.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, lets make the field final.

@Pankraz76
Copy link
Copy Markdown
Author

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

Successfully merging this pull request may close these issues.

3 participants