这是indexloc提供的服务,不要输入任何密码
Skip to content

Lint check for Glide.with(view) #5507

@nikclayton

Description

@nikclayton

Hi,

Reading #898 it seems like (in many cases) Glide.with(view) is a potential foot-gun, and it would be better to use with passing an activity or fragment.

I've done this refactoring in my own project over in pachli/pachli-android#1519, and as part of that I wrote a Lint detection rule to flag these.

I thought you might want to take this and bundle it as an (ignorable) lint check in Glide (details on publishing custom lint rules in a library project at https://github.com/googlesamples/android-custom-lint-rules).

The relevant parts of that PR are:

You can also copy the entire lint machinery from https://github.com/nikclayton/pachli-android/tree/glide-cleanup/checks and delete the files not relevant to the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions