File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 8
8
fail-fast : false
9
9
matrix :
10
10
os : [macos-latest, windows-latest, ubuntu-latest]
11
- python-version : [3.6, 3.7, 3.8 ]
11
+ python-version : ['3.8', '3.9', '3.10' ]
12
12
name : Test - ${{ matrix.os }}, ${{ matrix.python-version }}
13
13
runs-on : ${{ matrix.os }}
14
14
steps :
@@ -136,7 +136,7 @@ jobs:
136
136
137
137
- uses : actions/setup-python@v2
138
138
with :
139
- python-version : 3.7
139
+ python-version : ' 3.10 '
140
140
141
141
- name : Install Python dependencies
142
142
run : pip install wheel
Original file line number Diff line number Diff line change @@ -223,7 +223,8 @@ def func_substitute(header, lines):
223
223
pos = match .start (1 ) + len (header .prefix ) + len (match .group (1 ))
224
224
225
225
# If function name is part of this header, substitute its name
226
- if match .group (1 ) in header .func_names :
226
+ line = lines [match .start (1 ):lines .find ("\n " , match .start (1 ))]
227
+ if match .group (1 ) in header .func_names and "NOLINT" not in line :
227
228
lines = lines [0 :match .start (1 )] + header .prefix + \
228
229
match .group (1 ) + lines [match .end (1 ):]
229
230
return lines
Original file line number Diff line number Diff line change @@ -36,12 +36,22 @@ def test_stdlib():
36
36
" std::free(mem);" + os .linesep + \
37
37
"}" + os .linesep , True )
38
38
39
- # Test NOLINT
39
+ # Test NOLINT on #include
40
40
test .add_input ("./Main.cpp" ,
41
41
"#include <cstdint> // NOLINT" + os .linesep + \
42
42
"#include <stdlib.h> // NOLINT" + os .linesep )
43
43
test .add_latest_input_as_output (True )
44
44
45
+ # Test NOLINT on function
46
+ test .add_input ("./Main.cpp" ,
47
+ " abs() // NOLINT" + os .linesep + \
48
+ " abs()" + os .linesep + \
49
+ " abs() // NOLINT" + os .linesep )
50
+ test .add_output (
51
+ " abs() // NOLINT" + os .linesep + \
52
+ " std::abs()" + os .linesep + \
53
+ " abs() // NOLINT" + os .linesep , True )
54
+
45
55
# FILE should be recognized as type here
46
56
test .add_input ("./Class.cpp" , "static FILE* Class::file = nullptr;" )
47
57
test .add_output ("static std::FILE* Class::file = nullptr;" , True )
You can’t perform that action at this time.
0 commit comments