Skip to content

Commit

Permalink
Relax the scripts checking cargo fmt requirements. (#406)
Browse files Browse the repository at this point in the history
cargo fmt sometimes has false positives, which is annoying for getting
PRs submitted! This relaxes the requirements a bit.

---------

Co-authored-by: Hoyt Koepke <[email protected]>
  • Loading branch information
Hoyt Koepke and Hoyt Koepke authored Jul 10, 2024
1 parent 9f46ec9 commit e456c9d
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 106 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,26 @@ jobs:
if [[ ! -e "$d/Cargo.toml" ]] ; then
continue
fi
pushd $d
# cargo format.
cargo fmt
cargo clippy -r --verbose -- -D warnings # elevates warnings to errors
if [[ -n "$(git status --porcelain)" ]] ; then
echo "cargo fmt not run; please run scripts/ready-pull-request.sh and resubmit."
exit 1
fi
pushd $d
cargo clippy -r --verbose -- -D warnings # elevates warnings to errors
if [[ -e ./Cargo.lock ]] ; then
cargo generate-lockfile
# cargo format.
if ! cargo fmt --check ; then
echo "cargo fmt not run; please run ./scripts/ready-pull-request.sh and resubmit."
exit 1
fi
if [[ -n "$(git status --porcelain)" ]] ; then
echo "Cargo.lock for $d not up to date; please run scripts/ready-pull-request.sh and resubmit."
exit 1
fi
fi
# Disabling this for now as a check; fails way too often.
#
# if [[ -e ./Cargo.lock ]] ; then
# # Offline prevents it from updating packages that haven't been updated locally.
# if ! cargo generate-lockfile --locked ; then
# echo "Cargo.lock for $d not up to date; please run ./scripts/ready-pull-request.sh and resubmit."
# exit 1
# fi
# fi
popd
done
Expand Down
Loading

0 comments on commit e456c9d

Please sign in to comment.