-
-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Formatting: format and add CI action (#2511)
* Formatting: format and add CI action * Update to 0.13.2 and fix ret * Refactor how CI action exits * Rebase and reformat
- Loading branch information
Showing
49 changed files
with
3,428 additions
and
1,640 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: format-check | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- release-* | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: julia-actions/setup-julia@latest | ||
with: | ||
version: '1' | ||
- uses: actions/checkout@v1 | ||
- name: Format check | ||
shell: julia --color=yes {0} | ||
run: | | ||
using Pkg | ||
Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.2")) | ||
using JuliaFormatter | ||
format("src", verbose=true) | ||
format("test", verbose=true) | ||
out = String(read(Cmd(`git diff`))) | ||
if isempty(out) | ||
exit(0) | ||
end | ||
@error "Some files have not been formatted !!!" | ||
write(stdout, out) | ||
exit(1) |
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
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
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
Oops, something went wrong.