-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from ytdHuang/ci/format-check
Introduce CI FormatCheck
- Loading branch information
Showing
41 changed files
with
184 additions
and
162 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 |
---|---|---|
|
@@ -6,3 +6,4 @@ always_use_return=true | |
format_docstrings=true | ||
indent_submodule=true | ||
format_markdown=true | ||
ignore = ["README.md"] |
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,44 @@ | ||
name: Format Check | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- 'main' | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: ${{ !github.event.pull_request.draft }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: julia-actions/setup-julia@v2 | ||
with: | ||
version: '1' | ||
- name: Install and Run JuliaFormatter | ||
run: | | ||
julia -e 'import Pkg; Pkg.add("JuliaFormatter")' | ||
julia -e 'using JuliaFormatter; format(".", verbose=true)' | ||
- name: Format Check | ||
run: | | ||
julia -e ' | ||
output = Cmd(`git diff --name-only`) |> read |> String | ||
if output == "" | ||
exit(0) | ||
else | ||
@error "The following files have not been formatted !!!" | ||
write(stdout, output) | ||
write(stdout, "-----\n") | ||
write(stdout, "Please format them by running the following command:\n") | ||
write(stdout, "julia -e \"using JuliaFormatter; format(\\\".\\\")\"") | ||
exit(1) | ||
end' |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,4 @@ | |
window.addEventListener('message', adjustIframeHeight, false); | ||
</script> | ||
``` | ||
``` |
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.