-
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.
Formatted with config file and adding format check
* Added format file .JuliaFormatter * Added GitHub Action for format checking * Formatted the code with the file above and some hand tweaks on comments
- Loading branch information
1 parent
fe8c6c1
commit 7f73bc7
Showing
4 changed files
with
552 additions
and
284 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' |
Oops, something went wrong.