Disable specific warnings from cpplint

AnilRedshift picture AnilRedshift · Aug 14, 2017 · Viewed 9.9k times · Source

When running cpplint, I run into some warnings that I'd like to completely disable. Specifically the copyright message & whitespaces:

range.h:0: No copyright message found. You should have a line:

"Copyright [year] " [legal/copyright] [5]

range.h:10: At least two spaces is best between code and comments

[whitespace/comments] [2]

How do I accomplish this? Ideally would be modifying the CPPLINT.cfg file, but I would take an inline comment or a command line flag. I can't find any documentation on disabling rules.

Answer

Mureinik picture Mureinik · Aug 14, 2017

You can configure filters in CPPLINT.cfg:

filter=-whitespace,-legal/copyright