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!

0
4 comments

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.

0

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.

0

Please sign in to leave a comment.