checkstyle-idea icon indicating copy to clipboard operation
checkstyle-idea copied to clipboard

No option to force checkstyle run before git commit

Open Brillie opened this issue 4 years ago • 3 comments

Maybe not so much an issue, but more a question/feature-request: how can I enforce a checkstyle-run in IntelliJ before committing changes to my git repo? I'd really like to make sure only checked code goes into the repo. I have setup maven to break the build if the maven-checkstyle-run finds violations... So I'm looking for something like a pre-commit hook in the Checkstyle-IDEA plugin. It's not an option in the plugin config, and also in Version Control -> Commit -> Before Commit isn't listing a Checkstyle run.

Brillie avatar Nov 05 '21 11:11 Brillie

There's an option in the commit settings to run a Checkstyle scan before commit. I think this should do what you're after.

Screenshot 2021-11-06 at 11 46 37

jshiell avatar Nov 06 '21 11:11 jshiell

Ohhhh I was looking at the project options: image

Thanks for showing me where the option is! But it sure would be nice if the same checkbox would be available in the project options :)

Brillie avatar Nov 09 '21 13:11 Brillie

I'd also be interested in exactly this feature!

wafl22 avatar Dec 22 '22 09:12 wafl22