Skip to content

Commit bd6fa92

Browse files
committed
White-list third-party in conf files
1 parent 645d1d2 commit bd6fa92

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

src/conf.rs

+4
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
}
+5
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

+4
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

+3
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)