-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to provided jsr305 and nullability improvements #69
Conversation
This takes a feather out of Square's recent blog post and brings back the jsr305 dependency as a provided dependency. Benefits are static analysis and kotlin code still can leverage this. Main functional differences are annotating a `package-info` with `@ParametersAreNonnullByDefault` annotation and switching to javax' `@Nullable` annotation instead of RxJava's.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a minor nit
@@ -45,7 +45,8 @@ def kotlin = [ | |||
] | |||
|
|||
def misc = [ | |||
errorProneAnnotations: "com.google.errorprone:error_prone_annotations:${versions.errorProne}" | |||
errorProneAnnotations: "com.google.errorprone:error_prone_annotations:${versions.errorProne}", | |||
jsr305: 'com.google.code.findbugs:jsr305:3.0.2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you be more specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add spaces after the jsr305 to match the width till the :
on the previous line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This project doesn't follow that pattern since it often damages git history
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alright ignore that then :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This is a followup to #69, and improves it in two main ways: - This adds it to subpackages as well, which I missed in the first pass. - Switches to a custom `PackageNonNull` annotation instead, which expands the checks to also include return types, fields, local vars, etc. It's pretty broad right now but we could reduce scope if need be. This is pulled into a separate artifact for re-use, but still only applied as compileOnly.
* More nullability annotation work This is a followup to #69, and improves it in two main ways: - This adds it to subpackages as well, which I missed in the first pass. - Switches to a custom `PackageNonNull` annotation instead, which expands the checks to also include return types, fields, local vars, etc. It's pretty broad right now but we could reduce scope if need be. This is pulled into a separate artifact for re-use, but still only applied as compileOnly. * Clean up qualifiers * Tweak name * Don't export artifact Not necessary, we'll make this a separate project later * CLASS retention instead of runtime
This takes inspiration from Square's recent blog post and brings back the jsr305 dependency as a provided dependency. Benefits are static analysis and kotlin code still can leverage this.
Main functional differences are annotating a
package-info
with@ParametersAreNonnullByDefault
annotation and switching to javax'@Nullable
annotation instead of RxJava's.Thank you for contributing to AutoDispose. Before pressing the "Create Pull Request" button, please consider the following points:
Prior reading: