简体   繁体   中英

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?

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

You can find all available filter for the --filter option in the source code cpplint.py . They're part of the variable _ERROR_CATEGORIES . There is no way to print them using cpplint command.

Please refer to the cpplint.py file you've installed as you may have installed either the Google original version or the forked version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM