README_DOCS.md

November 22, 2023 ยท View on GitHub

codeowners

codeowners(name, pattern, patterns, team, teams)

A codeowners-rule represents one or many rows in a CODEOWNERS file.

team and teams are mutually exclusive. pattern and patterns are mutually exclusive.

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
patternA pattern of files (eg: '*.bzl') that the team(s) should get ownership of. In the generated CODEOWNERS, the path to this target will be prepended to the pattern.Stringoptional""
patternsA list of patterns, one row will be printed per pattern. See docs of pattern for more info.List of stringsoptional[]
teamThe GitHub team that should get ownership of the matching files. One of team and teams must be set.Stringoptional""
teamsA list of the GitHub teams that should get ownership of the matching files. One of team and teams must be set.List of stringsoptional[]

generate_codeowners

generate_codeowners(name, generated_comment, owners, validate)

Creates a GitHub-compatible CODEOWNERS file based on the owners.

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
generated_commentA comment to insert at the top of the generated fileStringoptional"# This file was generated by rules_codeowners / Bazel. Don't edit it directly"
ownersA list of codeowners and generate_codeowners. One generate_codeowners can include another generate_codeowners to achieve nested rules.List of labelsrequired
validateSet to True to enable strict validation of codeowners values. Disabled by default.BooleanoptionalFalse