Add Contract annotation to nullaway-annotations by codingkiddo · Pull Request #1569 · uber/NullAway (original) (raw)
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info ⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 211b6f0e-fe16-4047-8bad-bf7595d58c41
📥 Commits
Reviewing files that changed from the base of the PR and between 3fd1d2e and bdfca04.
📒 Files selected for processing (1)
nullaway/src/test/java/com/uber/nullaway/ContractsTests.java
Walkthrough
Adds a new annotation type com.uber.nullaway.annotations.Contract with @Documented, CLASS retention, and targets METHOD and CONSTRUCTOR. The annotation exposes a required String value() element for contract clauses and includes Javadoc describing the contract-string grammar and an example. Also adds a JUnit test nullAwayContractAnnotation that configures NullAway to recognize the annotation and verifies behavior at a call site invoking a method annotated with @Contract.
Possibly related PRs
- uber/NullAway#1295: Adds and tests a com.uber.nullaway.annotations.Contract annotation and related contract handling.
- uber/NullAway#1346: Extends ContractsTests usage of
@com.uber.nullaway.annotations.Contractto exercise contract-based nullness behaviors. - uber/NullAway#1447: Adds contract-related tests and updates ContractHandler logic for interpreting contract clauses.
Suggested reviewers
- msridhar
- yuxincs 🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately and concisely describes the main change: adding a Contract annotation to the nullaway-annotations artifact. |
| Linked Issues check | ✅ Passed | The PR fulfills issue #1543 by adding an official @Contract annotation to the nullaway-annotations artifact with proper documentation and test coverage. |
| Out of Scope Changes check | ✅ Passed | All changes are scoped to implementing the @Contract annotation and its test; no unrelated modifications are present. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches 🧪 Generate unit tests (beta)
- Create PR with unit tests
Tip
💬 Introducing Slack Agent: The best way for teams to turn conversations into code.
Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
- Generate code and open pull requests
- Plan features and break down work
- Investigate incidents and troubleshoot customer tickets together
- Automate recurring tasks and respond to alerts with triggers
- Summarize progress and report instantly
Built for teams:
- Shared memory across your entire org—no repeating context
- Per-thread sandboxes to safely plan and execute work
- Governance built-in—scoped access, auditability, and budget controls
One agent for your entire SDLC. Right inside Slack.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment @coderabbitai help to get the list of available commands and usage tips.