-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added formatting and respective workflow (#18)
* added formatting and respective workflow * added info in readme * updated .JuliaFormatter.toml --------- Co-authored-by: Uwe Hernandez Acosta <u.hernandez@hzdr.de>
- Loading branch information
Showing
12 changed files
with
320 additions
and
278 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,5 +1,5 @@ | ||
# See https://domluna.github.io/JuliaFormatter.jl/stable/ for a list of options | ||
style = "blue" | ||
indent = 4 | ||
indent = 2 | ||
margin = 92 | ||
normalize_line_endings = "unix" |
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 @@ | ||
[deps] | ||
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" |
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,12 @@ | ||
using JuliaFormatter | ||
|
||
# we asume the format_all.jl script is located in QEDbase.jl/.formatting | ||
project_path = Base.Filesystem.joinpath(Base.Filesystem.dirname(Base.source_path()), "..") | ||
|
||
not_formatted = format(project_path; verbose=true) | ||
if not_formatted | ||
@info "Formatting verified." | ||
else | ||
@warn "Formatting verification failed: Some files are not properly formatted!" | ||
end | ||
exit(not_formatted ? 0 : 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: formatter | ||
on: [pull_request] | ||
jobs: | ||
formatter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v4 | ||
- name: install Julia | ||
uses: julia-actions/setup-julia@v1 | ||
with: | ||
version: "1.10" | ||
- name: Install Julia requirements | ||
run: julia --project=${GITHUB_WORKSPACE}/.formatting -e 'import Pkg; Pkg.instantiate()' | ||
- name: Check code style | ||
run: julia --project=${GITHUB_WORKSPACE}/.formatting ${GITHUB_WORKSPACE}/.formatting/format_all.jl |
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.