mirror of
https://github.com/pezkuwichain/pezkuwi-runtime-templates.git
synced 2026-06-11 23:31:01 +00:00
Toml-sort (#69)
* run toml sort and add script for it * add ci * try patch * try fix * add file permissions * check if installation state persists or starts from scratch every time * Revert "check if installation state persists or starts from scratch every time" This reverts commit 45e7aae8d2f18cbe1a78482d234b98fcfbe8b6ae. * Apply suggestions from code review * clean * fix * try revert * fix
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
find . -name "Cargo.toml" -not -path "*/target/*" -exec toml-sort {} \;
|
||||
|
||||
CMD="git diff --name-only"
|
||||
|
||||
stdbuf -oL $CMD | {
|
||||
while IFS= read -r line; do
|
||||
echo ║ $line
|
||||
if [[ "$line" == *"Cargo.toml" ]]; then
|
||||
echo "Check fails: $line"
|
||||
echo "Please run './scripts/toml-sort.sh' to format Cargo.toml files properly."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# From the workspace directory, run :
|
||||
# ./scripts/toml-sort.sh
|
||||
# to format all Cargo.toml files, and
|
||||
# ./scripts/toml-sort.sh --check
|
||||
# to only check the formatting.
|
||||
|
||||
if ! type "toml-sort" > /dev/null; then
|
||||
echo "Run 'cargo install --git https://github.com/4meta5/toml_sort'"
|
||||
else
|
||||
find . -name "Cargo.toml" -not -path "*/target/*" -exec toml-sort {} $@ \;
|
||||
fi
|
||||
Reference in New Issue
Block a user