Skip to content

Commit

Permalink
Add a test for empty file list in git hook suggestion (#26)
Browse files Browse the repository at this point in the history
As it was, the proposed git hook will fail if no Julia file has been
edited in the commit (for example if we only edited Project.toml).
  • Loading branch information
Klafyvel authored Jul 26, 2024
1 parent 88e6560 commit 5326088
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ exec 1>&2
# Run Runic on added and modified files
mapfile -t files < <(git diff-index --name-only --diff-filter=AM master | grep '\.jl$')
julia --project=@runic -m Runic --check --diff "${files[@]}"
if [ ${#files[@]} -gt 0 ]; then
julia --project=@runic -m Runic --check --diff "${files[@]}"
fi
```
## Formatting specification
Expand Down

0 comments on commit 5326088

Please sign in to comment.