mirror of
https://github.com/MillironX/SequenceVariation.jl.git
synced 2024-11-22 05:19:55 +00:00
Add linting workflow for PRs
This commit is contained in:
parent
d29764d2bc
commit
8ae09aa9a1
1 changed files with 29 additions and 0 deletions
29
.github/workflows/linting.yml
vendored
Normal file
29
.github/workflows/linting.yml
vendored
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
name: Code format checker
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: JuliaFormatter
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: julia-actions/setup-julia@v1
|
||||||
|
with:
|
||||||
|
version: "1"
|
||||||
|
- run: |
|
||||||
|
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
|
||||||
|
julia -e 'using JuliaFormatter; format(".", verbose=true)'
|
||||||
|
- 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'
|
Loading…
Reference in a new issue