Simplify run_lint script
top_dir=$(cd $(dirname $(dirname $0)) && pwd)
-dirs="
- $top_dir/sdk
- $top_dir/cli
- $top_dir/contracts/schema
- $top_dir/contracts/pike
- $top_dir/contracts/product
- $top_dir/contracts/track_and_trace
- $top_dir/daemon
-"
-
exitcode=0
-for dir in $dirs; do
- cd $dir
- echo "$dir"
+cd $top_dir
echo "-- rustfmt"
@@ -45,7 +33,7 @@ for dir in $dirs; do
if [[ $rustfmt_exit != 0 ]]; then
exitcode=1
if [[ $rustfmt_exit == 1 ]]; then
- echo "Incorrect formatting: $dir (error code: $rustfmt_exit)"
+ echo "Incorrect formatting: (error code: $rustfmt_exit)"
echo "$diff"
else
echo "rustfmt encountered an operational error"
@@ -65,12 +53,10 @@ for dir in $dirs; do
if [[ $clippy_exit != 0 ]]; then
exitcode=1
if [[ $clippy_exit == 101 ]]; then
- echo "Clippy errors were found: $dir (error code: $clippy_exit)"
+ echo "Clippy errors were found: (error code: $clippy_exit)"
else
echo "Clippy encountered an operational error"
fi
fi
-done
-
exit $exitcode
