Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Walkthrough
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
msridhar
left a comment
There was a problem hiding this comment.
Thanks for the contribution! Please see comments below and remove all license headers within tests.
| return helper.addSourceLines( | ||
| "Util.java", | ||
| """ | ||
| /* |
There was a problem hiding this comment.
Can we align the top-level source lines with the opening and closing """ delimiters?
| * Copyright (c) 2017 Uber Technologies, Inc. | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| * of this software and associated documentation files (the "Software"), to deal | ||
| * in the Software without restriction, including without limitation the rights | ||
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| * copies of the Software, and to permit persons to whom the Software is | ||
| * furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in | ||
| * all copies or substantial portions of the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| * THE SOFTWARE. | ||
| */ | ||
|
|
There was a problem hiding this comment.
Let's get rid of the license header here; a license header on the top-level source file should suffice
| .addSourceLines( | ||
| "CheckFieldInitPositiveCases.java", | ||
| """ | ||
| /* |
There was a problem hiding this comment.
Same comment about source header
…rkTests (#1695) ## Summary - Replace the nine `addSourceFile` calls for annotation stubs in `FrameworkTests` (four Spring Boot mock annotations, four Mockito annotations, `InjectWireMock`) with inline `addSourceLines` text blocks. - Delete the nine now-unreferenced testdata files. - Factor the repeated `java.lang.annotation` imports and `@Target`/`@Retention` boilerplate into class constants, since the nine stubs otherwise only differ by package and by which of three `@Target` styles and one annotation declaration they use. The class-level `@SuppressWarnings("deprecation")` is retained: eight other `addSourceFile` calls remain in this file (Lombok, native models/androidstubs, Rx, stream support), so the annotation is still load-bearing — removing it causes a `-Werror` build failure on those remaining calls. I verified this by temporarily deleting it and recompiling. No overlap with #1694, which is scoped to `InitializationTests.java` and its testdata files. Part of #1425. ## Testing - `./gradlew :nullaway:test --tests "com.uber.nullaway.FrameworkTests"` - `./gradlew :nullaway:test` (full module suite: 911 tests, 0 failures) - Verified each converted stub is load-bearing (not shadowed by a real dependency on the test classpath) by temporarily corrupting its package/`@Target` and confirming the corresponding test fails to compile or fails its assertions, then restoring it. ## AI usage disclosure > I used Claude Code for this PR. The first commit — converting the nine `addSourceFile` calls to inline `addSourceLines` text blocks and deleting the now-unreferenced testdata files — was a mechanical, one-shot conversion. I reviewed that diff, then noticed significant duplication across the inlined text blocks (repeated imports and `@Target`/`@Retention` lines) and directed Claude to factor that boilerplate into shared constants, which became the second commit. I personally reviewed and understood both commits before pushing. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Tests** - Updated framework validation tests to generate Spring Boot, Mockito, and WireMock annotation fixtures during test execution. - Removed redundant test-only annotation source files while preserving coverage for supported annotation scenarios. - Consolidated shared fixture definitions to improve consistency across framework integration tests. - **Chores** - Simplified test resources and reduced maintenance overhead for annotation-based test fixtures. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
Addressed all review feedback in 0b68eaf: removed the embedded license headers, aligned the shared source text block, and updated the line-sensitive diagnostic expectations. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1694 +/- ##
=========================================
Coverage 87.89% 87.89%
Complexity 3173 3173
=========================================
Files 109 109
Lines 10755 10755
Branches 2173 2173
=========================================
Hits 9453 9453
Misses 617 617
Partials 685 685 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
addSourceFilecalls inInitializationTestswith inlineaddSourceLinestext blocksUtil.javasource into a helper, as requested in the issue discussionPart of #1425.
Testing
./gradlew :nullaway:spotlessJavaApply -Pspotless.ratchet.from=HEAD./gradlew :nullaway:test --tests "com.uber.nullaway.InitializationTests"AI usage disclosure
Summary by CodeRabbit