Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

Feature: Annotation Lint Checks #188

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

jreehuis
Copy link

Description

Annotations in Java can be restricted to some languages types like Method or Class. 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:

  • Add a return type to fun showText(text: String) in the SampleView of the sample app
  • Add @DistinctUntilChanged and a return type to fun showText(text: String) in the SampleView of the sample app
  • Add @DistinctUntilChanged remove all parameters from fun showText(text: String) in the SampleView of the sample app
  • Add @DistinctUntilChanged to any method in an arbitary class which is not an interface
  • Add @CallOnMainThread to any method in an arbitary class which is not an interface
  • Add @DistinctUntilChanged to any method in an arbitary class which does not extends TiView
  • Add @CallOnMainThread to any method in an arbitary class which does not extends TiView
  • Use TI v0.10.0-SNAPSHOT of this branch in another project where the cases above might be existing or produce them

Note: 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

None yet

1 participant