-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add spell check and format check workflows (#17)
* add permissions for cache deletion * add format check workflow * add spell check * fix typo * apply formatter * Update .github/workflows/FormatCheck.yml * apply formatter --------- Co-authored-by: Andrew Winters <[email protected]> Co-authored-by: Michael Schlottke-Lakemper <[email protected]>
- Loading branch information
1 parent
cd51eff
commit 6bb65dd
Showing
7 changed files
with
79 additions
and
22 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,41 @@ | ||
name: format-check | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: '*' | ||
pull_request: | ||
|
||
jobs: | ||
check-format: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
julia-version: [1] | ||
julia-arch: [x86] | ||
os: [ubuntu-latest] | ||
steps: | ||
- uses: julia-actions/setup-julia@latest | ||
with: | ||
version: ${{ matrix.julia-version }} | ||
|
||
- uses: actions/checkout@v4 | ||
- 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(".")' | ||
- 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Spell Check | ||
|
||
on: [pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
typos-check: | ||
name: Spell Check with Typos | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Actions Repository | ||
uses: actions/checkout@v4 | ||
- name: Check spelling | ||
uses: crate-ci/[email protected] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,23 @@ | ||
using TrixiShallowWater | ||
using Documenter | ||
|
||
DocMeta.setdocmeta!(TrixiShallowWater, :DocTestSetup, :(using TrixiShallowWater); recursive=true) | ||
DocMeta.setdocmeta!(TrixiShallowWater, :DocTestSetup, :(using TrixiShallowWater); | ||
recursive = true) | ||
|
||
makedocs(; | ||
modules=[TrixiShallowWater], | ||
authors="Andrew R. Winters <[email protected]>, Michael Schlottke-Lakemper <[email protected]>", | ||
repo="https://github.com/trixi-framework/TrixiShallowWater.jl/blob/{commit}{path}#{line}", | ||
sitename="TrixiShallowWater.jl", | ||
format=Documenter.HTML(; | ||
prettyurls=get(ENV, "CI", "false") == "true", | ||
canonical="https://trixi-framework.github.io/TrixiShallowWater.jl", | ||
edit_link="main", | ||
assets=String[], | ||
), | ||
pages=[ | ||
"Home" => "index.md", | ||
], | ||
) | ||
modules = [TrixiShallowWater], | ||
authors = "Andrew R. Winters <[email protected]>, Michael Schlottke-Lakemper <[email protected]>", | ||
repo = "https://github.com/trixi-framework/TrixiShallowWater.jl/blob/{commit}{path}#{line}", | ||
sitename = "TrixiShallowWater.jl", | ||
format = Documenter.HTML(; | ||
prettyurls = get(ENV, "CI", "false") == "true", | ||
canonical = "https://trixi-framework.github.io/TrixiShallowWater.jl", | ||
edit_link = "main", | ||
assets = String[],), | ||
pages = [ | ||
"Home" => "index.md", | ||
],) | ||
|
||
deploydocs(; | ||
repo="github.com/trixi-framework/TrixiShallowWater.jl", | ||
devbranch="main", | ||
) | ||
repo = "github.com/trixi-framework/TrixiShallowWater.jl", | ||
devbranch = "main",) |
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