Skip to content

Commit f22b4d5

Browse files
authored
Code review rules: remove constant naming rule (#16490)
1 parent 0e5b5b8 commit f22b4d5

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

.github/agents/knowledge/general-rules.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,19 @@ Only flag substantive problems, not stylistic preference.
5555

5656
Read and apply `docs/contributing/style-guide.md`.
5757

58-
Exceptions:
58+
Do not flag the following patterns (common false positives):
5959

6060
- FQCN is acceptable when class-name collision makes import impossible.
61-
- `@SuppressWarnings` at method level is preferred over class level for tighter scope, but
61+
62+
## [Style] `@SuppressWarnings` Usage
63+
64+
- Method-level `@SuppressWarnings` is preferred over class-level for tighter scope, but
6265
if more than one method in the class needs the same suppression, class-level is fine.
6366
Do not flag class-level `@SuppressWarnings` when multiple methods use the suppressed API.
6467
- **Do not add `@SuppressWarnings("deprecation")` unless the build fails without it.**
6568
The project disables javac's `-Xlint:deprecation` globally and uses a custom Error Prone
6669
check (`OtelDeprecatedApiUsage`) instead. Only add the annotation when it is actually
6770
required to fix an Error Prone error — not speculatively.
68-
- Per Google Java Style, `UPPER_CASE` naming is only for true constants (deeply immutable
69-
values). `static final` fields holding mutable objects should be `camelCase`.
7071

7172
## [Naming] Getter Naming
7273

0 commit comments

Comments
 (0)