2

I need to ensure that lines are no more than 80 characters long and that all variables are final (but this restriction only applies to new code).

Using IntelliJ inspection, is there a way to check only newly-created code? By new, I mean that I've changed the code on a local Git repository, but I haven't pushed yet to remote repository.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Speise
  • 789
  • 1
  • 12
  • 28
  • Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. – JFPicard Feb 15 '17 at 18:42
  • @JFPicard the question has been edited - would you be willing to check again and judge if it is now on-topic? (I am unable to vote to re-open.) I edited it the way I did because the initial tags and an (accepted) answer led me to believe that OP already had a specific tool and was looking for information on how to use that tool. – Jeutnarg Feb 16 '17 at 22:50

1 Answers1

4

You can run Analyze | Inspect Code with the Changed Files scope:

scope

Also vote for this feature request:

  • IDEA-154018 Limit pre-commit inspections to modified region of code
CrazyCoder
  • 389,263
  • 172
  • 990
  • 904