Skip to content

Commit

Permalink
Invoke cargo dylint upgrade with --auto-correct in upgrade_exampl…
Browse files Browse the repository at this point in the history
…es.sh
  • Loading branch information
smoelius committed Dec 28, 2024
1 parent f5b7a8e commit a39b299
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/upgrade_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ for EXAMPLE in examples/general examples/supplementary examples/restriction $EXP
PREV_REV="$(sed -n 's/^clippy_utils\>.*\(\<\(rev\|tag\) = "[^"]*"\).*$/\1/;T;p' "$EXAMPLE"/Cargo.toml)"
PREV_CHANNEL="$(sed -n 's/^channel = "[^"]*"$/&/;T;p' "$EXAMPLE"/rust-toolchain)"

$CARGO_DYLINT upgrade "$EXAMPLE" 2>/dev/null || true
$CARGO_DYLINT upgrade "$EXAMPLE" --auto-correct 2>/dev/null || true

REV="$(sed -n 's/^clippy_utils\>.*\(\<\(rev\|tag\) = "[^"]*"\).*$/\1/;T;p' "$EXAMPLE"/Cargo.toml)"
sed -i "s/^\(clippy_config\>.*\)\<\(rev\|tag\) = \"[^\"]*\"\(.*\)$/\1$REV\3/" "$EXAMPLE"/Cargo.toml
Expand All @@ -53,7 +53,7 @@ for EXAMPLE in examples/general examples/supplementary examples/restriction $EXP
mv "$EXAMPLE"/Cargo.toml~ "$EXAMPLE"/Cargo.toml
fi

$CARGO_DYLINT upgrade "$EXAMPLE"
$CARGO_DYLINT upgrade "$EXAMPLE" --auto-correct

if [[ "$EXAMPLE" = 'internal/template' ]]; then
mv "$EXAMPLE"/Cargo.toml "$EXAMPLE"/Cargo.toml~
Expand Down

0 comments on commit a39b299

Please sign in to comment.