Skip to content

Commit

Permalink
Add guidance for usage of description tags (e.g. [tag], #tag).
Browse files Browse the repository at this point in the history
- Define what "tags" means in this context
- Note that usage of tags is optional
- Recommend that usage of tags is kept limited on the first line, in order to avoid obscuring the content

PiperOrigin-RevId: 530335206
  • Loading branch information
code-health-devguide-copybara authored and copybara-github committed May 8, 2023
1 parent 537567e commit 36833b7
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions review/developer/cl-descriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,53 @@ The first sentence describes what's actually being done. The rest of the
description explains *why* the change is being made and gives the reviewer a lot
of context.

## Using tags {#tags}

Tags are manually entered labels that can be used to categorize CLs. These may
be supported by tools or just used by team convention.

For example:

- "[tag]"
- "[a longer tag]"
- "#tag"
- "tag:"

Using tags is optional.

When adding tags, consider whether they should be in the [body](#informative) of
the CL description or the [first line](#firstline). Limit the usage of tags in
the first line, as this can obscure the content.

Examples with and without tags:

``` {.good}
// Tags are okay in the first line if kept short.
[banana] Peel the banana before eating.
// Tags can be inlined in content.
Peel the #banana before eating.
// Tags are optional.
Peel the banana before eating.
// Multiple tags are acceptable if kept short.
#banana #apple: Assemble a fruit basket.
// Tags can go anywhere in the CL description.
> Assemble a fruit basket.
>
> #banana #apple
```

``` {.bad}
// Too many tags (or tags that are too long) overwhelm the first line.
//
// Instead, consider whether the tags can be moved into the description body
// and/or shortened.
[banana peeler factory factory][apple picking service] Assemble a fruit basket.
```

## Generated CL descriptions

Some CLs are generated by tools. Whenever possible, their descriptions should
Expand Down

0 comments on commit 36833b7

Please sign in to comment.