Skip to content

Commit b4ac42d

Browse files
authored
Add AGENTS.md (#5996)
1 parent 32aafb1 commit b4ac42d

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Java Code Style Requirements
2+
3+
These rules apply to all Java code written or modified in this repository.
4+
5+
## Nullability
6+
7+
- Annotate every class with JetBrains Annotations `@NotNullByDefault`.
8+
- Any type, field, parameter, return value, local variable, or generic type argument that may be `null` must be explicitly annotated with `@Nullable`.
9+
- Nullability must never be implicit.
10+
11+
## Immutability
12+
13+
- Immutable arrays and collections must be explicitly annotated with JetBrains Annotations `@Unmodifiable` or `@UnmodifiableView` as appropriate.
14+
- For arrays, use type-use syntax such as `String @Unmodifiable []`.
15+
16+
## Documentation
17+
18+
- Every class, field, and method must have documentation.
19+
- Documentation must use `///` Markdown-style Javadoc comments.
20+
- Keep documentation accurate and specific to the actual behavior, constraints, and side effects.
21+
- Add concise implementation comments inside complex logic whenever they materially improve readability or explain non-obvious behavior.
22+
23+
## Gradle
24+
25+
- When invoking Gradle in this repository, always set `GRADLE_USER_HOME` to the workspace-local `.gradle-user-home` directory.
26+
- Prefer commands such as `./gradlew -g .gradle-user-home ...` or the equivalent environment-variable-based configuration.
27+
- When running Gradle `test` tasks, use a higher timeout of ten minutes.

0 commit comments

Comments
 (0)