Add shellcheck_toolchain rule - #48
Conversation
|
It'd also be awesome if you could cut a release after this PR 🙏 |
|
@aignas friendly ping here 🙏 |
aignas
left a comment
There was a problem hiding this comment.
Thank you for all of the contributions.
| alias( | ||
| name = "shellcheck", | ||
| actual = "shellcheck.exe", | ||
| ) | ||
|
|
||
| alias( | ||
| name = "{name}", | ||
| actual = "shellcheck.exe", | ||
| ) | ||
|
|
||
| shellcheck_toolchain( | ||
| name = "toolchain", | ||
| shellcheck = ":shellcheck", | ||
| ) |
There was a problem hiding this comment.
nit it would be nice to have a single macro here. That we if we update the macro implementation (e.g. change the alias), then we don't need to refetch everything.
There was a problem hiding this comment.
I'm not sure what you mean by "single macro". Can you expand?
There was a problem hiding this comment.
Having a macro defined somewhere in the ruleset that takes care of the differences between windows and linux via select statements. That way we would have a single template for both cases. For example we have this whl_library_targets.bzl in rules_python that has the macro that contains all of the logic for how the targets get constructed and the whl_library BUILD.bazel file just loads and calls that macro.
There was a problem hiding this comment.
I'm not sure I understand the direction still. Are you suggesting the rendered BUILD file contain a wrapper macro call instead of shellcheck_toolchain directly? Or something else? I'm happy to make changes around this code, I just fail to understand the direction you'd like me to go 😅
There was a problem hiding this comment.
Yes having a wrapper macro to create all of the targets was what I had in mind.
|
@aignas friendly ping here 🙏 |
|
@aignas any more changes you'd like to see? I'm eager to have this available in the Bazel Central Registry 😅 |
This allows for users to provide custom shellcheck binaries to power the shellcheck rules.
Additionally, this adds support for
.shellcheckrcfiles via--@rules_shellcheck//shellcheck:rc=<label_of_file>closes #24