Skip to content
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

Run Clippy without json-rendered flag #63781

Merged
merged 1 commit into from Aug 21, 2019

Conversation

@mati865
Copy link
Contributor

commented Aug 21, 2019

Removed in #62766

Replacing it with --json=diagnostic-rendered-ansi fails:

error: using `--json` requires also using `--error-format=json`

Running ./x.py clippy src/libstd locally works fine (with colors) on Linux so I don't know if there is something to fix.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Aug 21, 2019

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@mati865

This comment has been minimized.

Copy link
Contributor Author

commented Aug 21, 2019

@Mark-Simulacrum

This comment has been minimized.

Copy link
Member

commented Aug 21, 2019

cc @ehuss/@alexcrichton

@oli-obk

This comment has been minimized.

Copy link
Contributor

commented Aug 21, 2019

Please keep colors by adding both --json=diagnostic-rendered-ansi and --error-format=json

@mati865

This comment has been minimized.

Copy link
Contributor Author

commented Aug 21, 2019

@oli-obk I tried it before and it didn't work:

$ ./x.py clippy src/libstd                    
Updating only changed submodules
Submodules updated in 0.02 seconds
   Compiling bootstrap v0.0.0 (/home/mateusz/Projects/rust/rust/src/bootstrap)
    Finished dev [unoptimized] target(s) in 6.40s
Checking std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Checking core v0.0.0 (/home/mateusz/Projects/rust/rust/src/libcore)
   Compiling compiler_builtins v0.1.18
   Compiling libc v0.2.60
error: Option 'error-format' given more than once

error: Could not compile `core`.
warning: build failed, waiting for other jobs to finish...
error: build failed
command did not execute successfully: "/home/mateusz/Projects/rust/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "clippy" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "16" "--release" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/home/mateusz/Projects/rust/rust/src/libstd/Cargo.toml" "--message-format" "json-render-diagnostics" "--" "--cap-lints" "warn"
expected success, got: exit code: 101
failed to run: /home/mateusz/Projects/rust/rust/build/bootstrap/debug/bootstrap clippy src/libstd
diff
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 4e49aaa16ea..3a5901156b4 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -875,7 +875,8 @@ impl<'a> Builder<'a> {
         }
 
         if cmd == "clippy" {
-            extra_args.push_str("-Zforce-unstable-if-unmarked");
+            extra_args.push_str("-Zforce-unstable-if-unmarked \
+            --json=diagnostic-rendered-ansi --error-format=json");
         }
 
         if !extra_args.is_empty() {
@oli-obk

This comment has been minimized.

Copy link
Contributor

commented Aug 21, 2019

Huh I thought we had a setup to allow error-format to be passed multiple times, because cargo also sets it twice sometimes. Maybe the bootstrap cargo is too old?

@mati865

This comment has been minimized.

Copy link
Contributor Author

commented Aug 21, 2019

Using cargo 1.39.0-nightly (3f700ec43 2019-08-19) fails with the same error.

@ehuss

This comment has been minimized.

Copy link
Contributor

commented Aug 21, 2019

Please keep colors by adding both --json=diagnostic-rendered-ansi and --error-format=json

I'm not sure I understand this (colors should work fine). cargo clippy is just a wrapper around cargo check. The --message-format flag (set in stream_cargo) tells cargo how to set these now, so this PR should be good.

@ehuss
ehuss approved these changes Aug 21, 2019
@oli-obk

This comment has been minimized.

Copy link
Contributor

commented Aug 21, 2019

Ah, wonderful

@bors r=oli-obk,ehuss

@bors

This comment has been minimized.

Copy link
Contributor

commented Aug 21, 2019

📌 Commit 5cf43bd has been approved by oli-obk,ehuss

Centril added a commit to Centril/rust that referenced this pull request Aug 21, 2019
Rollup merge of rust-lang#63781 - mati865:clippy, r=oli-obk,ehuss
Run Clippy without json-rendered flag

Removed in rust-lang#62766

Replacing it with `--json=diagnostic-rendered-ansi` fails:
```
error: using `--json` requires also using `--error-format=json`
```
Running `./x.py clippy src/libstd` locally works fine (with colors) on Linux so I don't know if there is something to fix.
bors added a commit that referenced this pull request Aug 21, 2019
Auto merge of #63790 - Centril:rollup-m4ax3r9, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #61236 (take into account the system theme)
 - #63717 (Fix nested eager expansions in arguments of `format_args`)
 - #63747 (update Miri)
 - #63772 (ci: move libc mirrors to the rust-lang-ci-mirrors bucket)
 - #63780 (Improve diagnostics: break/continue in wrong context)
 - #63781 (Run Clippy without json-rendered flag)

Failed merges:

r? @ghost

@bors bors merged commit 5cf43bd into rust-lang:master Aug 21, 2019

4 checks passed

pr Build #20190821.26 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-6.0) Linux x86_64-gnu-llvm-6.0 succeeded
Details
pr (LinuxTools) LinuxTools succeeded
Details

@mati865 mati865 deleted the mati865:clippy branch Aug 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.