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

Add a stderr file length check to clippy_dev #4100

Merged
merged 2 commits into from May 19, 2019

Conversation

@phansch
Copy link
Member

@phansch phansch commented May 16, 2019

This adds a check to clippy_dev that enforces a maximum line count for
stderr files. CI will fail if the line count is exceeded. It's
currently set to 320 lines.

Ideally this would be implemented in compiletest-rs but there are
plans to move Rust's compiletest into the compiletest-rs repository
and I don't want to do the work in compiletest twice. However, I also
don't want to wait until the move is done, so I added the check to
clippy_dev until it makes sense to add it to compiletest-rs.

changelog: none

cc #2038

@phansch phansch force-pushed the add_stderr_length_check branch 2 times, most recently from 539fcf0 to 5431392 May 16, 2019
Copy link
Member

@flip1995 flip1995 left a comment

LGTM. There are some empty lines (17, 55) in stderr_length_check.rs. (rustfmt should have removed these? 🤔)

clippy_dev/src/stderr_length_check.rs Outdated Show resolved Hide resolved
} else {
None
}
}).collect()
Copy link
Member

@flip1995 flip1995 May 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not returning impl Iterator<Item = String>, instead of collecting?

This adds a check to `clippy_dev` that enforces a maximum line count for
`stderr` files. CI will fail if the line count is exceeded. It's
currently set to `320` lines.

Ideally this would be implemented in `compiletest-rs` but there are
plans to move Rust's `compiletest` into the `compiletest-rs` repository
and I don't want to do the work in `compiletest` twice. However, I also
don't want to wait until the move is done, so I added the check to
`clippy_dev` until it makes sense to add it to compiletest-rs.

cc rust-lang#2038
@phansch phansch force-pushed the add_stderr_length_check branch from 63be8c6 to d9a8a8a May 16, 2019
@phansch
Copy link
Member Author

@phansch phansch commented May 17, 2019

Uhh, I've never seen this failure before and a job restart didn't fix it either:

https://travis-ci.com/rust-lang/rust-clippy/jobs/200943066#L886

error: extern location for serde does not exist: target/debug/deps/libserde-61a62cbc4921f441.rmeta

error: aborting due to previous error

let stderr_files = stderr_files();
let exceeding_files = exceeding_stderr_files(stderr_files).collect::<Vec<String>>();

if !exceeding_files.is_empty() {
Copy link
Member

@flip1995 flip1995 May 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh the collection is needed because of this. In this case it doesn't matter if we collect inside the function or here. Sorry for that :D

Copy link
Member Author

@phansch phansch May 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's still better to collect at the call site rather than in the function itself, so it's fine 👍

@flip1995
Copy link
Member

@flip1995 flip1995 commented May 17, 2019

r=me with travis green

@phansch
Copy link
Member Author

@phansch phansch commented May 17, 2019

I couldn't reproduce the issue locally and will have another look later today.

Why can't it find the .rmeta file for serde, and serde only? I couldn't find any recent changes in Clippy or Rust that look like they would cause this.

Any pointers appreciated =)

edit: opened #4108 because it also happens in other PRs

@phansch
Copy link
Member Author

@phansch phansch commented May 19, 2019

@bors r=flip1995

@bors
Copy link
Contributor

@bors bors commented May 19, 2019

📌 Commit 619a290 has been approved by flip1995

@bors
Copy link
Contributor

@bors bors commented May 19, 2019

Testing commit 619a290 with merge f4de904...

bors added a commit that referenced this issue May 19, 2019
Add a stderr file length check to clippy_dev

This adds a check to `clippy_dev` that enforces a maximum line count for
`stderr` files. CI will fail if the line count is exceeded. It's
currently set to `320` lines.

Ideally this would be implemented in `compiletest-rs` but there are
plans to move Rust's `compiletest` into the `compiletest-rs` repository
and I don't want to do the work in `compiletest` twice. However, I also
don't want to wait until the move is done, so I added the check to
`clippy_dev` until it makes sense to add it to compiletest-rs.

cc #2038
@bors
Copy link
Contributor

@bors bors commented May 19, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: flip1995
Pushing f4de904 to master...

@bors bors merged commit 619a290 into rust-lang:master May 19, 2019
1 of 2 checks passed
@phansch phansch deleted the add_stderr_length_check branch May 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants