Butterknife: How to add rule to checkstyle to suppress visibility warning in XML for Butterknife?

Created on 25 Jul 2016  路  3Comments  路  Source: JakeWharton/butterknife

Is there rule that we can add to Checkstyle config to suppress visibility warning for ButterKnife and not in Java, cause if we add it to a class, it'll suppress eveything not just ButterKnife fields.

Most helpful comment

Just for future reference, in case someone ended up here from Google, in my case it worked only using the short annotation name:

<module name="VisibilityModifier">
    <property name="ignoreAnnotationCanonicalNames" value="BindView"/>
</module>

All 3 comments

nvm found it, please label it as question, but would be good to also add this to the docs / reference

        <module name="VisibilityModifier">
            <property name="ignoreAnnotationCanonicalNames"
                      value="butterknife.Bind, butterknife.OnClick, ......"/>
        </module> 

Checkstyle isn't a standard tool in Android and I don't want to be responsible for maintaining configurations for a bunch of different tools that I am not using personally. Hopefully this issue serves for those who are Googling a solution in the future.

Just for future reference, in case someone ended up here from Google, in my case it worked only using the short annotation name:

<module name="VisibilityModifier">
    <property name="ignoreAnnotationCanonicalNames" value="BindView"/>
</module>
Was this page helpful?
0 / 5 - 0 ratings