Add OnlyNullMarked option and support RequireExplicitNullMarking checker#77
Open
hczedik wants to merge 6 commits intoerroraway:masterfrom
Open
Add OnlyNullMarked option and support RequireExplicitNullMarking checker#77hczedik wants to merge 6 commits intoerroraway:masterfrom
hczedik wants to merge 6 commits intoerroraway:masterfrom
Conversation
Version 1.21.0.505 silently ignores the <requiredForLanguages> configuration, resulting in a missing Plugin-RequiredForLanguages manifest entry. This caused the scanner to skip downloading the plugin when not all plugins are fetched (the default behavior).
The previous findRepository implementation used a switch statement that only matched "NullAway" literally, plus heuristics for Slf4j (prefix) and Picnic (URL in message). Any other plugin checker fell through to the default "errorprone" repository, causing its issues to be silently dropped. This broke the RequireExplicitNullMarking checker (added in NullAway 0.12.15) which belongs to the "nullaway" repository but was mapped to "errorprone", so its issues were never saved. Replace with a static lookup map built from ServiceLoader-registered plugin checkers, which correctly maps all checkers to their repository.
createIssuesForRuleRepository() has replacement semantics, so calling it in a loop left only the last repository registered, preventing the sensor from executing for most rule repositories.
Add a boolean OnlyNullMarked configuration option so NullAway only checks code within @NullMarked scope. When enabled, package-scope options (AnnotatedPackages, UnannotatedSubPackages) are skipped. Support dual-key property reading: server-side key (e.g. nullaway.only.null.marked) and sonar.*-prefixed analysis parameter key (sonar.nullaway.only.null.marked), since the scanner only forwards sonar.* properties from build tools. Enable the RequireExplicitNullMarking checker (SUGGESTION severity) to produce diagnostics by overriding it to WARN level, which avoids a classloader issue with ErrorProne's auto-fix patch generation.
- Corrected JDK requirement (17+, not 11+) - Added SonarQube 26.x to compatibility - New Configuration section explaining both server-side and build-tool keys (with sonar. prefix) - Full table of all NullAway options including the new only.null.marked - Full table of all ErrorAway options - Concise error message example - Fixed the "SonarQybe" typo
Author
|
Hi @gtoison, thank you for your work on this plugin! I hope you are open to contributions like this! Hermann (from Austria) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrade to NullAway version 0.12.15 which supports RequireExplicitNullMarking checker.
Add a boolean OnlyNullMarked configuration option so NullAway only
checks code within @NullMarked scope. When enabled, package-scope
options (AnnotatedPackages, UnannotatedSubPackages) are skipped.
Support dual-key property reading: server-side key (e.g.
nullaway.only.null.marked) and sonar.-prefixed analysis parameter key
(sonar.nullaway.only.null.marked), since the scanner only forwards
sonar. properties from build tools.
Enable the RequireExplicitNullMarking checker (SUGGESTION severity) to
produce diagnostics by overriding it to WARN level, which avoids a
classloader issue with ErrorProne's auto-fix patch generation.