Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F82446445
__init__.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Sep 11, 11:27
Size
1 KB
Mime Type
text/x-python
Expires
Fri, Sep 13, 11:27 (2 d)
Engine
blob
Format
Raw Data
Handle
20698229
Attached To
rAKA akantu
__init__.py
View Options
#!/usr/bin/env python3
import
sys
try
:
from
termcolor
import
colored
except
ImportError
:
def
colored
(
text
,
color
):
# pylint: disable=unused-argument
"""fallback function for termcolor.colored"""
return
text
def
print_debug
(
message
):
'''helper function to print debug messages'''
print
(
f
'Debug: {colored(message, "red")}'
,
file
=
sys
.
stderr
,
flush
=
True
)
def
print_info
(
message
):
'''helper function to print info messages'''
print
(
f
'Info: {colored(message, "blue")}'
,
file
=
sys
.
stderr
,
flush
=
True
)
from
.issue_generator_clang_tidy
import
ClangTidyIssueGenerator
from
.issue_generator_clang_format
import
ClangFormatIssueGenerator
from
.issue_generator_warnings
import
WarningsIssueGenerator
from
.issue_list
import
IssueList
def
run
(
cmd
,
**
kwargs
):
import
json
issue_list
=
IssueList
(
**
kwargs
)
if
cmd
==
'clang_tidy'
:
tool
=
ClangTidyIssueGenerator
(
issue_list
,
**
kwargs
)
elif
cmd
==
'clang_format'
:
tool
=
ClangFormatIssueGenerator
(
issue_list
,
**
kwargs
)
elif
cmd
==
'warnings'
:
tool
=
WarningsIssueGenerator
(
issue_list
,
**
kwargs
)
tool
.
generate_issues
()
print
(
json
.
dumps
(
issue_list
.
issues
))
Event Timeline
Log In to Comment