Perform code analysis(pre-commit) only on the code that you changed?
Answered
Hello,
I am working on a big legacy code repo. I cannot fix every code smell it has, but I want to be sure that I am not inserting more.
I would like to know if there is a way to perform code analysis (also sonarlint) only on the changes you made on the commit?
Thanks in advance!
Please sign in to leave a comment.
Hello Bruno Arruda
You can either configure git hook or use "Perform code analysis" as per our guide:
https://www.jetbrains.com/help/idea/commit-changes-dialog.html#before_commit
IDE relies on command-line git and if you configure git hook and it works fine in command-line then it should run fine when you commit from IDE.
Hi Ruslan Kuleshov,
Thanks for the answer but unfortunately it does not answer my point... I was asking if there is a way to perform code analysis JUST on the changes I made on the files... default behavior is performing the analysis on the entire files I've touched.
Thanks in advance.
Bruno Arruda
Please feel free to vote and commend:
https://youtrack.jetbrains.com/issue/IDEA-276115
Thank you very much Ruslan Kuleshov