Skip to content

Lint check for private fields #779

@remcomokveld

Description

@remcomokveld

When using kotlin-codegen the annotation processor will crash if a JsonClass annotated class, or any of super classes, contains a private non-transient field.

With #728 it became possible to only enable the processor for certain compilation targets. The disadvantage of this is that a debug build might succeed while a release build fails.

To get earlier feedback on this during development it would be nice to have a lint check with quick-fixes to either mark a field as transient, or make it more accessible.

I created a gist here with the lint check and a test
https://gist.github.com/remcomokveld/a96a245cc21f3976b5c56b27b7384767

This would need an additional AAR artifact which contains just the lint jar, so not sure if it is feasible

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions