This repository has been archived by the owner on Mar 16, 2021. It is now read-only.
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.
Description
Annotations in Java can be restricted to some languages types like
Method
orClass
. In ThirtyInch some of our annotations so are allowed but are useless and will not trigger the job for what they are intended.This PR will bring Lint Checks will warn the dev about those cases right at the annotation usage.
How to Test
Play with the following scenarios:
fun showText(text: String)
in theSampleView
of the sample app@DistinctUntilChanged
and a return type tofun showText(text: String)
in theSampleView
of the sample app@DistinctUntilChanged
remove all parameters fromfun showText(text: String)
in theSampleView
of the sample app@DistinctUntilChanged
to any method in an arbitary class which is not an interface@CallOnMainThread
to any method in an arbitary class which is not an interface@DistinctUntilChanged
to any method in an arbitary class which does not extendsTiView
@CallOnMainThread
to any method in an arbitary class which does not extendsTiView
0.10.0-SNAPSHOT
of this branch in another project where the cases above might be existing or produce themNote: Always do a rebuild if you do a change in the Sample Project as it might has to be recompiled to pick the lint checks up.
Merge Information
This PR builds on top of #187 so please do not merge this after #187 .
It will also ease the PR review a lot.
Note
Testing Lint Checks in the Sample Project did not work reliably for me. This seems to be an Android Studio Issue as quite often an
Invalidate Caches and Restart
help.A commandline lint run were reporting the errors reliably.