-
-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zmerp-staging #2625
base: master
Are you sure you want to change the base?
zmerp-staging #2625
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,16 +44,20 @@ pub fn clippy_ci() { | |
let stream = Deserializer::from_slice(&out.stdout).into_iter::<Value>(); | ||
|
||
// https://doc.rust-lang.org/cargo/reference/external-tools.html#json-messages | ||
for message in stream.filter_map(|msg| { | ||
let msg = msg.unwrap(); | ||
let messages = stream | ||
.filter_map(|msg| { | ||
let msg = msg.unwrap(); | ||
|
||
if msg.get("reason")? == "compiler-message" { | ||
msg.get("message").map(|x| x.to_owned()) | ||
} else { | ||
None | ||
} | ||
}) { | ||
let msg: CompilerMessage = json::from_value(message).unwrap(); | ||
if msg.get("reason")? == "compiler-message" { | ||
msg.get("message").map(|x| x.to_owned()) | ||
} else { | ||
None | ||
} | ||
}) | ||
.collect::<Vec<_>>(); | ||
|
||
for message in &messages { | ||
let msg: CompilerMessage = json::from_value(message.clone()).unwrap(); | ||
|
||
if msg.message_type != "diagnostic" { | ||
continue; | ||
|
@@ -100,4 +104,8 @@ pub fn clippy_ci() { | |
if !out.status.success() { | ||
panic!("ci clippy didn't exit with 0 code, propagating failure"); | ||
} | ||
|
||
if !messages.is_empty() { | ||
panic!("ci clippy produced warnings"); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm pretty sure there's also other compiler messages than diagnostics (you'd have to check the rustc docs tho), but we should only cause a ci failure when a diagnostic is actually emitted. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I checked and there's actually some, but they're not very frequent. Either way the diagnostic message filtering should be moved to the main filter (or a second stacked filter_map), as that'll fully ensure that causes no issues. |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could make this an expect ig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. All allows should be turned into expect actually.