- Switch to pyroject macros.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cpplint?expand=0&rev=16
This commit is contained in:
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.osc
|
||||
3
cpplint-1.6.1.tar.gz
Normal file
3
cpplint-1.6.1.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d430ce8f67afc1839340e60daa89e90de08b874bc27149833077bba726dfc13a
|
||||
size 364487
|
||||
780
deprecated-unittest-aliases.patch
Normal file
780
deprecated-unittest-aliases.patch
Normal file
@@ -0,0 +1,780 @@
|
||||
From ea0004c2ae98c4e275f58d20bf42095160171f87 Mon Sep 17 00:00:00 2001
|
||||
From: Karthikeyan Singaravelan <tir.karthi@gmail.com>
|
||||
Date: Sun, 17 Oct 2021 11:29:03 +0530
|
||||
Subject: [PATCH] Refactor deprecated unittest aliases for Python 3.11
|
||||
compatibility.
|
||||
|
||||
---
|
||||
cpplint_unittest.py | 177 +++++++++++++++++++++++---------------------
|
||||
1 file changed, 93 insertions(+), 84 deletions(-)
|
||||
|
||||
Index: cpplint-1.6.1/cpplint_unittest.py
|
||||
===================================================================
|
||||
--- cpplint-1.6.1.orig/cpplint_unittest.py
|
||||
+++ cpplint-1.6.1/cpplint_unittest.py
|
||||
@@ -152,13 +152,15 @@ class CpplintTestBase(unittest.TestCase)
|
||||
def setUp(self):
|
||||
# Allow subclasses to cheat os.path.abspath called in FileInfo class.
|
||||
self.os_path_abspath_orig = os.path.abspath
|
||||
+ self.assertEquals = self.assertEqual
|
||||
+ self.assertTrue = self.assertTrue
|
||||
|
||||
def tearDown(self):
|
||||
os.path.abspath = self.os_path_abspath_orig
|
||||
|
||||
# Perform lint on single line of input and return the error message.
|
||||
def PerformSingleLineLint(self, code):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
lines = code.split('\n')
|
||||
cpplint.RemoveMultiLineComments('foo.h', lines, error_collector)
|
||||
clean_lines = cpplint.CleansedLines(lines)
|
||||
@@ -176,7 +178,7 @@ class CpplintTestBase(unittest.TestCase)
|
||||
|
||||
# Perform lint over multiple lines and return the error message.
|
||||
def PerformMultiLineLint(self, code):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
lines = code.split('\n')
|
||||
cpplint.RemoveMultiLineComments('foo.h', lines, error_collector)
|
||||
lines = cpplint.CleansedLines(lines)
|
||||
@@ -193,7 +195,7 @@ class CpplintTestBase(unittest.TestCase)
|
||||
# Similar to PerformMultiLineLint, but calls CheckLanguage instead of
|
||||
# CheckForNonStandardConstructs
|
||||
def PerformLanguageRulesCheck(self, file_name, code):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
include_state = cpplint._IncludeState()
|
||||
nesting_state = cpplint.NestingState()
|
||||
lines = code.split('\n')
|
||||
@@ -221,7 +223,7 @@ class CpplintTestBase(unittest.TestCase)
|
||||
The accumulated errors.
|
||||
"""
|
||||
file_name = 'foo.cc'
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
function_state = cpplint._FunctionState()
|
||||
lines = code.split('\n')
|
||||
cpplint.RemoveMultiLineComments(file_name, lines, error_collector)
|
||||
@@ -233,7 +235,7 @@ class CpplintTestBase(unittest.TestCase)
|
||||
|
||||
def PerformIncludeWhatYouUse(self, code, filename='foo.h', io=codecs):
|
||||
# First, build up the include state.
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
include_state = cpplint._IncludeState()
|
||||
nesting_state = cpplint.NestingState()
|
||||
lines = code.split('\n')
|
||||
@@ -277,7 +279,7 @@ class CpplintTestBase(unittest.TestCase)
|
||||
self.doTestBlankLinesCheck(lines, start_errors, end_errors, extension)
|
||||
|
||||
def doTestBlankLinesCheck(self, lines, start_errors, end_errors, extension):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.' + extension, extension, lines, error_collector)
|
||||
self.assertEqual(
|
||||
start_errors,
|
||||
@@ -294,7 +296,7 @@ class CpplintTestBase(unittest.TestCase)
|
||||
class CpplintTest(CpplintTestBase):
|
||||
|
||||
def GetNamespaceResults(self, lines):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.RemoveMultiLineComments('foo.h', lines, error_collector)
|
||||
lines = cpplint.CleansedLines(lines)
|
||||
nesting_state = cpplint.NestingState()
|
||||
@@ -509,7 +511,7 @@ class CpplintTest(CpplintTestBase):
|
||||
'Use int16/int64/etc, rather than the C type long'
|
||||
' [runtime/int] [4]')
|
||||
# NOLINTNEXTLINE silences warning for the next line instead of current line
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('test.cc', 'cc',
|
||||
['// Copyright 2014 Your Company.',
|
||||
'// NOLINTNEXTLINE(whitespace/line_length)',
|
||||
@@ -518,7 +520,7 @@ class CpplintTest(CpplintTestBase):
|
||||
error_collector)
|
||||
self.assertEqual('', error_collector.Results())
|
||||
# LINT_C_FILE silences cast warnings for entire file.
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('test.h', 'h',
|
||||
['// Copyright 2014 Your Company.',
|
||||
'// NOLINT(build/header_guard)',
|
||||
@@ -552,7 +554,7 @@ class CpplintTest(CpplintTestBase):
|
||||
'vim: se filetype=c :',
|
||||
'vim: se sw=8 filetype=c :',
|
||||
'vim: se sw=8 filetype=c ts=8 :']:
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('test.h', 'h',
|
||||
['// Copyright 2014 Your Company.',
|
||||
'// NOLINT(build/header_guard)',
|
||||
@@ -564,7 +566,7 @@ class CpplintTest(CpplintTestBase):
|
||||
error_collector)
|
||||
self.assertEqual('', error_collector.Results())
|
||||
# LINT_KERNEL_FILE silences whitespace/tab warnings for entire file.
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('test.h', 'h',
|
||||
['// Copyright 2014 Your Company.',
|
||||
'// NOLINT(build/header_guard)',
|
||||
@@ -576,7 +578,7 @@ class CpplintTest(CpplintTestBase):
|
||||
error_collector)
|
||||
self.assertEqual('', error_collector.Results())
|
||||
# NOLINT, NOLINTNEXTLINE silences the readability/braces warning for "};".
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('test.cc', 'cc',
|
||||
['// Copyright 2014 Your Company.',
|
||||
'for (int i = 0; i != 100; ++i) {',
|
||||
@@ -837,7 +839,7 @@ class CpplintTest(CpplintTestBase):
|
||||
self.TestLint('std::function< int(bool) >', '')
|
||||
self.TestLint('mfunction<int(bool)>', '')
|
||||
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(
|
||||
'test.cc', 'cc',
|
||||
['// Copyright 2014 Your Company. All Rights Reserved.',
|
||||
@@ -876,7 +878,7 @@ class CpplintTest(CpplintTestBase):
|
||||
'MOCK_CONST_METHOD1(method, SomeType(int));',
|
||||
'')
|
||||
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('mock.cc', 'cc',
|
||||
['MOCK_METHOD1(method1,',
|
||||
' bool(int));',
|
||||
@@ -1373,7 +1375,7 @@ class CpplintTest(CpplintTestBase):
|
||||
for extension in ['c', 'cc', 'cpp', 'cxx', 'c++', 'cu']:
|
||||
file_path = 'mydir/foo.' + extension
|
||||
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, extension,
|
||||
['const char* str = "This is a\\',
|
||||
' multiline string.";'],
|
||||
@@ -1724,7 +1726,7 @@ class CpplintTest(CpplintTestBase):
|
||||
};""",
|
||||
'')
|
||||
# Special case for variadic arguments
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['class Foo {',
|
||||
' template<typename... Args>',
|
||||
@@ -1734,7 +1736,7 @@ class CpplintTest(CpplintTestBase):
|
||||
self.assertEqual(0, error_collector.ResultList().count(
|
||||
'Constructors that require multiple arguments should not be marked '
|
||||
'explicit. [runtime/explicit] [0]'))
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['class Foo {',
|
||||
' template<typename... Args>',
|
||||
@@ -1744,7 +1746,7 @@ class CpplintTest(CpplintTestBase):
|
||||
self.assertEqual(0, error_collector.ResultList().count(
|
||||
'Constructors that require multiple arguments should not be marked '
|
||||
'explicit. [runtime/explicit] [0]'))
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['class Foo {',
|
||||
' template<typename... Args>',
|
||||
@@ -1754,7 +1756,7 @@ class CpplintTest(CpplintTestBase):
|
||||
self.assertEqual(1, error_collector.ResultList().count(
|
||||
'Constructors callable with one argument should be marked explicit.'
|
||||
' [runtime/explicit] [5]'))
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['class Foo {',
|
||||
' template<typename... Args>',
|
||||
@@ -1765,7 +1767,7 @@ class CpplintTest(CpplintTestBase):
|
||||
'Constructors callable with one argument should be marked explicit.'
|
||||
' [runtime/explicit] [5]'))
|
||||
# Anything goes inside an assembly block
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['void Func() {',
|
||||
' __asm__ (',
|
||||
@@ -1875,7 +1877,7 @@ class CpplintTest(CpplintTestBase):
|
||||
self.TestLint('virtual int F() %s;' % virt_specifier, error_message)
|
||||
self.TestLint('virtual int F() %s {' % virt_specifier, error_message)
|
||||
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(
|
||||
'foo.cc', 'cc',
|
||||
['// Copyright 2014 Your Company.',
|
||||
@@ -1900,7 +1902,7 @@ class CpplintTest(CpplintTestBase):
|
||||
self.TestLint('int F() final override;', error_message)
|
||||
self.TestLint('int F() final override {}', error_message)
|
||||
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(
|
||||
'foo.cc', 'cc',
|
||||
['// Copyright 2014 Your Company.',
|
||||
@@ -2074,7 +2076,7 @@ class CpplintTest(CpplintTestBase):
|
||||
for macro_name in (
|
||||
'DISALLOW_COPY_AND_ASSIGN',
|
||||
'DISALLOW_IMPLICIT_CONSTRUCTORS'):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(
|
||||
'foo.cc', 'cc',
|
||||
['// Copyright 2014 Your Company.',
|
||||
@@ -2090,7 +2092,7 @@ class CpplintTest(CpplintTestBase):
|
||||
' [readability/constructors] [3]',
|
||||
error_collector.Results())
|
||||
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(
|
||||
'foo.cc', 'cc',
|
||||
['// Copyright 2014 Your Company.',
|
||||
@@ -2109,7 +2111,7 @@ class CpplintTest(CpplintTestBase):
|
||||
' [readability/constructors] [3]',
|
||||
error_collector.Results())
|
||||
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(
|
||||
'foo.cc', 'cc',
|
||||
['// Copyright 2014 Your Company.',
|
||||
@@ -2442,7 +2444,7 @@ class CpplintTest(CpplintTestBase):
|
||||
|
||||
# Don't warn on out-of-line method definitions.
|
||||
self.TestLint('void NS::Func(X& x) {', '')
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(
|
||||
'foo.cc', 'cc',
|
||||
['// Copyright 2014 Your Company. All Rights Reserved.',
|
||||
@@ -2456,7 +2458,7 @@ class CpplintTest(CpplintTestBase):
|
||||
|
||||
# Other potential false positives. These need full parser
|
||||
# state to reproduce as opposed to just TestLint.
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(
|
||||
'foo.cc', 'cc',
|
||||
['// Copyright 2014 Your Company. All Rights Reserved.',
|
||||
@@ -2499,7 +2501,7 @@ class CpplintTest(CpplintTestBase):
|
||||
self.assertEqual('', error_collector.Results())
|
||||
|
||||
# Multi-line references
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(
|
||||
'foo.cc', 'cc',
|
||||
['// Copyright 2014 Your Company. All Rights Reserved.',
|
||||
@@ -2525,7 +2527,7 @@ class CpplintTest(CpplintTestBase):
|
||||
error_collector.Results())
|
||||
|
||||
# A peculiar false positive due to bad template argument parsing
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(
|
||||
'foo.cc', 'cc',
|
||||
['// Copyright 2014 Your Company. All Rights Reserved.',
|
||||
@@ -2545,7 +2547,7 @@ class CpplintTest(CpplintTestBase):
|
||||
'{ should almost always be at the end of the previous line'
|
||||
' [whitespace/braces] [4]')
|
||||
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['int function()',
|
||||
'{', # warning here
|
||||
@@ -3056,7 +3058,7 @@ class CpplintTest(CpplintTestBase):
|
||||
'}\n', '')
|
||||
|
||||
# Check multiline cases.
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['// Copyright 2014 Your Company.',
|
||||
'string Class',
|
||||
@@ -3207,7 +3209,7 @@ class CpplintTest(CpplintTestBase):
|
||||
# 1' line was also causing the issue.
|
||||
def testLinePrecededByEmptyOrCommentLines(self):
|
||||
def DoTest(self, lines):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc', lines, error_collector)
|
||||
# The warning appears only once.
|
||||
self.assertEqual(
|
||||
@@ -3230,7 +3232,7 @@ class CpplintTest(CpplintTestBase):
|
||||
|
||||
def testNewlineAtEOF(self):
|
||||
def DoTest(self, data, is_missing_eof):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc', data.split('\n'),
|
||||
error_collector)
|
||||
# The warning appears only once.
|
||||
@@ -3245,7 +3247,7 @@ class CpplintTest(CpplintTestBase):
|
||||
|
||||
def testInvalidUtf8(self):
|
||||
def DoTest(self, raw_bytes, has_invalid_utf8):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
if sys.version_info < (3,):
|
||||
unidata = unicode(raw_bytes, 'utf8', 'replace').split('\n')
|
||||
else:
|
||||
@@ -3271,7 +3273,7 @@ class CpplintTest(CpplintTestBase):
|
||||
|
||||
def testBadCharacters(self):
|
||||
# Test for NUL bytes only
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('nul.cc', 'cc',
|
||||
['// Copyright 2014 Your Company.',
|
||||
'\0', ''], error_collector)
|
||||
@@ -3281,7 +3283,7 @@ class CpplintTest(CpplintTestBase):
|
||||
|
||||
# Make sure both NUL bytes and UTF-8 are caught if they appear on
|
||||
# the same line.
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
raw_bytes = codecs_latin_encode('\xe9x\0')
|
||||
if sys.version_info < (3,):
|
||||
unidata = unicode(raw_bytes, 'utf8', 'replace')
|
||||
@@ -3300,11 +3302,11 @@ class CpplintTest(CpplintTestBase):
|
||||
'Line contains NUL byte. [readability/nul] [5]'])
|
||||
|
||||
def testIsBlankLine(self):
|
||||
- self.assert_(cpplint.IsBlankLine(''))
|
||||
- self.assert_(cpplint.IsBlankLine(' '))
|
||||
- self.assert_(cpplint.IsBlankLine(' \t\r\n'))
|
||||
- self.assert_(not cpplint.IsBlankLine('int a;'))
|
||||
- self.assert_(not cpplint.IsBlankLine('{'))
|
||||
+ self.assertTrue(cpplint.IsBlankLine(''))
|
||||
+ self.assertTrue(cpplint.IsBlankLine(' '))
|
||||
+ self.assertTrue(cpplint.IsBlankLine(' \t\r\n'))
|
||||
+ self.assertTrue(not cpplint.IsBlankLine('int a;'))
|
||||
+ self.assertTrue(not cpplint.IsBlankLine('{'))
|
||||
|
||||
def testBlankLinesCheck(self):
|
||||
self.TestBlankLinesCheck(['{\n', '\n', '\n', '}\n'], 1, 1)
|
||||
@@ -3323,7 +3325,7 @@ class CpplintTest(CpplintTestBase):
|
||||
['int x(\n', ' int a) {\n', '\n', 'return 0;\n', '}'], 1, 0)
|
||||
|
||||
def testAllowBlankLineBeforeClosingNamespace(self):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['namespace {',
|
||||
'',
|
||||
@@ -3348,7 +3350,7 @@ class CpplintTest(CpplintTestBase):
|
||||
' [whitespace/blank_line] [3]'))
|
||||
|
||||
def testAllowBlankLineBeforeIfElseChain(self):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['if (hoge) {',
|
||||
'', # No warning
|
||||
@@ -3365,7 +3367,7 @@ class CpplintTest(CpplintTestBase):
|
||||
' [whitespace/blank_line] [3]'))
|
||||
|
||||
def testAllowBlankLineAfterExtern(self):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['extern "C" {',
|
||||
'',
|
||||
@@ -3381,7 +3383,7 @@ class CpplintTest(CpplintTestBase):
|
||||
' [whitespace/blank_line] [3]'))
|
||||
|
||||
def testBlankLineBeforeSectionKeyword(self):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['class A {',
|
||||
' public:',
|
||||
@@ -3417,7 +3419,7 @@ class CpplintTest(CpplintTestBase):
|
||||
' [whitespace/blank_line] [3]'))
|
||||
|
||||
def testNoBlankLineAfterSectionKeyword(self):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['class A {',
|
||||
' public:',
|
||||
@@ -3441,7 +3443,7 @@ class CpplintTest(CpplintTestBase):
|
||||
' [whitespace/blank_line] [3]'))
|
||||
|
||||
def testAllowBlankLinesInRawStrings(self):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['// Copyright 2014 Your Company.',
|
||||
'static const char *kData[] = {R"(',
|
||||
@@ -3454,7 +3456,7 @@ class CpplintTest(CpplintTestBase):
|
||||
self.assertEqual('', error_collector.Results())
|
||||
|
||||
def testElseOnSameLineAsClosingBraces(self):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['if (hoge) {',
|
||||
'}',
|
||||
@@ -3468,7 +3470,7 @@ class CpplintTest(CpplintTestBase):
|
||||
'An else should appear on the same line as the preceding }'
|
||||
' [whitespace/newline] [4]'))
|
||||
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['if (hoge) {',
|
||||
'',
|
||||
@@ -3482,7 +3484,7 @@ class CpplintTest(CpplintTestBase):
|
||||
'An else should appear on the same line as the preceding }'
|
||||
' [whitespace/newline] [4]'))
|
||||
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['if (hoge) {',
|
||||
'',
|
||||
@@ -3494,7 +3496,7 @@ class CpplintTest(CpplintTestBase):
|
||||
' [whitespace/newline] [4]'))
|
||||
|
||||
def testMultipleStatementsOnSameLine(self):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['for (int i = 0; i < 1; i++) {}',
|
||||
'switch (x) {',
|
||||
@@ -3513,7 +3515,7 @@ class CpplintTest(CpplintTestBase):
|
||||
cpplint._cpplint_state.verbose_level = old_verbose_level
|
||||
|
||||
def testLambdasOnSameLine(self):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
old_verbose_level = cpplint._cpplint_state.verbose_level
|
||||
cpplint._cpplint_state.verbose_level = 0
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
@@ -3524,7 +3526,7 @@ class CpplintTest(CpplintTestBase):
|
||||
self.assertEqual(0, error_collector.Results().count(
|
||||
'More than one command on the same line [whitespace/newline] [0]'))
|
||||
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
old_verbose_level = cpplint._cpplint_state.verbose_level
|
||||
cpplint._cpplint_state.verbose_level = 0
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
@@ -3536,7 +3538,7 @@ class CpplintTest(CpplintTestBase):
|
||||
self.assertEqual(0, error_collector.Results().count(
|
||||
'More than one command on the same line [whitespace/newline] [0]'))
|
||||
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
old_verbose_level = cpplint._cpplint_state.verbose_level
|
||||
cpplint._cpplint_state.verbose_level = 0
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
@@ -3548,7 +3550,7 @@ class CpplintTest(CpplintTestBase):
|
||||
self.assertEqual(0, error_collector.Results().count(
|
||||
'More than one command on the same line [whitespace/newline] [0]'))
|
||||
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
old_verbose_level = cpplint._cpplint_state.verbose_level
|
||||
cpplint._cpplint_state.verbose_level = 0
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
@@ -3561,7 +3563,7 @@ class CpplintTest(CpplintTestBase):
|
||||
'More than one command on the same line [whitespace/newline] [0]'))
|
||||
|
||||
def testEndOfNamespaceComments(self):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('foo.cc', 'cc',
|
||||
['namespace {',
|
||||
'',
|
||||
@@ -4377,7 +4379,7 @@ class CpplintTest(CpplintTestBase):
|
||||
cpplint._DEFAULT_FILTERS = default_filters
|
||||
|
||||
def testDuplicateHeader(self):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('path/self.cc', 'cc',
|
||||
['// Copyright 2014 Your Company. All Rights Reserved.',
|
||||
'#include "path/self.h"',
|
||||
@@ -4481,7 +4483,7 @@ class CpplintTest(CpplintTestBase):
|
||||
|
||||
def GetBuildHeaderGuardPreprocessorSymbol(self, file_path):
|
||||
# Figure out the expected header guard by processing an empty file.
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, 'h', [], error_collector)
|
||||
for error in error_collector.ResultList():
|
||||
matched = re.search(
|
||||
@@ -4497,7 +4499,7 @@ class CpplintTest(CpplintTestBase):
|
||||
self.assertTrue(re.search('MYDIR_FOO_H_$', expected_guard))
|
||||
|
||||
# No guard at all: expect one error.
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, 'h', [], error_collector)
|
||||
self.assertEqual(
|
||||
1,
|
||||
@@ -4507,7 +4509,7 @@ class CpplintTest(CpplintTestBase):
|
||||
error_collector.ResultList())
|
||||
|
||||
# No header guard, but the error is suppressed.
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, 'h',
|
||||
['// Copyright 2014 Your Company.',
|
||||
'// NOLINT(build/header_guard)', ''],
|
||||
@@ -4515,7 +4517,7 @@ class CpplintTest(CpplintTestBase):
|
||||
self.assertEqual([], error_collector.ResultList())
|
||||
|
||||
# Wrong guard
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, 'h',
|
||||
['#ifndef FOO_H', '#define FOO_H'], error_collector)
|
||||
self.assertEqual(
|
||||
@@ -4526,7 +4528,7 @@ class CpplintTest(CpplintTestBase):
|
||||
error_collector.ResultList())
|
||||
|
||||
# No define
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, 'h',
|
||||
['#ifndef %s' % expected_guard], error_collector)
|
||||
self.assertEqual(
|
||||
@@ -4537,7 +4539,7 @@ class CpplintTest(CpplintTestBase):
|
||||
error_collector.ResultList())
|
||||
|
||||
# Mismatched define
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, 'h',
|
||||
['#ifndef %s' % expected_guard,
|
||||
'#define FOO_H'],
|
||||
@@ -4550,7 +4552,7 @@ class CpplintTest(CpplintTestBase):
|
||||
error_collector.ResultList())
|
||||
|
||||
# No endif
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, 'h',
|
||||
['#ifndef %s' % expected_guard,
|
||||
'#define %s' % expected_guard,
|
||||
@@ -4564,7 +4566,7 @@ class CpplintTest(CpplintTestBase):
|
||||
error_collector.ResultList())
|
||||
|
||||
# Commentless endif
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, 'h',
|
||||
['#ifndef %s' % expected_guard,
|
||||
'#define %s' % expected_guard,
|
||||
@@ -4578,7 +4580,7 @@ class CpplintTest(CpplintTestBase):
|
||||
error_collector.ResultList())
|
||||
|
||||
# Commentless endif for old-style guard
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, 'h',
|
||||
['#ifndef %s_' % expected_guard,
|
||||
'#define %s_' % expected_guard,
|
||||
@@ -4592,7 +4594,7 @@ class CpplintTest(CpplintTestBase):
|
||||
error_collector.ResultList())
|
||||
|
||||
# No header guard errors
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, 'h',
|
||||
['#ifndef %s' % expected_guard,
|
||||
'#define %s' % expected_guard,
|
||||
@@ -4603,7 +4605,7 @@ class CpplintTest(CpplintTestBase):
|
||||
self.fail('Unexpected error: %s' % line)
|
||||
|
||||
# No header guard errors for old-style guard
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, 'h',
|
||||
['#ifndef %s_' % expected_guard,
|
||||
'#define %s_' % expected_guard,
|
||||
@@ -4617,7 +4619,7 @@ class CpplintTest(CpplintTestBase):
|
||||
try:
|
||||
cpplint._cpplint_state.verbose_level = 0
|
||||
# Warn on old-style guard if verbosity is 0.
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, 'h',
|
||||
['#ifndef %s_' % expected_guard,
|
||||
'#define %s_' % expected_guard,
|
||||
@@ -4633,7 +4635,7 @@ class CpplintTest(CpplintTestBase):
|
||||
cpplint._cpplint_state.verbose_level = old_verbose_level
|
||||
|
||||
# Completely incorrect header guard
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, 'h',
|
||||
['#ifndef FOO',
|
||||
'#define FOO',
|
||||
@@ -4653,7 +4655,7 @@ class CpplintTest(CpplintTestBase):
|
||||
error_collector.ResultList())
|
||||
|
||||
# incorrect header guard with nolint
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, 'h',
|
||||
['#ifndef FOO // NOLINT',
|
||||
'#define FOO',
|
||||
@@ -4674,7 +4676,7 @@ class CpplintTest(CpplintTestBase):
|
||||
|
||||
# Special case for flymake
|
||||
for test_file in ['mydir/foo_flymake.h', 'mydir/.flymake/foo.h']:
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(test_file, 'h',
|
||||
['// Copyright 2014 Your Company.', ''],
|
||||
error_collector)
|
||||
@@ -4688,7 +4690,7 @@ class CpplintTest(CpplintTestBase):
|
||||
# Cuda guard
|
||||
file_path = 'mydir/foo.cuh'
|
||||
expected_guard = self.GetBuildHeaderGuardPreprocessorSymbol(file_path)
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, 'cuh',
|
||||
['#ifndef FOO',
|
||||
'#define FOO',
|
||||
@@ -4708,7 +4710,7 @@ class CpplintTest(CpplintTestBase):
|
||||
error_collector.ResultList())
|
||||
|
||||
def testPragmaOnce(self):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData('mydir/foo.h', 'h',
|
||||
['// Copyright 2014 Your Company.', '#pragma once', ''],
|
||||
error_collector)
|
||||
@@ -4988,7 +4990,7 @@ class CpplintTest(CpplintTestBase):
|
||||
self.TestLanguageRulesCheck('foo.h', code, '')
|
||||
|
||||
def testBuildPrintfFormat(self):
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(
|
||||
'foo.cc', 'cc',
|
||||
[r'printf("\%%d", value);',
|
||||
@@ -5002,7 +5004,7 @@ class CpplintTest(CpplintTestBase):
|
||||
'%, [, (, and { are undefined character escapes. Unescape them.'
|
||||
' [build/printf_format] [3]'))
|
||||
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(
|
||||
'foo.cc', 'cc',
|
||||
['// Copyright 2014 Your Company.',
|
||||
@@ -5121,13 +5123,13 @@ class CpplintTest(CpplintTestBase):
|
||||
file_path = 'mydir/googleclient/foo.cc'
|
||||
|
||||
# There should be a copyright message in the first 10 lines
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, 'cc', [], error_collector)
|
||||
self.assertEqual(
|
||||
1,
|
||||
error_collector.ResultList().count(legal_copyright_message))
|
||||
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(
|
||||
file_path, 'cc',
|
||||
['' for unused_i in range(10)] + [copyright_line],
|
||||
@@ -5137,13 +5139,13 @@ class CpplintTest(CpplintTestBase):
|
||||
error_collector.ResultList().count(legal_copyright_message))
|
||||
|
||||
# Test that warning isn't issued if Copyright line appears early enough.
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(file_path, 'cc', [copyright_line], error_collector)
|
||||
for message in error_collector.ResultList():
|
||||
if message.find('legal/copyright') != -1:
|
||||
self.fail('Unexpected error: %s' % message)
|
||||
|
||||
- error_collector = ErrorCollector(self.assert_)
|
||||
+ error_collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(
|
||||
file_path, 'cc',
|
||||
['' for unused_i in range(9)] + [copyright_line],
|
||||
@@ -5179,14 +5181,14 @@ class Cxx11Test(CpplintTestBase):
|
||||
lines.append('')
|
||||
|
||||
# Process the file and check resulting error count.
|
||||
- collector = ErrorCollector(self.assert_)
|
||||
+ collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.ProcessFileData(filename, extension, lines, collector)
|
||||
error_list = collector.ResultList()
|
||||
self.assertEqual(count, len(error_list), error_list)
|
||||
|
||||
def TestCxx11Feature(self, code, expected_error):
|
||||
lines = code.split('\n')
|
||||
- collector = ErrorCollector(self.assert_)
|
||||
+ collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.RemoveMultiLineComments('foo.h', lines, collector)
|
||||
clean_lines = cpplint.CleansedLines(lines)
|
||||
cpplint.FlagCxx11Features('foo.cc', clean_lines, 0, collector)
|
||||
@@ -5244,7 +5246,7 @@ class Cxx14Test(CpplintTestBase):
|
||||
|
||||
def TestCxx14Feature(self, code, expected_error):
|
||||
lines = code.split('\n')
|
||||
- collector = ErrorCollector(self.assert_)
|
||||
+ collector = ErrorCollector(self.assertTrue)
|
||||
cpplint.RemoveMultiLineComments('foo.h', lines, collector)
|
||||
clean_lines = cpplint.CleansedLines(lines)
|
||||
cpplint.FlagCxx14Features('foo.cc', clean_lines, 0, collector)
|
||||
@@ -5261,6 +5263,9 @@ class Cxx14Test(CpplintTestBase):
|
||||
|
||||
class CleansedLinesTest(unittest.TestCase):
|
||||
|
||||
+ def setUp(self):
|
||||
+ self.assertEquals = self.assertEqual
|
||||
+
|
||||
def testInit(self):
|
||||
lines = ['Line 1',
|
||||
'Line 2',
|
||||
@@ -5645,6 +5650,7 @@ class CheckForFunctionLengthsTest(Cpplin
|
||||
|
||||
def setUp(self):
|
||||
# Reducing these thresholds for the tests speeds up tests significantly.
|
||||
+ CpplintTestBase.setUp(self)
|
||||
self.old_normal_trigger = cpplint._FunctionState._NORMAL_TRIGGER
|
||||
self.old_test_trigger = cpplint._FunctionState._TEST_TRIGGER
|
||||
|
||||
@@ -5996,6 +6002,7 @@ def TrimExtraIndent(text_block):
|
||||
class CloseExpressionTest(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
+ self.assertEquals = self.assertEqual
|
||||
self.lines = cpplint.CleansedLines(
|
||||
# 1 2 3 4 5
|
||||
# 0123456789012345678901234567890123456789012345678901234567890
|
||||
@@ -6067,7 +6074,8 @@ class NestingStateTest(unittest.TestCase
|
||||
|
||||
def setUp(self):
|
||||
self.nesting_state = cpplint.NestingState()
|
||||
- self.error_collector = ErrorCollector(self.assert_)
|
||||
+ self.error_collector = ErrorCollector(self.assertTrue)
|
||||
+ self.assertEquals = self.assertEqual
|
||||
|
||||
def UpdateWithLines(self, lines):
|
||||
clean_lines = cpplint.CleansedLines(lines)
|
||||
@@ -6450,6 +6458,7 @@ class QuietTest(unittest.TestCase):
|
||||
self.python_executable = sys.executable or 'python'
|
||||
self.cpplint_test_h = os.path.join(self.this_dir_path,
|
||||
'cpplint_test_header.h')
|
||||
+ self.assertEquals = self.assertEqual
|
||||
open(self.cpplint_test_h, 'w').close()
|
||||
|
||||
def tearDown(self):
|
||||
1774
drop-sre-compile.patch
Normal file
1774
drop-sre-compile.patch
Normal file
File diff suppressed because it is too large
Load Diff
106
python-cpplint.changes
Normal file
106
python-cpplint.changes
Normal file
@@ -0,0 +1,106 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 16 06:12:19 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Switch to pyroject macros.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 20 19:11:15 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
|
||||
|
||||
- Add upstream patches to support python 3.12
|
||||
- deprecated-unittest-aliases.patch, gh#cpplint/cpplint#182
|
||||
- python312.patch, gh#cpplint/cpplint#243
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 10 12:03:48 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
|
||||
|
||||
- Add drop-sre-compile.patch upstream patch to fix issues with
|
||||
deprecated usage of sre_compile gh#cpplint/cpplint#214
|
||||
- Update to 1.6.1
|
||||
* Fix #195 Fix post increment/decrement operator causing a false positive.
|
||||
* Fix #202 .hh files should not be considered sytem headers
|
||||
* Fix #207 Python2 incompatibility for loading CPPLINT.cfg file
|
||||
* Fix #184 NOLINT(clang-analyzer) comments should not cause warnings
|
||||
- 1.6.0 (2022-02-19)
|
||||
* Fix #188: "Include the directory when naming header files" also
|
||||
for header files with other names like "*.hpp"
|
||||
- 1.5.5 (2021-05-20)
|
||||
* Fix #172: Added 'size_t' to typecasts detected by CheckCStyleCast
|
||||
* Fixed wrong CLI help text: Each filter needs + or -
|
||||
* Fix #164: add elif as an exception for CheckSpacingForFunctionCall()
|
||||
* Fix google#346: --root option not working on windows due to
|
||||
slashes in path
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 31 06:47:40 UTC 2020 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Update to 1.5.4:
|
||||
* Fix google#166, Allow space before C++11 attributes
|
||||
* Fix #156: sed/gsed output parameter rejected
|
||||
* Fix #156: sed/gsed output without other stdout information
|
||||
* improvements to regression tests
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jul 1 04:34:56 UTC 2020 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Add missing BuildRequires on textfixtures.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jun 25 04:44:48 UTC 2020 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Update to 1.5.2:
|
||||
* Fix #83, output formats "sed" and "gsed" to auto-fix some issues
|
||||
* Fix #92, new category "build/namespaces_headers" for unnamed namespaces in header file
|
||||
* Sort list of files before processing
|
||||
* Fix #144 Falso positive for indent when using QT macros "signals" and "slots"
|
||||
* Fix #76 Parsing of class decorators that also use digits
|
||||
* Fix #139 Add message "Relative paths like . and .. are not allowed"
|
||||
* Revert #43 behavior change for include order from 1.5.0, and hide it behind command-line-flag --includeorder=standardcfirst. It turns out there is no easy objective way to tell c system headers from certain c++ library headers, and Google cpplint intentionally classifies some C++ header includes as C system header for simplicity.
|
||||
* Libraries considered as C system headers using --includeorder=standardcfirst now also includes linux-specifc headers (glibc-devel, glibc-kernheaders, linux-libc-dev).
|
||||
* Fix #43 false positives in header include order by checking includes against a list of c headers. Since this interprets certain include lines different than before, output about header include order changes.
|
||||
* Fix #135: allow 'if constexpr' in readability/braces.
|
||||
* Fix runtime warning: Close files after reading contents
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed May 27 09:36:50 UTC 2020 - Petr Gajdos <pgajdos@suse.com>
|
||||
|
||||
- %python3_only -> %python_alternative
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Apr 1 14:13:44 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
|
||||
|
||||
- update to 1.4.5
|
||||
* Add support for c++17 tuple destructuring
|
||||
* Travis CI: Add Python 3.8 to the testing
|
||||
* Fix linting unnecessary elif after break
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 25 23:10:30 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
|
||||
|
||||
- Remove bcond test
|
||||
- Remove unnecessary build dependency on python devel
|
||||
- Add %license
|
||||
- Update to v1.4.4
|
||||
* fix unit/cli tests for source release
|
||||
* reduce diff to upstream by intentionally using deprecated functions
|
||||
where upstream uses them
|
||||
* add --version
|
||||
- from 1.4.3
|
||||
* Revert "Fix the build/endif_comment check", same as reverted in upstream
|
||||
- from 1.4.2
|
||||
* Cleanup release, fixes further issues with tests and source distribution
|
||||
- from 1.4.1
|
||||
* Cleanup release, only adds test support files to source dist
|
||||
- from 1.4.0
|
||||
* Incorporate cpplint updates from google (e5d807c6a0d, 2018-05-03)
|
||||
* Fix the build/endif_comment check
|
||||
* Teach the explicit constructor check about constexpr
|
||||
* Changed vs7 output format
|
||||
* Remove presubmit check for DISALLOW_* macros
|
||||
* add --quiet flag as in upstream
|
||||
* support --root argument to run in different folder
|
||||
* Fix 16bit Unicode issue
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Nov 16 17:44:38 UTC 2017 - toddrme2178@gmail.com
|
||||
|
||||
- Initial version for v1.3.0
|
||||
83
python-cpplint.spec
Normal file
83
python-cpplint.spec
Normal file
@@ -0,0 +1,83 @@
|
||||
#
|
||||
# spec file for package python-cpplint
|
||||
#
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
Name: python-cpplint
|
||||
Version: 1.6.1
|
||||
Release: 0
|
||||
Summary: An automated checker to make sure a C++ file follows Google's C++ style guide
|
||||
License: BSD-3-Clause
|
||||
URL: https://github.com/cpplint/cpplint
|
||||
Source: https://files.pythonhosted.org/packages/source/c/cpplint/cpplint-%{version}.tar.gz
|
||||
# PATCH-FIX-UPSTREAM drop-sre-compile.patch gh#cpplint/cpplint#214
|
||||
Patch0: drop-sre-compile.patch
|
||||
# PATCH-FIX-UPSTREAM python312.patch gh#cpplint/cpplint#243
|
||||
Patch1: python312.patch
|
||||
# PATCH-FIX-UPSTREAM deprecated-unittest-aliases.patch gh#cpplint/cpplint#182
|
||||
Patch2: deprecated-unittest-aliases.patch
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module testfixtures}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
BuildArch: noarch
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
This project continues the work of cpplint, a C++ style checker
|
||||
following Google's C++ style guide. It provides cpplint as a PyPI
|
||||
package and adds a few features and fixes. It is maintained as a
|
||||
fork of google/styleguide (https://github.com/google/styleguide)
|
||||
in hopes that it can be merged in the future.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n cpplint-%{version}
|
||||
sed -i -e '/^#!\//, 1d' cpplint.py
|
||||
sed -i 's/pytest-runner==5.2//' setup.py
|
||||
sed -i 's/pytest-cov//' test-requirements
|
||||
sed -i 's/--cov-fail-under=75 --cov=cpplint//' setup.cfg
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%python_clone -a %{buildroot}%{_bindir}/cpplint
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%check
|
||||
%pytest
|
||||
|
||||
%post
|
||||
%python_install_alternative cpplint
|
||||
|
||||
%postun
|
||||
%python_uninstall_alternative cpplint
|
||||
|
||||
%files %{python_files}
|
||||
%license LICENSE
|
||||
%doc README.rst
|
||||
%python_alternative %{_bindir}/cpplint
|
||||
%{python_sitelib}/cpplint.py
|
||||
%pycache_only %{python_sitelib}/__pycache__/cpplint.*.pyc
|
||||
%{python_sitelib}/cpplint-%{version}.dist-info
|
||||
|
||||
%changelog
|
||||
2018
python312.patch
Normal file
2018
python312.patch
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user