Skip to content

Commit f576e10

Browse files
committed
White-list third-party in conf files
1 parent 1c43e19 commit f576e10

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

src/conf.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ macro_rules! define_Conf {
100100
}
101101
},
102102
)+
103+
"third-party" => {
104+
// for external tools such as clippy-service
105+
return Ok(());
106+
}
103107
_ => {
104108
return Err(ConfError::UnknownKey(name));
105109
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
# that one is an error
12
foobar = 42
3+
4+
# that one is white-listed
5+
[third-party]
6+
clippy-feature = "nightly"

tests/run-pass/conf_unknown_key.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#![feature(plugin)]
2+
#![plugin(clippy(conf_file="./tests/run-pass/conf_unknown_key.toml"))]
3+
4+
fn main() {}

tests/run-pass/conf_unknown_key.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# this is ignored by Clippy, but allowed for other tools like clippy-service
2+
[third-party]
3+
clippy-feature = "nightly"

0 commit comments

Comments
 (0)