|
41 | 41 | same line, but it is far from perfect (in either direction). |
42 | 42 | """ |
43 | 43 |
|
| 44 | +# cpplint predates fstrings |
| 45 | +# pylint: disable=consider-using-f-string |
| 46 | + |
| 47 | +# pylint: disable=invalid-name |
| 48 | + |
44 | 49 | import codecs |
45 | 50 | import copy |
46 | 51 | import getopt |
|
59 | 64 | # if empty, use defaults |
60 | 65 | _valid_extensions = set([]) |
61 | 66 |
|
62 | | -__VERSION__ = '1.5.5' |
| 67 | +__VERSION__ = '1.6.0' |
63 | 68 |
|
64 | 69 | try: |
65 | 70 | xrange # Python 2 |
@@ -1915,6 +1920,7 @@ def __init__(self, lines): |
1915 | 1920 | self.raw_lines = lines |
1916 | 1921 | self.num_lines = len(lines) |
1917 | 1922 | self.lines_without_raw_strings = CleanseRawStrings(lines) |
| 1923 | + # # pylint: disable=consider-using-enumerate |
1918 | 1924 | for linenum in range(len(self.lines_without_raw_strings)): |
1919 | 1925 | self.lines.append(CleanseComments( |
1920 | 1926 | self.lines_without_raw_strings[linenum])) |
@@ -5068,10 +5074,12 @@ def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): |
5068 | 5074 | # |
5069 | 5075 | # We also make an exception for Lua headers, which follow google |
5070 | 5076 | # naming convention but not the include convention. |
5071 | | - match = Match(r'#include\s*"([^/]+\.h)"', line) |
5072 | | - if match and not _THIRD_PARTY_HEADERS_PATTERN.match(match.group(1)): |
5073 | | - error(filename, linenum, 'build/include_subdir', 4, |
5074 | | - 'Include the directory when naming .h files') |
| 5077 | + match = Match(r'#include\s*"([^/]+\.(.*))"', line) |
| 5078 | + if match: |
| 5079 | + if (IsHeaderExtension(match.group(2)) and |
| 5080 | + not _THIRD_PARTY_HEADERS_PATTERN.match(match.group(1))): |
| 5081 | + error(filename, linenum, 'build/include_subdir', 4, |
| 5082 | + 'Include the directory when naming header files') |
5075 | 5083 |
|
5076 | 5084 | # we shouldn't include a file more than once. actually, there are a |
5077 | 5085 | # handful of instances where doing so is okay, but in general it's |
@@ -6523,7 +6531,7 @@ def ProcessConfigOverrides(filename): |
6523 | 6531 | continue |
6524 | 6532 |
|
6525 | 6533 | try: |
6526 | | - with open(cfg_file) as file_handle: |
| 6534 | + with open(cfg_file, encoding='utf-8') as file_handle: |
6527 | 6535 | for line in file_handle: |
6528 | 6536 | line, _, _ = line.partition('#') # Remove comments. |
6529 | 6537 | if not line.strip(): |
|
0 commit comments