Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93205057
cq
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, Nov 27, 00:29
Size
2 KB
Mime Type
text/x-python
Expires
Fri, Nov 29, 00:29 (2 d)
Engine
blob
Format
Raw Data
Handle
22498659
Attached To
rAKA akantu
cq
View Options
#!/usr/bin/env python3
import
click
import
codequality
@click
.
group
()
@click
.
option
(
'-x'
,
'--exclude'
,
default
=
[],
multiple
=
True
)
@click
.
option
(
'-e'
,
'--extensions'
,
default
=
'.cc, .hh'
)
@click
.
option
(
'-f'
,
'--file-list'
,
default
=
None
)
@click
.
pass_context
def
cq
(
ctx
,
exclude
,
extensions
,
file_list
):
ctx
.
obj
[
'excludes'
]
=
exclude
ctx
.
obj
[
'extensions'
]
=
[
ext
.
strip
()
for
ext
in
extensions
.
split
(
','
)]
if
file_list
is
not
None
:
with
open
(
file_list
,
'r'
)
as
fh
:
ctx
.
obj
[
'file_list'
]
=
[
file_
.
strip
()
for
file_
in
fh
.
readlines
()]
@cq
.
command
(
context_settings
=
dict
(
ignore_unknown_options
=
True
,
))
@click
.
option
(
'-p'
,
'--compiledb-path'
,
default
=
'.'
)
@click
.
option
(
'-c'
,
'--clang-tidy-executable'
,
default
=
'clang-tidy'
)
@click
.
argument
(
'clang_tidy_args'
,
nargs
=-
1
,
type
=
click
.
UNPROCESSED
)
@click
.
pass_context
def
clang_tidy
(
ctx
,
compiledb_path
,
clang_tidy_executable
,
clang_tidy_args
):
codequality
.
run
(
'clang_tidy'
,
compiledb_path
=
compiledb_path
,
clang_tidy_executable
=
clang_tidy_executable
,
arguments
=
clang_tidy_args
,
**
ctx
.
obj
)
@cq
.
command
(
context_settings
=
dict
(
ignore_unknown_options
=
True
,
))
@click
.
option
(
'-p'
,
'--compiledb-path'
,
default
=
'.'
)
@click
.
option
(
'-c'
,
'--clang-format-executable'
,
default
=
'clang-format'
)
@click
.
argument
(
'clang_format_args'
,
nargs
=-
1
,
type
=
click
.
UNPROCESSED
)
@click
.
pass_context
def
clang_format
(
ctx
,
compiledb_path
,
clang_format_executable
,
clang_format_args
):
codequality
.
run
(
'clang_format'
,
compiledb_path
=
compiledb_path
,
clang_format_executable
=
clang_format_executable
,
arguments
=
clang_format_args
,
**
ctx
.
obj
)
@cq
.
command
(
context_settings
=
dict
(
ignore_unknown_options
=
True
,
))
@click
.
argument
(
'files'
,
nargs
=-
1
,
type
=
click
.
UNPROCESSED
)
@click
.
pass_context
def
warnings
(
ctx
,
files
):
codequality
.
run
(
'warnings'
,
files
=
files
,
**
ctx
.
obj
)
if
__name__
==
'__main__'
:
cq
(
obj
=
{})
Event Timeline
Log In to Comment