FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
CppCoreGuidelines/scripts/python/cpplint_wrap.py at master · isocpp/CppCoreGuidelines · GitHub
isocpp
CppCoreGuidelines
Repository navigation
Code
Issues
237
(237)
Pull requests
11
(11)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
CppCoreGuidelines
/
scripts
/
python
/
cpplint_wrap.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (32 loc) · 1.35 KB
Breadcrumbs
CppCoreGuidelines
/
scripts
/
python
/
cpplint_wrap.py
Copy path
File metadata and controls
37 lines (32 loc) · 1.35 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
## wraps local cpplint to produce verbose output without code harness
import
cpplint
import
sys
def
main
():
FILTERS
=
(
'cpplint --verbose=0 --linelength=100 --filter=-legal/copyright,-build/include_order,'
'-build/c++11,-build/namespaces,-build/class,-build/include,-build/include_subdir,-readability/inheritance,'
'-readability/function,-readability/casting,-readability/namespace,-readability/alt_tokens,'
'-readability/braces,-readability/fn_size,-whitespace/comments,-whitespace/braces,-whitespace/empty_loop_body,'
'-whitespace/indent,-whitespace/newline,-runtime/explicit,-runtime/arrays,-runtime/int,-runtime/references,'
'-runtime/string,-runtime/operator,-runtime/printf'
).
split
(
' '
)
result
=
False
files
=
sys
.
argv
[
1
:]
for
loopfile
in
files
:
newargs
=
FILTERS
+
[
loopfile
]
sys
.
argv
=
newargs
try
:
cpplint
.
main
()
except
SystemExit
as
e
:
last_result
=
e
.
args
[
0
]
result
=
result
or
last_result
if
(
last_result
):
write_code_lines
(
loopfile
)
sys
.
exit
(
result
)
def
write_code_lines
(
filename
):
with
open
(
filename
,
'r'
)
as
f
:
linenum
=
1
for
line
in
f
:
if
(
not
'// by md-split'
in
line
):
sys
.
stdout
.
write
(
'%3d %s'
%
(
linenum
,
line
))
linenum
+=
1
if
__name__
==
'__main__'
:
main
()
Back
|
FazBrowse Home
|
New Git URL