mirror of
https://github.com/nlohmann/json.git
synced 2025-05-11 21:53:56 +00:00
⬆️ cpplint 1.6.0 (#3454)
This commit is contained in:
parent
1a90c9463a
commit
fcc36f99ba
5
third_party/cpplint/README.rst
vendored
5
third_party/cpplint/README.rst
vendored
@ -1,9 +1,6 @@
|
|||||||
cpplint - static code checker for C++
|
cpplint - static code checker for C++
|
||||||
=====================================
|
=====================================
|
||||||
|
|
||||||
.. image:: https://travis-ci.org/cpplint/cpplint.svg?branch=master
|
|
||||||
:target: https://travis-ci.org/cpplint/cpplint
|
|
||||||
|
|
||||||
.. image:: https://img.shields.io/pypi/v/cpplint.svg
|
.. image:: https://img.shields.io/pypi/v/cpplint.svg
|
||||||
:target: https://pypi.python.org/pypi/cpplint
|
:target: https://pypi.python.org/pypi/cpplint
|
||||||
|
|
||||||
@ -62,7 +59,7 @@ The modifications in this fork are minor fixes and cosmetic changes, such as:
|
|||||||
* python 3 compatibility
|
* python 3 compatibility
|
||||||
* more default file extensions
|
* more default file extensions
|
||||||
* customizable file extensions with the --extensions argument
|
* customizable file extensions with the --extensions argument
|
||||||
* continuous integration on travis
|
* continuous integration on github
|
||||||
* support for recursive file discovery via the --recursive argument
|
* support for recursive file discovery via the --recursive argument
|
||||||
* support for excluding files via --exclude
|
* support for excluding files via --exclude
|
||||||
* JUnit XML output format
|
* JUnit XML output format
|
||||||
|
20
third_party/cpplint/cpplint.py
vendored
20
third_party/cpplint/cpplint.py
vendored
@ -41,6 +41,11 @@ We do a small hack, which is to ignore //'s with "'s after them on the
|
|||||||
same line, but it is far from perfect (in either direction).
|
same line, but it is far from perfect (in either direction).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# cpplint predates fstrings
|
||||||
|
# pylint: disable=consider-using-f-string
|
||||||
|
|
||||||
|
# pylint: disable=invalid-name
|
||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
import copy
|
import copy
|
||||||
import getopt
|
import getopt
|
||||||
@ -59,7 +64,7 @@ import xml.etree.ElementTree
|
|||||||
# if empty, use defaults
|
# if empty, use defaults
|
||||||
_valid_extensions = set([])
|
_valid_extensions = set([])
|
||||||
|
|
||||||
__VERSION__ = '1.5.5'
|
__VERSION__ = '1.6.0'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
xrange # Python 2
|
xrange # Python 2
|
||||||
@ -1915,6 +1920,7 @@ class CleansedLines(object):
|
|||||||
self.raw_lines = lines
|
self.raw_lines = lines
|
||||||
self.num_lines = len(lines)
|
self.num_lines = len(lines)
|
||||||
self.lines_without_raw_strings = CleanseRawStrings(lines)
|
self.lines_without_raw_strings = CleanseRawStrings(lines)
|
||||||
|
# # pylint: disable=consider-using-enumerate
|
||||||
for linenum in range(len(self.lines_without_raw_strings)):
|
for linenum in range(len(self.lines_without_raw_strings)):
|
||||||
self.lines.append(CleanseComments(
|
self.lines.append(CleanseComments(
|
||||||
self.lines_without_raw_strings[linenum]))
|
self.lines_without_raw_strings[linenum]))
|
||||||
@ -5068,10 +5074,12 @@ def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
|
|||||||
#
|
#
|
||||||
# We also make an exception for Lua headers, which follow google
|
# We also make an exception for Lua headers, which follow google
|
||||||
# naming convention but not the include convention.
|
# naming convention but not the include convention.
|
||||||
match = Match(r'#include\s*"([^/]+\.h)"', line)
|
match = Match(r'#include\s*"([^/]+\.(.*))"', line)
|
||||||
if match and not _THIRD_PARTY_HEADERS_PATTERN.match(match.group(1)):
|
if match:
|
||||||
error(filename, linenum, 'build/include_subdir', 4,
|
if (IsHeaderExtension(match.group(2)) and
|
||||||
'Include the directory when naming .h files')
|
not _THIRD_PARTY_HEADERS_PATTERN.match(match.group(1))):
|
||||||
|
error(filename, linenum, 'build/include_subdir', 4,
|
||||||
|
'Include the directory when naming header files')
|
||||||
|
|
||||||
# we shouldn't include a file more than once. actually, there are a
|
# we shouldn't include a file more than once. actually, there are a
|
||||||
# handful of instances where doing so is okay, but in general it's
|
# handful of instances where doing so is okay, but in general it's
|
||||||
@ -6523,7 +6531,7 @@ def ProcessConfigOverrides(filename):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(cfg_file) as file_handle:
|
with open(cfg_file, encoding='utf-8') as file_handle:
|
||||||
for line in file_handle:
|
for line in file_handle:
|
||||||
line, _, _ = line.partition('#') # Remove comments.
|
line, _, _ = line.partition('#') # Remove comments.
|
||||||
if not line.strip():
|
if not line.strip():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user