Skip to content

Restriction Lint: Crate License #3867

@mehcode

Description

@mehcode

After seeing the new-ish cargo metadata lints, I was thinking it would interesting to have a lint like:

crate_license
Check the license information in the crate metadata and restrict to something.

I imagine a whitelist/blacklist of licenses would be what most want.

# in clippy.toml
blacklisted-licenses = ["MIT"]
whitelisted-licenses = ["MPL"]

This seems fairly straightforward to implement after reading some of the source for the cargo lints. If we want to do this I'd love to try to implement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsT-cargoType: cargo related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions