-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: pre-commit format all (TS, Rust)
Signed-off-by: Martichou <[email protected]>
- Loading branch information
Showing
3 changed files
with
21 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: rust-format | ||
name: Rust Format | ||
entry: ./rs_fmt.sh | ||
- id: project-format | ||
name: Project Format | ||
entry: ./fmt.sh | ||
language: script | ||
stages: [commit] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
for dir in core_lib frontend/src-tauri; do | ||
find "$dir" -name '*.rs' -not -path "*/target/*" -exec rustfmt {} + | ||
done | ||
|
||
# Check if there are changes in the /frontend/src directory | ||
if git diff --name-only HEAD | grep '^frontend/src/' >/dev/null; then | ||
echo "Changes detected in /frontend/src. Executing script..." | ||
|
||
# Navigate to the frontend/src-tauri directory | ||
cd frontend/src-tauri | ||
|
||
# Run your commands | ||
pnpm lint --fix | ||
else | ||
echo "No changes detected in /frontend/src." | ||
fi |