In SonarLint for IntelliJ, I don’t think this exact feature - analysis of staged files only - will be supported. However, I see 2 options that can help with your use case:
- In the “SonarLint” tool window, on the “Report” tab, you should find the “Analyze VCS Changed Files” action, which will let you analyze all files changed since last commit (both staged and unstaged)
- If you use IntelliJ’s VCS integration, the “Commit” window has a checkbox in the “Before Commit” section to trigger a SonarLint analysis before the commit is actually saved
Hope this helps, happy hacking!