Skip to content

Commit

Permalink
Add JuliaFormatter.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanaelbosch committed Dec 23, 2023
1 parent 95ee05b commit 5c408b2
Show file tree
Hide file tree
Showing 6 changed files with 203 additions and 154 deletions.
1 change: 1 addition & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# See https://domluna.github.io/JuliaFormatter.jl/stable/ for a list of options
style = "sciml"
42 changes: 42 additions & 0 deletions .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: FormatCheck

on:
push:
branches:
- 'main'
- 'release-'
tags: '*'
pull_request:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1]
julia-arch: [x64]
os: [ubuntu-latest]
steps:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}

- uses: actions/checkout@v1
- name: Install JuliaFormatter and format
# This will use the latest version by default but you can set the version like so:
#
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
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'
36 changes: 18 additions & 18 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
using ChaoticDynamicalSystemLibrary
using Documenter

DocMeta.setdocmeta!(ChaoticDynamicalSystemLibrary, :DocTestSetup, :(using ChaoticDynamicalSystemLibrary); recursive=true)
DocMeta.setdocmeta!(ChaoticDynamicalSystemLibrary,
:DocTestSetup,
:(using ChaoticDynamicalSystemLibrary);
recursive = true)

makedocs(;
modules=[ChaoticDynamicalSystemLibrary],
authors="Nathanael Bosch <[email protected]> and contributors",
repo="https://github.com/nathanaelbosch/ChaoticDynamicalSystemLibrary.jl/blob/{commit}{path}#{line}",
sitename="ChaoticDynamicalSystemLibrary.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://nathanaelbosch.github.io/ChaoticDynamicalSystemLibrary.jl",
edit_link="main",
assets=String[],
size_threshold_ignore = ["index.md"],
),
pages=[
modules = [ChaoticDynamicalSystemLibrary],
authors = "Nathanael Bosch <[email protected]> and contributors",
repo = "https://github.com/nathanaelbosch/ChaoticDynamicalSystemLibrary.jl/blob/{commit}{path}#{line}",
sitename = "ChaoticDynamicalSystemLibrary.jl",
format = Documenter.HTML(;
prettyurls = get(ENV, "CI", "false") == "true",
canonical = "https://nathanaelbosch.github.io/ChaoticDynamicalSystemLibrary.jl",
edit_link = "main",
assets = String[],
size_threshold_ignore = ["index.md"],),
pages = [
"Home" => "index.md",
],
)
],)

deploydocs(;
repo="github.com/nathanaelbosch/ChaoticDynamicalSystemLibrary.jl",
devbranch="main",
)
repo = "github.com/nathanaelbosch/ChaoticDynamicalSystemLibrary.jl",
devbranch = "main",)
2 changes: 0 additions & 2 deletions src/ChaoticDynamicalSystemLibrary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ using LinearAlgebra
using SciMLBase
using ComponentArrays


function dict_with_string_keys_to_symbol_keys(d::Dict)
new_d = Dict()
for (k, v) in d
Expand All @@ -18,7 +17,6 @@ function dict_to_componentarray(d::Dict)
return ComponentArray(dict_with_string_keys_to_symbol_keys(d))
end


function make_docstring(f)
data = ATTRACTOR_DATA[string(f)]
header = """
Expand Down
Loading

0 comments on commit 5c408b2

Please sign in to comment.