You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
746 B
29 lines
746 B
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)
|
|
format("benchmark", 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)
|