This repository has been archived by the owner on Mar 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 101
Feature: Annotation Lint Checks #188
Open
jreehuis
wants to merge
16
commits into
GCX-HCI:master
Choose a base branch
from
jreehuis:feature/annotation_lint_checks
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
…ust used through base implementations
…eter count and return type
…ations in non TiView interfaces
… TiView child interface
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.