22
33var extend = require ( './extend.js' ) ;
44
5- /**
6- * Each possible error, all enabled by default (other than build/include_alpha)
7- * @type {Object }
8- */
9- var defaults = {
10- 'build' : {
11- 'class' : true ,
12- 'c++11' : true ,
13- 'deprecated' : true ,
14- 'endif_comment' : true ,
15- 'explicit_make_pair' : true ,
16- 'forward_decl' : true ,
17- 'header_guard' : true ,
18- 'include' : true ,
19- // for whatever reason, by default, cpplint has this turned off by default
20- 'include_alpha' : false ,
21- 'include_order' : true ,
22- 'include_what_you_use' : true ,
23- 'namespaces' : true ,
24- 'printf_format' : true ,
25- 'storage_class' : true
26- } ,
27- 'legal' : {
28- 'copyright' : true
29- } ,
30- 'readability' : {
31- 'alt_tokens' : true ,
32- 'braces' : true ,
33- 'casting' : true ,
34- 'check' : true ,
35- 'constructors' : true ,
36- 'fn_size' : true ,
37- 'function' : true ,
38- 'multiline_comment' : true ,
39- 'multiline_string' : true ,
40- 'nolint' : true ,
41- 'nul' : true ,
42- 'streams' : true ,
43- 'todo' : true ,
44- 'utf8' : true
45- } ,
46- 'runtime' : {
47- 'arrays' : true ,
48- 'casting' : true ,
49- 'explicit' : true ,
50- 'int' : true ,
51- 'init' : true ,
52- 'invalid_increment' : true ,
53- 'member_string_references' : true ,
54- 'memset' : true ,
55- 'operator' : true ,
56- 'printf' : true ,
57- 'printf_format' : true ,
58- 'references' : true ,
59- 'string' : true ,
60- 'threadsafe_fn' : true ,
61- 'vlog' : true
62- } ,
63- 'whitespace' : {
64- 'blank_line' : true ,
65- 'braces' : true ,
66- 'comma' : true ,
67- 'comments' : true ,
68- 'empty_conditional_body' : true ,
69- 'empty_loop_body' : true ,
70- 'end_of_line' : true ,
71- 'ending_newline' : true ,
72- 'indent' : true ,
73- 'line_length' : true ,
74- 'newline' : true ,
75- 'operators' : true ,
76- 'parens' : true ,
77- 'semicolon' : true ,
78- 'tab' : true ,
79- 'todo' : true
80- }
81- } ;
82-
835/**
846 * Parse a command-line list of excludes and convert into an object
857 *
868 * @param {String } str
879 * @return {Object }
8810 */
8911function parse ( str ) {
90- var result = extend ( { } , defaults ) ,
12+ var result = { } ,
9113 excludes = str . split ( ',' ) ;
9214
9315 excludes . forEach ( function ( option ) {
@@ -103,9 +25,8 @@ function parse(str) {
10325 return ;
10426 }
10527
106- // non-supported categories
10728 if ( ! result . hasOwnProperty ( category ) ) {
108- return ;
29+ result [ category ] = { } ;
10930 }
11031
11132 result [ category ] [ subcategory ] = false ;
@@ -116,6 +37,5 @@ function parse(str) {
11637}
11738
11839module . exports = {
119- 'defaults' : defaults ,
12040 'parse' : parse
12141} ;
0 commit comments