FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codeql/rust/lint.py at codeql-cli/v2.27.1 · github/codeql · GitHub
github
codeql
Repository navigation
Code
Issues
1k
(1k)
Pull requests
485
(485)
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codeql
/
rust
/
lint.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
38 lines (25 loc) · 937 Bytes
Breadcrumbs
codeql
/
rust
/
lint.py
Copy path
File metadata and controls
executable file
·
38 lines (25 loc) · 937 Bytes
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
38
#!/usr/bin/env python3
import
subprocess
import
pathlib
import
shutil
import
sys
def
tool
(
name
):
ret
=
shutil
.
which
(
name
)
assert
ret
,
f"no
{
name
}
binary found on `PATH`"
return
ret
this_dir
=
pathlib
.
Path
(
__file__
).
resolve
().
parent
cargo
=
tool
(
"cargo"
)
bazel
=
tool
(
"bazel"
)
runs
=
[]
def
run
(
tool
,
args
,
*
,
cwd
=
this_dir
):
print
(
"+"
,
tool
,
args
)
runs
.
append
(
subprocess
.
run
([
tool
]
+
args
.
split
(),
cwd
=
cwd
))
# make sure bazel-provided sources are put in tree for `cargo` to work with them
run
(
bazel
,
"run ast-generator:inject-sources"
)
run
(
cargo
,
"fmt --all --quiet"
)
for
manifest
in
this_dir
.
rglob
(
"Cargo.toml"
):
if
not
manifest
.
is_relative_to
(
this_dir
/
"ql"
)
and
not
manifest
.
is_relative_to
(
this_dir
/
"integration-tests"
):
run
(
cargo
,
"clippy --fix --allow-dirty --allow-staged --quiet -- -D warnings"
,
cwd
=
manifest
.
parent
)
sys
.
exit
(
max
(
r
.
returncode
for
r
in
runs
))
Back
|
FazBrowse Home
|
New Git URL