Search code examples
c++cpplint

How to find all the available filter for CPPLINT.cfg file?


I'm using EditConfig to enforce 2 spaces indentation.

root = true

[*]
indent_style = space
indent_size = 2
continuation_indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

I start using cpplint for static analysis, everything worked well until I found that some rules makes conflicts with my EditorConfig configurarion, I'm trying to disable this cpplint rules"

private: should be indented +1 space inside class
public: should be indented +1 space inside class

The help says I can use filters to disable specific check, but I can find a list of all filters available.

Example file:
        filter=-build/include_order,+build/include_alpha

Do you know the names of the filters I need?


Solution

  • The solution was so easy, I just need to look carefully on the error message, it shows the name at the end of the message between "[]"

    LinuxFilesManager.hpp:7:  private: should be indented +1 space inside class LinuxFilesManager  [whitespace/indent] [3]
    

    The solution was creating the CPPLINT.cfg file like this:

    set noparent
    
    filter=-whitespace/indent