mozilla-mobile / gradle-apilint

Gradle Plugin that tracks the API of an Android library and helps maintain backward compatibility.
Mozilla Public License 2.0
8 stars 9 forks source link

Closes #31: Add lint for fields-only classes. #32

Closed agi90 closed 5 years ago

agi90 commented 5 years ago

This adds a lint to make sure that classes that only contain final fields have a protected or public constructor in the API so that external clients can mock these classes. It also checks that these classes are not final for test subclassing.

snorp commented 5 years ago

I'm ok with this, but it seems like it may be a little specific to our use case. Maybe it would be better suited as a rule in some other linter?

agi90 commented 5 years ago

I'm ok with this, but it seems like it may be a little specific to our use case. Maybe it would be better suited as a rule in some other linter?

Right now none of the lints actually stop you from updating the api file and ignoring them so I think it's fine to merge this as is. As discussed on slack, in the future we'll be able to select which lints run so that should ease your concern, opened Issue #34 for this.