Skip to content

Commit

Permalink
Build tools
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Dec 16, 2022
1 parent dedf5d2 commit 8380027
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
21 changes: 21 additions & 0 deletions build-tools/rustclippy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -e
if [ -d ./build-tools ]; then
targets=(
"Cargo.toml"
"sea-schema-derive/Cargo.toml"
)

for target in "${targets[@]}"; do
echo "cargo clippy --manifest-path ${target} --fix --allow-dirty --allow-staged"
cargo clippy --manifest-path "${target}" --fix --allow-dirty --allow-staged
done

tests=(`find tests -type f -name 'Cargo.toml'`)
for example in "${tests[@]}"; do
echo "cargo clippy --manifest-path ${example} --fix --allow-dirty --allow-staged"
cargo clippy --manifest-path "${example}" --fix --allow-dirty --allow-staged
done
else
echo "Please execute this script from the repository root."
fi
21 changes: 21 additions & 0 deletions build-tools/rustfmt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -e
if [ -d ./build-tools ]; then
targets=(
"Cargo.toml"
"sea-schema-derive/Cargo.toml"
)

for target in "${targets[@]}"; do
echo "cargo +nightly fmt --manifest-path ${target} --all"
cargo +nightly fmt --manifest-path "${target}" --all
done

tests=(`find tests -type f -name 'Cargo.toml'`)
for example in "${tests[@]}"; do
echo "cargo +nightly fmt --manifest-path ${example} --all"
cargo +nightly fmt --manifest-path "${example}" --all
done
else
echo "Please execute this script from the repository root."
fi

0 comments on commit 8380027

Please sign in to comment.