I have a java class with > 2000 lines, and I have Checkstyle configured to allow lines upto 2000. I want to override this Checkstyle property only for one file. How can I do that?
Asked
Active
Viewed 2,834 times
4
-
1Possible duplicate of http://stackoverflow.com/questions/4023185/how-to-disable-a-particular-checkstyle-rule-for-a-particular-line-of-code – Monzurul Shimul Jan 27 '17 at 04:34
-
3Possible duplicate of [How to disable a particular checkstyle rule for a particular line of code?](http://stackoverflow.com/questions/4023185/how-to-disable-a-particular-checkstyle-rule-for-a-particular-line-of-code) – Nikhil Girraj Jan 27 '17 at 07:01
2 Answers
2
In Checkstyle code itself there is TokenTypes
class that is huge.
Solution that Checkstyle developers use currently is to suppress that file by specifying it in suppressions.xml
:
<suppressions>
<suppress checks="FileLength"
files="TokenTypes.java"
lines="1"/>
This mechanism is called SuppressionFilter.

Michal Kordas
- 10,475
- 7
- 58
- 103
0
Just place this comment as the very first line of your class file:
// CSOFF: FileLength

Bruno 82
- 449
- 2
- 6
- 15