Skip to content

Commit d4fc1d0

Browse files
committed
⬆️ cpplint 1.6.0
1 parent 1a90c94 commit d4fc1d0

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

third_party/cpplint/README.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
cpplint - static code checker for C++
22
=====================================
33

4-
.. image:: https://travis-ci.org/cpplint/cpplint.svg?branch=master
5-
:target: https://travis-ci.org/cpplint/cpplint
6-
74
.. image:: https://img.shields.io/pypi/v/cpplint.svg
85
:target: https://pypi.python.org/pypi/cpplint
96

@@ -62,7 +59,7 @@ The modifications in this fork are minor fixes and cosmetic changes, such as:
6259
* python 3 compatibility
6360
* more default file extensions
6461
* customizable file extensions with the --extensions argument
65-
* continuous integration on travis
62+
* continuous integration on github
6663
* support for recursive file discovery via the --recursive argument
6764
* support for excluding files via --exclude
6865
* JUnit XML output format

third_party/cpplint/cpplint.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@
4141
same line, but it is far from perfect (in either direction).
4242
"""
4343

44+
# cpplint predates fstrings
45+
# pylint: disable=consider-using-f-string
46+
47+
# pylint: disable=invalid-name
48+
4449
import codecs
4550
import copy
4651
import getopt
@@ -59,7 +64,7 @@
5964
# if empty, use defaults
6065
_valid_extensions = set([])
6166

62-
__VERSION__ = '1.5.5'
67+
__VERSION__ = '1.6.0'
6368

6469
try:
6570
xrange # Python 2
@@ -1915,6 +1920,7 @@ def __init__(self, lines):
19151920
self.raw_lines = lines
19161921
self.num_lines = len(lines)
19171922
self.lines_without_raw_strings = CleanseRawStrings(lines)
1923+
# # pylint: disable=consider-using-enumerate
19181924
for linenum in range(len(self.lines_without_raw_strings)):
19191925
self.lines.append(CleanseComments(
19201926
self.lines_without_raw_strings[linenum]))
@@ -5068,10 +5074,12 @@ def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
50685074
#
50695075
# We also make an exception for Lua headers, which follow google
50705076
# 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')
50755083

50765084
# we shouldn't include a file more than once. actually, there are a
50775085
# handful of instances where doing so is okay, but in general it's
@@ -6523,7 +6531,7 @@ def ProcessConfigOverrides(filename):
65236531
continue
65246532

65256533
try:
6526-
with open(cfg_file) as file_handle:
6534+
with open(cfg_file, encoding='utf-8') as file_handle:
65276535
for line in file_handle:
65286536
line, _, _ = line.partition('#') # Remove comments.
65296537
if not line.strip():

0 commit comments

Comments
 (0)