Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
83fcf95f
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
83fcf95f
编写于
1月 23, 2021
作者:
M
Matthias Krüger
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename cargo dev crater to cargo dev lintcheck
上级
48fc948c
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
22 addition
and
22 deletion
+22
-22
.cargo/config
.cargo/config
+1
-1
clippy_dev/Cargo.toml
clippy_dev/Cargo.toml
+1
-1
clippy_dev/lintcheck_crates.toml
clippy_dev/lintcheck_crates.toml
+0
-0
clippy_dev/src/lib.rs
clippy_dev/src/lib.rs
+1
-1
clippy_dev/src/lintcheck.rs
clippy_dev/src/lintcheck.rs
+10
-10
clippy_dev/src/main.rs
clippy_dev/src/main.rs
+9
-9
lintcheck-logs/logs.txt
lintcheck-logs/logs.txt
+0
-0
未找到文件。
.cargo/config
浏览文件 @
83fcf95f
[alias]
uitest = "test --test compile-test"
dev = "run --target-dir clippy_dev/target --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --"
dev-
crater = "run --target-dir clippy_dev/target --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --features crater -- crater
"
dev-
lintcheck = "run --target-dir clippy_dev/target --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --features lintcheck -- lintcheck
"
[build]
rustflags = ["-Zunstable-options"]
clippy_dev/Cargo.toml
浏览文件 @
83fcf95f
...
...
@@ -21,5 +21,5 @@ ureq = { version = "2.0.0-rc3", optional = true }
walkdir
=
"2"
[features]
crater
=
[
"flate2"
,
"serde_json"
,
"tar"
,
"toml"
,
"ureq"
,
"serde"
]
lintcheck
=
[
"flate2"
,
"serde_json"
,
"tar"
,
"toml"
,
"ureq"
,
"serde"
]
deny-warnings
=
[]
clippy_dev/
crater
_crates.toml
→
clippy_dev/
lintcheck
_crates.toml
浏览文件 @
83fcf95f
文件已移动
clippy_dev/src/lib.rs
浏览文件 @
83fcf95f
...
...
@@ -11,8 +11,8 @@
use
walkdir
::
WalkDir
;
pub
mod
bless
;
pub
mod
crater
;
pub
mod
fmt
;
pub
mod
lintcheck
;
pub
mod
new_lint
;
pub
mod
ra_setup
;
pub
mod
serve
;
...
...
clippy_dev/src/
crater
.rs
→
clippy_dev/src/
lintcheck
.rs
浏览文件 @
83fcf95f
...
...
@@ -4,7 +4,7 @@
// When a new lint is introduced, we can search the results for new warnings and check for false
// positives.
#![cfg(feature
=
"
crater
"
)]
#![cfg(feature
=
"
lintcheck
"
)]
#![allow(clippy::filter_map)]
use
crate
::
clippy_project_root
;
...
...
@@ -69,8 +69,8 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
impl
CrateSource
{
fn
download_and_extract
(
&
self
)
->
Crate
{
let
extract_dir
=
PathBuf
::
from
(
"target/
crater
/crates"
);
let
krate_download_dir
=
PathBuf
::
from
(
"target/
crater
/downloads"
);
let
extract_dir
=
PathBuf
::
from
(
"target/
lintcheck
/crates"
);
let
krate_download_dir
=
PathBuf
::
from
(
"target/
lintcheck
/downloads"
);
// url to download the crate from crates.io
let
url
=
format!
(
...
...
@@ -78,7 +78,7 @@ fn download_and_extract(&self) -> Crate {
self
.name
,
self
.version
);
println!
(
"Downloading and extracting {} {} from {}"
,
self
.name
,
self
.version
,
url
);
let
_
=
std
::
fs
::
create_dir
(
"target/
crater
/"
);
let
_
=
std
::
fs
::
create_dir
(
"target/
lintcheck
/"
);
let
_
=
std
::
fs
::
create_dir
(
&
krate_download_dir
);
let
_
=
std
::
fs
::
create_dir
(
&
extract_dir
);
...
...
@@ -112,7 +112,7 @@ fn run_clippy_lints(&self, cargo_clippy_path: &PathBuf) -> Vec<ClippyWarning> {
println!
(
"Linting {} {}..."
,
&
self
.name
,
&
self
.version
);
let
cargo_clippy_path
=
std
::
fs
::
canonicalize
(
cargo_clippy_path
)
.unwrap
();
let
shared_target_dir
=
clippy_project_root
()
.join
(
"target/
crater
/shared_target_dir/"
);
let
shared_target_dir
=
clippy_project_root
()
.join
(
"target/
lintcheck
/shared_target_dir/"
);
let
all_output
=
std
::
process
::
Command
::
new
(
cargo_clippy_path
)
.env
(
"CARGO_TARGET_DIR"
,
shared_target_dir
)
...
...
@@ -149,9 +149,9 @@ fn build_clippy() {
.expect
(
"Failed to build clippy!"
);
}
// get a list of CrateSources we want to check from a "
crater
_crates.toml" file.
// get a list of CrateSources we want to check from a "
lintcheck
_crates.toml" file.
fn
read_crates
()
->
Vec
<
CrateSource
>
{
let
toml_path
=
PathBuf
::
from
(
"clippy_dev/
crater
_crates.toml"
);
let
toml_path
=
PathBuf
::
from
(
"clippy_dev/
lintcheck
_crates.toml"
);
let
toml_content
:
String
=
std
::
fs
::
read_to_string
(
&
toml_path
)
.unwrap_or_else
(|
_
|
panic!
(
"Failed to read {}"
,
toml_path
.display
()));
let
crate_list
:
CrateList
=
...
...
@@ -231,7 +231,7 @@ pub fn run(clap_config: &ArgMatches) {
// if we don't have the specified crated in the .toml, throw an error
if
!
crates
.iter
()
.any
(|
krate
|
krate
.name
==
only_one_crate
)
{
eprintln!
(
"ERROR: could not find crate '{}' in clippy_dev/
crater
_crates.toml"
,
"ERROR: could not find crate '{}' in clippy_dev/
lintcheck
_crates.toml"
,
only_one_crate
);
std
::
process
::
exit
(
1
);
...
...
@@ -279,8 +279,8 @@ pub fn run(clap_config: &ArgMatches) {
all_msgs
.push
(
"
\n\n\n\n
Stats
\n\n
"
.into
());
all_msgs
.push
(
stats_formatted
);
// save the text into
mini-crater
/logs.txt
// save the text into
lintcheck-logs
/logs.txt
let
mut
text
=
clippy_ver
;
// clippy version number on top
text
.push_str
(
&
format!
(
"
\n
{}"
,
all_msgs
.join
(
""
)));
write
(
"
mini-crater
/logs.txt"
,
text
)
.unwrap
();
write
(
"
lintcheck-logs
/logs.txt"
,
text
)
.unwrap
();
}
clippy_dev/src/main.rs
浏览文件 @
83fcf95f
...
...
@@ -3,8 +3,8 @@
use
clap
::{
App
,
Arg
,
ArgMatches
,
SubCommand
};
use
clippy_dev
::{
bless
,
fmt
,
new_lint
,
ra_setup
,
serve
,
stderr_length_check
,
update_lints
};
#[cfg(feature
=
"
crater
"
)]
use
clippy_dev
::
crater
;
#[cfg(feature
=
"
lintcheck
"
)]
use
clippy_dev
::
lintcheck
;
fn
main
()
{
let
matches
=
get_clap_config
();
...
...
@@ -13,9 +13,9 @@ fn main() {
(
"bless"
,
Some
(
matches
))
=>
{
bless
::
bless
(
matches
.is_present
(
"ignore-timestamp"
));
},
#[cfg(feature
=
"
crater
"
)]
(
"
crater
"
,
Some
(
matches
))
=>
{
crater
::
run
(
&
matches
);
#[cfg(feature
=
"
lintcheck
"
)]
(
"
lintcheck
"
,
Some
(
matches
))
=>
{
lintcheck
::
run
(
&
matches
);
},
(
"fmt"
,
Some
(
matches
))
=>
{
fmt
::
run
(
matches
.is_present
(
"check"
),
matches
.is_present
(
"verbose"
));
...
...
@@ -53,8 +53,8 @@ fn main() {
}
fn
get_clap_config
<
'a
>
()
->
ArgMatches
<
'a
>
{
#[cfg(feature
=
"
crater
"
)]
let
crater_sbcmd
=
SubCommand
::
with_name
(
"crater
"
)
#[cfg(feature
=
"
lintcheck
"
)]
let
lintcheck_sbcmd
=
SubCommand
::
with_name
(
"lintcheck
"
)
.about
(
"run clippy on a set of crates and check output"
)
.arg
(
Arg
::
with_name
(
"only"
)
...
...
@@ -183,8 +183,8 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
.arg
(
Arg
::
with_name
(
"lint"
)
.help
(
"Which lint's page to load initially (optional)"
)),
);
#[cfg(feature
=
"
crater
"
)]
let
app
=
app
.subcommand
(
crater
_sbcmd
);
#[cfg(feature
=
"
lintcheck
"
)]
let
app
=
app
.subcommand
(
lintcheck
_sbcmd
);
app
.get_matches
()
}
mini-crater
/logs.txt
→
lintcheck-logs
/logs.txt
浏览文件 @
83fcf95f
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录