Skip to content

Commit 93554f5

Browse files
committed
Add script to lint integration test
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.
1 parent cd12639 commit 93554f5

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)