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

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 phansch:add_stderr_length_check branch 2 times, most recently from 539fcf0 to 5431392 May 16, 2019

@flip1995
Copy link
Member

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()

This comment has been minimized.

Copy link
@flip1995

flip1995 May 16, 2019

Member

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

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

@phansch phansch force-pushed the phansch:add_stderr_length_check branch from 63be8c6 to d9a8a8a May 16, 2019

@phansch

This comment has been minimized.

Copy link
Member Author

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() {

This comment has been minimized.

Copy link
@flip1995

flip1995 May 17, 2019

Member

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

This comment has been minimized.

Copy link
@phansch

phansch May 17, 2019

Author Member

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

@flip1995

This comment has been minimized.

Copy link
Member

commented May 17, 2019

r=me with travis green

@phansch

This comment has been minimized.

Copy link
Member Author

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

This comment has been minimized.

Copy link
Member Author

commented May 19, 2019

@bors r=flip1995

@bors

This comment has been minimized.

Copy link
Contributor

commented May 19, 2019

📌 Commit 619a290 has been approved by flip1995

@bors

This comment has been minimized.

Copy link
Contributor

commented May 19, 2019

⌛️ Testing commit 619a290 with merge f4de904...

bors added a commit that referenced this pull request May 19, 2019
Auto merge of #4100 - phansch:add_stderr_length_check, r=flip1995
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

This comment has been minimized.

Copy link
Contributor

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

Travis CI - Pull Request Build Failed
Details
homu Test successful
Details

@phansch phansch deleted the phansch: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
Projects
None yet
3 participants
You can’t perform that action at this time.