Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Prevent lint changes being a breaking change #1193

Merged
merged 3 commits into from
Jul 24, 2015

Conversation

alexcrichton
Copy link
Member

Add a new flag to the compiler, --cap-lints, which set the maximum possible
lint level for the entire crate (and cannot be overridden). Cargo will then pass
--cap-lints allow to all upstream dependencies when compiling code.

Fixes #1029.

Rendered

Add a new flag to the compiler, `--cap-lints`, which set the maximum possible
lint level for the entire crate (and cannot be overridden). Cargo will then pass
`--cap-lints allow` to all upstream dependencies when compiling code.
@alexcrichton alexcrichton added the T-dev-tools Relevant to the development tools team, which will review and decide on the RFC. label Jul 8, 2015
@alexcrichton
Copy link
Member Author

cc @carllerche, @nikomatsakis

# Drawbacks

This RFC adds surface area to the command line of the compiler with a relatively
obscure option `--cap-lints`. The option will almost never be passed by anything
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could hide it away in e.g. -Z to keep it from polluting --help.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do currently kinda have this already, the --help --verbose page is a little longer than --help. I'd also prefer to continue to consider -Z as "unstable flags", aka flags that Cargo should avoid.

@nikomatsakis
Copy link
Contributor

Big 👍 from me.

@nrc
Copy link
Member

nrc commented Jul 8, 2015

+1 from me.

```

For example when `--cap-lints allow` is passed, all instances of `#[warn]`,
`#[deny]`, and `#[forbid] are ignored. If, however `--cap-lints warn` is passed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(`#[forbid] needs a closing backtick)

@pcwalton
Copy link
Contributor

After being bit hard by deny(missing_docs) Armageddon, I think this is a must-have.

@jroesch
Copy link
Member

jroesch commented Jul 16, 2015

👍 Alex!

@alexcrichton
Copy link
Member Author

The tools team has decided to place this RFC in its final comment period.

@alexcrichton alexcrichton added the final-comment-period Will be merged/postponed/closed in ~10 calendar days unless new substational objections are raised. label Jul 16, 2015
brson added a commit to brson/rust that referenced this pull request Jul 20, 2015
This reverts commit 00130cf.

As mentioned in a regression report[1], this caused a notable amount
of breakage.  Because there's a plan to mitigate[2] this type of
breakage, I'm reverting this until then.

[1]: https://internals.rust-lang.org/t/new-crater-reports-1-1-stable-vs-beta-2015-07-10-and-nightly-2015-07-10/2358
[2]: rust-lang/rfcs#1193
bors added a commit to rust-lang/rust that referenced this pull request Jul 21, 2015
This reverts commit 00130cf.

As mentioned in a regression report[1], this caused a notable amount
of breakage. Because there's a plan to mitigate[2] this type of
breakage, I'm reverting this until then.

[1]: https://internals.rust-lang.org/t/new-crater-reports-1-1-stable-vs-beta-2015-07-10-and-nightly-2015-07-10/2358
[2]: rust-lang/rfcs#1193
@alexcrichton
Copy link
Member Author

The consensus of the tools team is to merge this RFC, so I'm going to do so!

Tracking issue

@alexcrichton alexcrichton merged commit ba2f1fe into rust-lang:master Jul 24, 2015
@alexcrichton alexcrichton deleted the cap-lints branch July 24, 2015 16:07
@alexcrichton alexcrichton restored the cap-lints branch July 24, 2015 16:07
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jul 29, 2015
This commit is an implementation of [RFC 1193][rfc] which adds the ability to
the compiler to cap the lint level for the entire compilation session. This flag
will ensure that no lints will go above this level, and Cargo will primarily use
this flag passing `--cap-lints allow` to all upstream dependencies.

[rfc]: rust-lang/rfcs#1193

Closes rust-lang#27259
bors added a commit to rust-lang/rust that referenced this pull request Jul 29, 2015
This commit is an implementation of [RFC 1193][rfc] which adds the ability to
the compiler to cap the lint level for the entire compilation session. This flag
will ensure that no lints will go above this level, and Cargo will primarily use
this flag passing `--cap-lints allow` to all upstream dependencies.

[rfc]: rust-lang/rfcs#1193

Closes #27259
@Centril Centril added A-lint Proposals relating to lints / warnings / clippy. A-stability Proposals relating to policy and changes about stability of features. labels Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Proposals relating to lints / warnings / clippy. A-stability Proposals relating to policy and changes about stability of features. final-comment-period Will be merged/postponed/closed in ~10 calendar days unless new substational objections are raised. T-dev-tools Relevant to the development tools team, which will review and decide on the RFC.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants