Skip to content

disallowed_methods should allow for reasons in the toml file #7609

Closed
@Manishearth

Description

@Manishearth

We currently have the disallowed_methods (added in #6081) which allows for a clippy.toml config of disallowed-methods = ["foo", "bar::baz"], etc.

It would be nice if the config also allowed for reasons, something like:

disallowed-methods = [
    {path = "foo::bar", reason = "we don't like this"},
    "bar::baz" # no reason given
]

so that the warning can output the reason when it comes across this methods

See https://twitter.com/nokusu/status/1432339032705544193, https://twitter.com/fasterthanlime/status/1432333612251238402

This shouldn't be hard to implement, happy to mentor!

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions