codeowners_register()
should take a filepath
parameter that defaults to .github/CODEOWNERS
(or another one of the valid GitHub CODEOWNERS paths). This will be consumed at build time.
In an ideal world, we'd be able to bazel build ...
, and the codeowners()
rules would be picked up and compiled into a file that's output to filepath
. Unfortunately, we can't do that. What we can do is provide a target that is runnable and does the same work; we'd only need to provide the name
-- this would be similar to other rules such as bazelbuild/bazel-gazelle
and bazelbuild/buildtools
, and would be invoked as such:
$ cat BUILD.bazel
load("@rules_codeowners//:foo.bzl", "generate_codeowners")
generate_codeowners(name = "codeowners")
$ bazel run //:codeowners
This would parse all of the codeowners()
rules and create the generated file at the specified output path (from codeowners_register()
, above).
I think following the pattern of established tool integrations like bazel-gazelle
and buildifier
(via buildtools
) is a great way forward.
Depends-On: #25
Sourced from: #13 (comment)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too