Skip to content

Commit

Permalink
Use ctx.actions.run instead of run_shell
Browse files Browse the repository at this point in the history
  • Loading branch information
tokongs committed Oct 17, 2023
1 parent a7f3ed5 commit 81fce5d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lint/ruff.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ def ruff_action(ctx, executable, srcs, config, report, use_exit_code = False):
args = ctx.actions.args()
args.add("check")
args.add(config, format = "--config=%s")
args.add(report, format = "--ouput-file=%s")
if not use_exit_code:
args.add("--exit-zero")

args.add_all(srcs)

ctx.actions.run_shell(
ctx.actions.run(
inputs = inputs,
outputs = outputs,
tools = [executable],
command = "%s $@ > %s" % (executable.path, report.path),
executable = executable,
arguments = [args],
mnemonic = "ruff",
)
Expand Down Expand Up @@ -94,4 +94,3 @@ def ruff_aspect(binary, config):
),
},
)

0 comments on commit 81fce5d

Please sign in to comment.