-
Notifications
You must be signed in to change notification settings - Fork 8
Add support for running crate specific extra_lints.sh
#21
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
Changes from 3 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 |
|---|---|---|
|
|
@@ -72,40 +72,41 @@ main() { | |
| fi | ||
|
|
||
| case $task in | ||
| stable) | ||
| # Test, run examples, do feature matrix. | ||
| # crate/contrib/test_vars.sh is sourced in this function. | ||
| build_and_test | ||
| ;; | ||
|
|
||
| nightly) | ||
| build_and_test | ||
| ;; | ||
|
|
||
| msrv) | ||
| build_and_test | ||
| ;; | ||
|
|
||
| lint) | ||
| do_lint | ||
| do_dup_deps | ||
| ;; | ||
|
|
||
| docs) | ||
| build_docs_with_stable_toolchain | ||
| ;; | ||
|
|
||
| docsrs) | ||
| build_docs_with_nightly_toolchain | ||
| ;; | ||
|
|
||
| bench) | ||
| do_bench | ||
| ;; | ||
|
|
||
| *) | ||
| err "Error: unknown task $task" | ||
| ;; | ||
| stable) | ||
| # Test, run examples, do feature matrix. | ||
| # crate/contrib/test_vars.sh is sourced in this function. | ||
| build_and_test | ||
| ;; | ||
|
|
||
| nightly) | ||
| build_and_test | ||
| ;; | ||
|
|
||
| msrv) | ||
| build_and_test | ||
| ;; | ||
|
|
||
| lint) | ||
| do_lint_workspace | ||
| do_lint_crates | ||
| do_dup_deps | ||
| ;; | ||
|
|
||
| docs) | ||
| build_docs_with_stable_toolchain | ||
| ;; | ||
|
|
||
| docsrs) | ||
| build_docs_with_nightly_toolchain | ||
| ;; | ||
|
|
||
| bench) | ||
| do_bench | ||
| ;; | ||
|
|
||
| *) | ||
| err "Error: unknown task $task" | ||
| ;; | ||
| esac | ||
| } | ||
|
|
||
|
|
@@ -228,17 +229,22 @@ loop_features() { | |
| } | ||
|
|
||
| # Lint the workspace. | ||
| do_lint() { | ||
| do_lint_workspace() { | ||
| need_nightly | ||
|
|
||
| $cargo clippy --workspace --all-targets --all-features --keep-going -- -D warnings | ||
| $cargo clippy --workspace --all-targets --keep-going -- -D warnings | ||
|
Contributor
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'll admit I am not sure on the driving reason for this change, so my bad if a dumb question, but what's the reasoning on dropping
Contributor
Author
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. Sorry I forgot to link to the issue in The bit that was dropped is Dropping
Contributor
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. Ah ok, thanks for stepping through that for me. So now is the second clippy run testing the default features while the first is all?
Contributor
Author
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. Yes, we also thought we were doing a third run with no features. But as you can see in the related issue this is not the case. EDIT: I say "we" but really this is my first contribution to this repo 😊.
Contributor
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. Yea makes sense. Is there any benefits to running the default features one? Feels a little murky what that would actually resolve to for the workspace.
Contributor
Author
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 think so, only because when I was testing this change there was a lint error in https://github.com/rust-bitcoin/corepc that only comes up with the second clippy with default features. It didn't come up before because that line was not run for |
||
| } | ||
|
|
||
| # Ugly hack to skip `corpec` because `node` does not build with no default features. | ||
| if echo "$REPO_DIR" | grep -viq "corepc"; then | ||
| # Lint various feature combinations to try and catch mistakes in feature gating. | ||
| $cargo clippy --workspace --all-targets --keep-going -- -D warnings | ||
| $cargo clippy --workspace --all-targets --no-default-features --keep-going -- -D warnings | ||
| fi | ||
| # Run extra crate specific lints, e.g. clippy with no-default-features. | ||
| do_lint_crates() { | ||
| need_nightly | ||
| for crate in $CRATES; do | ||
| pushd "$REPO_DIR/$crate" > /dev/null | ||
| if [ -e ./contrib/extra_lints.sh ]; then | ||
| ./contrib/extra_lints.sh | ||
|
Contributor
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. Would be nice to add this new interface to the README. Might just be my naive/fresh eyes, but I found the README really helpful to understand the interface of this repo.
Contributor
Author
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. Thanks, I agree. I just forgot. Added a line to the README. |
||
| fi | ||
| popd > /dev/null | ||
| done | ||
| } | ||
|
|
||
| # We should not have any duplicate dependencies. This catches mistakes made upgrading dependencies | ||
|
|
@@ -332,7 +338,7 @@ say_err() { | |
|
|
||
| verbose_say() { | ||
| if [ "$flag_verbose" = true ]; then | ||
| say "$1" | ||
| say "$1" | ||
| fi | ||
| } | ||
|
|
||
|
|
||
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.
Was just poking around this repo for the first time and appreciate the whitespace clean up