Skip to content

Commit

Permalink
Add formatting (#16)
Browse files Browse the repository at this point in the history
Co-authored-by: Uwe Hernandez Acosta <u.hernandez@hzdr.de>
  • Loading branch information
szabo137 and Uwe Hernandez Acosta authored Jun 19, 2024
1 parent 1e1ad93 commit 51cea6d
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .formatting/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[deps]
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
12 changes: 12 additions & 0 deletions .formatting/format_all.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using JuliaFormatter

# we assume the format_all.jl script is located in QEDevents.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)
7 changes: 0 additions & 7 deletions .github/dependabot.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/formatter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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.9
- 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

9 changes: 2 additions & 7 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ makedocs(;
edit_link="main",
assets=String[],
),
pages=[
"Home" => "index.md",
],
pages=["Home" => "index.md"],
)

deploydocs(;
repo="github.com/QEDjl-project/QEDcore.jl",
devbranch="main",
)
deploydocs(; repo="github.com/QEDjl-project/QEDcore.jl", devbranch="main")

0 comments on commit 51cea6d

Please sign in to comment.