Skip to content

Commit 964cfca

Browse files
committed
Merge #258: Add script to lint integration test
93554f5 Add script to lint integration test (Tobin C. Harding) Pull request description: The integration test crate is not part of the workspace and also cannot be built wit all features so linting it must be done for each feature. Add a script that runs the linter. ACKs for top commit: jamillambert: ACK 93554f5 Tree-SHA512: be2e4e2cf90b46a5fa54bdfad3a83584580f2d5caf84c883c6fd9b0df3f631b0bbafaabf6dd52002081f4858c03ef955c301316bed03780607ea7173dae213d6
2 parents 8008ef7 + 93554f5 commit 964cfca

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

contrib/lint-integtation-tests.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
#
3+
# The `integration_test` crate is not part of the workspace and cannot be built
4+
# with `--all-features`.
5+
6+
set -euox pipefail
7+
8+
REPO_DIR=$(git rev-parse --show-toplevel)
9+
10+
# Run clippy for each feature starting with an integer i.e., all
11+
# the 'public' features.
12+
function main() {
13+
pushd "$REPO_DIR/integration_test" > /dev/null
14+
15+
# Extract features that start with digits from the manifest.
16+
features=$(grep -E '^[0-9]' Cargo.toml | grep '=' | cut -d' ' -f1)
17+
18+
for feature in $features; do
19+
cargo +"$(cat ../nightly-version)" clippy --all-targets --features="$feature" -- -D warnings
20+
done
21+
22+
popd
23+
}
24+
25+
main "$@"
26+
exit 0

0 commit comments

Comments
 (0)