Skip to content

Adding invertMarking flag to ModuleHasDependency for flipping what gets marked#146

Merged
sambsnyd merged 2 commits into
mainfrom
module-has-dependency-invert-marking-option
Jul 31, 2025
Merged

Adding invertMarking flag to ModuleHasDependency for flipping what gets marked#146
sambsnyd merged 2 commits into
mainfrom
module-has-dependency-invert-marking-option

Conversation

@steve-aom-elliott

Copy link
Copy Markdown
Contributor

What's changed?

invertMarking optional boolean flag added to ModuleHasDependency that flips what files get marked during the visitor (and changes the message from Module has dependency: ... to Module does not have dependency: ... when flipping.

What's your motivation?

To allow it to switch between marking files part of a module with a dependency (default / original behaviour / when flag is set to false or not provided) and marking files part of a module that doesn't have a dependency (when the flag is set to true)

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

…witch between marking files part of a module with a dependency (default / original behaviour / when flag is set to false or not provided) and marking files part of a module that doesn't have a dependency (when the flag is set to true)
@steve-aom-elliott steve-aom-elliott self-assigned this Jul 31, 2025
@steve-aom-elliott steve-aom-elliott added the enhancement New feature or request label Jul 31, 2025
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Jul 31, 2025
Comment thread src/main/java/org/openrewrite/java/dependencies/search/ModuleHasDependency.java Outdated
@steve-aom-elliott steve-aom-elliott force-pushed the module-has-dependency-invert-marking-option branch from 8edc123 to f7cea50 Compare July 31, 2025 21:11
@steve-aom-elliott steve-aom-elliott marked this pull request as ready for review July 31, 2025 21:11
@steve-aom-elliott steve-aom-elliott moved this from In Progress to Ready to Review in OpenRewrite Jul 31, 2025
@sambsnyd sambsnyd merged commit 67abbb3 into main Jul 31, 2025
2 checks passed
@sambsnyd sambsnyd deleted the module-has-dependency-invert-marking-option branch July 31, 2025 21:14
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants