mirror of
https://github.com/ANL-CEEESA/RELOG.git
synced 2025-12-05 23:38:52 -06:00
Reformat source code; set up lint GH Action
This commit is contained in:
27
.github/workflows/lint.yml
vendored
Normal file
27
.github/workflows/lint.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
name: Lint
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: julia-actions/setup-julia@latest
|
||||
with:
|
||||
version: '1'
|
||||
- uses: actions/checkout@v1
|
||||
- name: Format check
|
||||
shell: julia --color=yes {0}
|
||||
run: |
|
||||
using Pkg
|
||||
Pkg.add(PackageSpec(name="JuliaFormatter", version="0.14.4"))
|
||||
using JuliaFormatter
|
||||
format("src", verbose=true)
|
||||
format("test", verbose=true)
|
||||
out = String(read(Cmd(`git diff`)))
|
||||
if isempty(out)
|
||||
exit(0)
|
||||
end
|
||||
@error "Some files have not been formatted !!!"
|
||||
write(stdout, out)
|
||||
exit(1)
|
||||
Reference in New Issue
Block a user