-
Notifications
You must be signed in to change notification settings - Fork 0
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 #11 from ProjectTorreyPines/format
Adds a format check using a configuration file and a GitHub Action to check format on push and PR with master and dev branches. The configuration file `.JuliaFormatter.toml` and the github workflow file `.github/workflows/format_check.yml` can be copied as it is to any other GitHub repo to recreate the same functionality.
- Loading branch information
Showing
6 changed files
with
209 additions
and
102 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,27 @@ | ||
align_assignment = true | ||
align_conditional = true | ||
align_matrix = true | ||
align_pair_arrow = true | ||
align_struct_field = true | ||
always_for_in = true | ||
always_use_return = true | ||
annotate_untyped_fields_with_any = false | ||
conditional_to_if = true | ||
for_in_replacement = "∈" | ||
format_docstrings = true | ||
import_to_using = true | ||
indent = 4 | ||
indent_submodule = true | ||
join_lines_based_on_source = true | ||
long_to_short_function_def = true | ||
margin = 88 | ||
normalize_line_endings = "unix" | ||
pipe_to_function_call = true | ||
remove_extra_newlines = true | ||
separate_kwargs_with_semicolon = true | ||
surround_whereop_typeparameters = true | ||
trailing_comma = true | ||
whitespace_in_kwargs = false | ||
whitespace_ops_in_indices = false | ||
whitespace_typedefs = true | ||
yas_style_nesting = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Format Check | ||
|
||
on: | ||
push: | ||
branches: ["master", "dev", "format"] | ||
pull_request: | ||
branches: ["master", "dev"] | ||
jobs: | ||
check: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
julia-version: [1.9.3] | ||
julia-arch: [x86] | ||
os: [ubuntu-latest] | ||
steps: | ||
- uses: julia-actions/setup-julia@latest | ||
with: | ||
version: ${{ matrix.julia-version }} | ||
|
||
- uses: actions/checkout@v1 | ||
- name: Install JuliaFormatter and format | ||
run: | | ||
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))' | ||
julia -e 'using JuliaFormatter; format(".", verbose=true)' | ||
- name: Format check | ||
run: | | ||
julia -e ' | ||
out = Cmd(`git diff --name-only`) |> read |> String | ||
if out == "" | ||
exit(0) | ||
else | ||
@error "Some files have not been formatted !!!" | ||
write(stdout, out) | ||
exit(1) | ||
end' |
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,2 +1,5 @@ | ||
# GGDUtils | ||
|
||
![Format Check](https://github.com/ProjectTorreyPines/GGDUtils.jl/actions/workflows/format_check.yml/badge.svg) | ||
|
||
Package holding utilities for Generalized Grid Description (GGD) objects in IMAS datastructure. Primary goals are interpolation and core profile extrapolation. |
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.