rust-lang / rust-lang/rust-clippy

Restriction Lint: Crate License

Open
#3,867 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-lint T-cargo
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing cargo metadata lints, which the issue identifies as the closest implementation reference. Define how clippy.toml whitelist and blacklist settings should be interpreted and how crate license metadata is checked; done should include the new lint and coverage for accepted and restricted licenses.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.