Skip to content

Conversation

@Bendzae
Copy link

@Bendzae Bendzae commented Nov 28, 2025

Summary

A backwards compatible extension of the IdeHook fuctionality that allow passing in multiple file paths in a comma separated list:

./gradlew spotlessApply -PspotlessIdeHook=path/to/file_a.md,path/to/file_b.md

What does this solve?

Our specific use-case is to allow efficient invocation in a pre-commit hook. This way we can simply pass in a list of staged files and fix them in a single call.

I can imagine this might also be useful for plugin development.

Changes

  • Adjusted the IdeHook.java including it's State class to enable handling multiple files
  • Added new testcases to verify the behaviour

Notes

  • I decided to just not support the std in/out flag for multiple files to make it simpler

Review

Please let me know if you are missing anything in my PR/Description as its my first contribution to this repo! 🙂

@Bendzae Bendzae marked this pull request as ready for review November 28, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant