-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add comment in CODEOWNERS about how to update it
Depends on zegl/rules_codeowners#27
- Loading branch information
Showing
4 changed files
with
39 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
diff tools/codeowners.bzl tools/codeowners.bzl | ||
index e6387a3..93a8cdd 100644 | ||
--- tools/codeowners.bzl | ||
+++ tools/codeowners.bzl | ||
@@ -98,8 +98,7 @@ skip_empty_rows () { | ||
grep -v -E '^$' | ||
} | ||
|
||
-echo "# This file was generated by rules_codeowners / Bazel" >> "$OUTFILE" | ||
-echo "# Don't edit it directly" >> "$OUTFILE" | ||
+echo "_GENERATED_COMMENT_" >> "$OUTFILE" | ||
echo "" >> "$OUTFILE" | ||
|
||
while [ "$#" -gt 0 ]; do | ||
@@ -113,7 +112,7 @@ while [ "$#" -gt 0 ]; do | ||
skip_empty_rows | \ | ||
prevent_malicios_input "$must_have_prefix" >> "$OUTFILE" | ||
done | ||
- """, | ||
+ """.replace("_GENERATED_COMMENT_", ctx.attr.generated_comment), | ||
) | ||
|
||
generate_codeowners = rule( | ||
@@ -122,6 +121,7 @@ generate_codeowners = rule( | ||
Creates a GitHub-compatible CODEOWNERS file based on the `owners`. | ||
""", | ||
attrs = { | ||
+ "generated_comment": attr.string(default = "# This file was generated by rules_codeowners / Bazel\n# Don't edit it directly"), | ||
"owners": attr.label_list(mandatory = True, doc = "A list of codeowners and generate_codeowners. One generate_codeowners can include another generate_codeonwers to effective acheive nested rules."), | ||
}, | ||
outputs = { |