Skip to content

Commit

Permalink
Refactor how CI action exits
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Mar 1, 2021
1 parent bd1ea28 commit 5c45dec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/format_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ jobs:
using Pkg
Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.2"))
using JuliaFormatter
ret = format("src", verbose=true)
ret = ret && format("test", verbose=true)
exit(ret ? 0 : 1)
format("src", verbose=true)
format("test", verbose=true)
out = String(read(Cmd(`git diff --name-only`)))
if isempty(out)
exit(0)
end
@error "Some files have not been formatted !!!"
write(stdout, out)
exit(1)
11 changes: 4 additions & 7 deletions src/parse_nlp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ function _parse_NL_expr(m, x, tapevar, parent, values)
push!(
block.args,
:(
$lookupcode; push!(
$lookupcode;
push!(
$tapevar,
NodeData(CALLUNIVAR, operatorid, $parent),
)
Expand Down Expand Up @@ -194,12 +195,8 @@ function _parse_NL_expr(m, x, tapevar, parent, values)
end
push!(
block.args,
:(
$lookupcode; push!(
$tapevar,
NodeData(CALL, operatorid, $parent),
)
),
:($lookupcode;
push!($tapevar, NodeData(CALL, operatorid, $parent))),
)
end
parentvar = gensym()
Expand Down

0 comments on commit 5c45dec

Please sign in to comment.