预提交:运行一个一次只接受一个文件名的代码检查工具。

huangapple go评论61阅读模式
英文:

precommit: running a linter that only takes one filename at a time

问题

我们有一个通过 xqlint lint target_file 运行的代码检查工具,但似乎不支持多个文件名。

在 precommit 中是否有一种方法可以针对每个文件分别运行,而不需要使用以下方式:

entry: bash -c "for $f in $@; do xqlint lint $f; done"

(虽然这种方式有效,但不太美观且不太可移植。)

英文:

We have a linter that runs with xqlint lint target_file but doesn't seem to support multiple filenames.

Is there a way in precommit to run against each file separately, without resorting to

entry: bash -c "for $f in $@; do xqlint lint $f; done"

(which seems to work but is ugly and less portable.)

答案1

得分: 1

没有故意的。反复启动和停止进程是低效和浪费资源的。该工具应该可以自动适应接受多个位置参数。

免责声明:我编写了pre-commit。

英文:

there is intentionally not. starting and stopping processes repeatedly is slow and wasteful. the tool should adjust to take multiple positional arguments

__

disclaimer: I wrote pre-commit

huangapple
  • 本文由 发表于 2023年8月11日 00:33:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76877690.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定