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

tracking issue for clippy::foo lint names #2955

Closed
oli-obk opened this issue Jul 24, 2018 · 2 comments
Closed

tracking issue for clippy::foo lint names #2955

oli-obk opened this issue Jul 24, 2018 · 2 comments
Assignees
Labels
C-tracking-issue Category: Tracking Issue
Milestone

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Jul 24, 2018

No description provided.

@oli-obk oli-obk added this to the 1.0 milestone Jul 24, 2018
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Aug 1, 2018
Make the tool_lints actually usable

cc rust-lang#44690

Necessary for rust-lang/rust-clippy#2955 and rust-lang/rust-clippy#2977

This PR makes it possible for lint tools (at the moment only for Clippy) to implement the `tool_lints`, like it was documented in rust-lang#52018.

Because the `declare_lint` macro is pretty cluttered right now, there was not really a good way to add the `tool_name` as an additional argument of the macro. That's why I chose to introduce the new `declare_tool_lint` macro.

The switch from `&str` to `String` in the `lint_groups` `FxHashMap` is because I got weird error messages in the `check_lint_name` method. And the `by_name` field of the `LintStore` also uses `String`.

### What comes with this PR:

If this PR lands and Clippy switches to the `tool_lints`, the currently used methods
```rust
#[cfg_attr(feature = "cargo-clippy", allow(clippy_lint))]
#[allow(unknown_lints, clippy_lint)]
```
to `allow`/`warn`/`deny`/`forbid` Clippy lints, won't have any effects anymore, but also won't produce a warning. That is because the name of `clippy_lint` will then be `clippy::clippy_lint`. (Maybe we can add a clippy lint to search for `cfg_attr` appearances with the `cargo-clippy` feature?)

r? @oli-obk
pietroalbini added a commit to pietroalbini/rust that referenced this issue Aug 1, 2018
Make the tool_lints actually usable

cc rust-lang#44690

Necessary for rust-lang/rust-clippy#2955 and rust-lang/rust-clippy#2977

This PR makes it possible for lint tools (at the moment only for Clippy) to implement the `tool_lints`, like it was documented in rust-lang#52018.

Because the `declare_lint` macro is pretty cluttered right now, there was not really a good way to add the `tool_name` as an additional argument of the macro. That's why I chose to introduce the new `declare_tool_lint` macro.

The switch from `&str` to `String` in the `lint_groups` `FxHashMap` is because I got weird error messages in the `check_lint_name` method. And the `by_name` field of the `LintStore` also uses `String`.

### What comes with this PR:

If this PR lands and Clippy switches to the `tool_lints`, the currently used methods
```rust
#[cfg_attr(feature = "cargo-clippy", allow(clippy_lint))]
#[allow(unknown_lints, clippy_lint)]
```
to `allow`/`warn`/`deny`/`forbid` Clippy lints, won't have any effects anymore, but also won't produce a warning. That is because the name of `clippy_lint` will then be `clippy::clippy_lint`. (Maybe we can add a clippy lint to search for `cfg_attr` appearances with the `cargo-clippy` feature?)

r? @oli-obk
@flip1995
Copy link
Member

flip1995 commented Aug 1, 2018

  • Lint for occurrences of #[cfg_attr(feature="cargo-clippy", ...)
  • Implement an unknown_clippy_lints lint

@phansch
Copy link
Member

phansch commented Dec 11, 2018

Both are stable now, so I'm going to close this 🎇

@phansch phansch closed this as completed Dec 11, 2018
@phansch phansch added the C-tracking-issue Category: Tracking Issue label Dec 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: Tracking Issue
Projects
None yet
Development

No branches or pull requests

3 participants