tools: fix cpplint.py header rules · refack/node@9029981 (original) (raw)
`@@ -282,9 +282,10 @@ def GetNonHeaderExtensions():
`
282
282
`'build/forward_decl',
`
283
283
`'build/header_guard',
`
284
284
`'build/include',
`
285
``
`-
'build/include_subdir',
`
286
285
`'build/include_alpha',
`
``
286
`+
'build/include_inline',
`
287
287
`'build/include_order',
`
``
288
`+
'build/include_subdir',
`
288
289
`'build/include_what_you_use',
`
289
290
`'build/namespaces_literals',
`
290
291
`'build/namespaces',
`
`@@ -356,8 +357,9 @@ def GetNonHeaderExtensions():
`
356
357
`# off by default (i.e., categories that must be enabled by the --filter= flags).
`
357
358
`# All entries here should start with a '-' or '+', as in the --filter= flag.
`
358
359
`_DEFAULT_FILTERS = [
`
359
``
`-
'-build/include',
`
``
360
`+
'-build/include_alpha',
`
360
361
`'-build/include_subdir',
`
``
362
`+
'-build/include_what_you_use',
`
361
363
`'-legal/copyright',
`
362
364
` ]
`
363
365
``
`@@ -834,9 +836,9 @@ class _IncludeState(object):
`
834
836
`# needs to move backwards, CheckNextIncludeOrder will raise an error.
`
835
837
`_INITIAL_SECTION = 0
`
836
838
`_MY_H_SECTION = 1
`
837
``
`-
_C_SECTION = 2
`
838
``
`-
_CPP_SECTION = 3
`
839
``
`-
_OTHER_H_SECTION = 4
`
``
839
`+
_OTHER_H_SECTION = 2
`
``
840
`+
_C_SECTION = 3
`
``
841
`+
_CPP_SECTION = 4
`
840
842
``
841
843
`_TYPE_NAMES = {
`
842
844
`_C_SYS_HEADER: 'C system header',
`
`@@ -848,9 +850,9 @@ class _IncludeState(object):
`
848
850
`_SECTION_NAMES = {
`
849
851
`_INITIAL_SECTION: "... nothing. (This can't be an error.)",
`
850
852
`_MY_H_SECTION: 'a header this file implements',
`
``
853
`+
_OTHER_H_SECTION: 'other header',
`
851
854
`_C_SECTION: 'C system header',
`
852
855
`_CPP_SECTION: 'C++ system header',
`
853
``
`-
_OTHER_H_SECTION: 'other header',
`
854
856
` }
`
855
857
``
856
858
`def init(self):
`
`@@ -2130,7 +2132,7 @@ def CheckInlineHeader(filename, include_state, error):
`
2130
2132
`for name in bad_headers:
`
2131
2133
`err = '%s includes both %s and %s-inl.h' % (filename, name, name)
`
2132
2134
`linenum = all_headers[name]
`
2133
``
`-
error(filename, linenum, 'build/include', 5, err)
`
``
2135
`+
error(filename, linenum, 'build/include_inline', 5, err)
`
2134
2136
``
2135
2137
``
2136
2138
`def CheckForNewlineAtEOF(filename, lines, error):
`
`@@ -4768,11 +4770,10 @@ def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
`
4768
4770
`include_state.include_list[-1].append((include, linenum))
`
4769
4771
``
4770
4772
`# We want to ensure that headers appear in the right order:
`
4771
``
`-
1) for foo.cc, foo.h (preferred location)
`
4772
``
`-
2) c system files
`
4773
``
`-
3) cpp system files
`
4774
``
`-
4) for foo.cc, foo.h (deprecated location)
`
4775
``
`-
5) other google headers
`
``
4773
`+
1) for foo.cc, foo.h
`
``
4774
`+
2) other project headers
`
``
4775
`+
3) c system files
`
``
4776
`+
4) cpp system files
`
4776
4777
`#
`
4777
4778
`# We classify each include statement as one of those 5 types
`
4778
4779
`# using a number of techniques. The include_state object keeps
`