-
Notifications
You must be signed in to change notification settings - Fork 12
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 #74 from JuliaTrustworthyAI/73-add-format-check-to-ci
added FormatCheck
- Loading branch information
Showing
26 changed files
with
616 additions
and
600 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 +1,7 @@ | ||
style = "blue" | ||
using Pkg # Load package manager | ||
Pkg.add("JuliaFormatter") # Install JuliaFormatter | ||
|
||
using JuliaFormatter # Load JuliaFormatter | ||
format("."; verbose=true) # Format all files | ||
|
||
Pkg.rm("JuliaFormatter") # Remove JuliaFormatter |
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,2 @@ | ||
style = "blue" | ||
pipe_to_function_call = false |
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,34 @@ | ||
name: Format Check | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
- 'release-' | ||
tags: '*' | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: julia-actions/setup-julia@latest | ||
with: | ||
version: 1 | ||
- uses: actions/checkout@v1 | ||
- name: Install JuliaFormatter | ||
run: | | ||
using Pkg | ||
Pkg.add("JuliaFormatter") | ||
shell: julia --color=yes {0} | ||
- name: Format code | ||
run: | | ||
using JuliaFormatter | ||
format("."; verbose=true) | ||
shell: julia --color=yes {0} | ||
- name: Suggest formatting changes | ||
uses: reviewdog/action-suggester@v1 | ||
if: github.event_name == 'pull_request' | ||
with: | ||
tool_name: JuliaFormatter | ||
fail_on_error: true |
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.