Skip to content

Add flag to indicate only @NullMarked code should be checked#1117

Merged
msridhar merged 6 commits intomasterfrom
only-marked-code-flag-2024-12-25
Dec 26, 2024
Merged

Add flag to indicate only @NullMarked code should be checked#1117
msridhar merged 6 commits intomasterfrom
only-marked-code-flag-2024-12-25

Conversation

@msridhar
Copy link
Copy Markdown
Collaborator

@msridhar msridhar commented Dec 25, 2024

Fixes #574

We add a new flag OnlyNullMarked to indicate that NullAway can only check code that is @NullMarked, and hence it is ok to omit the (previously required) AnnotatedPackages flag. We currently require exactly one of either AnnotatedPackages or OnlyNullMarked to be passed in; if both flags are omitted or both flags are passed, we fail.

As JSpecify and @NullMarked become more widely adopted, we may change the policy to allow neither flag to be passed (as NullAway already checks @NullMarked code out of the box). But for now, we require one of the flags to be passed, to avoid confusion.

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.17%. Comparing base (6d331c7) to head (210c4ad).
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1117      +/-   ##
============================================
+ Coverage     88.14%   88.17%   +0.03%     
- Complexity     2234     2238       +4     
============================================
  Files            85       85              
  Lines          7237     7239       +2     
  Branches       1439     1439              
============================================
+ Hits           6379     6383       +4     
+ Misses          431      430       -1     
+ Partials        427      426       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@msridhar msridhar merged commit 43054bb into master Dec 26, 2024
@msridhar msridhar deleted the only-marked-code-flag-2024-12-25 branch December 26, 2024 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSpecify and annotated packages option

2 participants