Skip to content

Commit 856e83d

Browse files
committed
Add support for running crate specific extra_lints
Some lints need to be run at the crate level, e.g. no-default-features. Other crate specific lints can be useful in CI. Add support for running crate specific extra_lints.sh scripts.
1 parent 943ca06 commit 856e83d

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

ci/run_task.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ main() {
8787
;;
8888

8989
lint)
90-
do_lint
90+
do_lint_workspace
91+
do_lint_crates
9192
do_dup_deps
9293
;;
9394

@@ -228,12 +229,24 @@ loop_features() {
228229
}
229230

230231
# Lint the workspace.
231-
do_lint() {
232+
do_lint_workspace() {
232233
need_nightly
233234
$cargo clippy --workspace --all-targets --all-features --keep-going -- -D warnings
234235
$cargo clippy --workspace --all-targets --keep-going -- -D warnings
235236
}
236237

238+
# Run extra crate specific lints, e.g. clippy with no-default-features.
239+
do_lint_crates() {
240+
need_nightly
241+
for crate in $CRATES; do
242+
pushd "$REPO_DIR/$crate" > /dev/null
243+
if [ -e ./contrib/extra_lints.sh ]; then
244+
./contrib/extra_lints.sh
245+
fi
246+
popd > /dev/null
247+
done
248+
}
249+
237250
# We should not have any duplicate dependencies. This catches mistakes made upgrading dependencies
238251
# in one crate and not in another (e.g. upgrade bitcoin_hashes in bitcoin but not in secp).
239252
do_dup_deps() {

0 commit comments

Comments
 (0)