Skip to content

Add lint output to lint list #8947

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

Merged
merged 1 commit into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ rustc_tools_util = { version = "0.2", path = "rustc_tools_util" }
[features]
deny-warnings = ["clippy_lints/deny-warnings"]
integration = ["tempfile"]
internal = ["clippy_lints/internal"]
internal = ["clippy_lints/internal", "tempfile"]

[package.metadata.rust-analyzer]
# This package uses #[feature(rustc_private)]
Expand Down
4 changes: 3 additions & 1 deletion clippy_lints/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ edition = "2021"

[dependencies]
cargo_metadata = "0.14"
clippy_dev = { path = "../clippy_dev", optional = true }
Copy link
Member

Choose a reason for hiding this comment

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

Just noticed during the sync: depending on clippy_dev feels really wrong. clippy_dev isn't intended to be used as a library, but a standalone binary for clippy dev tools. Nothing should depend on clippy_dev IMO.

Copy link
Member

Choose a reason for hiding this comment

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

Ups yeah your right, slipped under my radar😅

clippy_utils = { path = "../clippy_utils" }
if_chain = "1.0"
itertools = "0.10.1"
Expand All @@ -18,6 +19,7 @@ quine-mc_cluskey = "0.2"
regex-syntax = "0.6"
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", optional = true }
tempfile = { version = "3.3.0", optional = true }
toml = "0.5"
unicode-normalization = "0.1"
unicode-script = { version = "0.5", default-features = false }
Expand All @@ -30,7 +32,7 @@ url = { version = "2.2", features = ["serde"] }
[features]
deny-warnings = ["clippy_utils/deny-warnings"]
# build clippy with internal lints enabled, off by default
internal = ["clippy_utils/internal", "serde_json"]
internal = ["clippy_utils/internal", "serde_json", "tempfile", "clippy_dev"]

[package.metadata.rust-analyzer]
# This crate uses #[feature(rustc_private)]
Expand Down
12 changes: 6 additions & 6 deletions clippy_lints/src/collapsible_if.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ declare_clippy_lint! {
/// makes code look more complex than it really is.
///
/// ### Example
/// ```rust,ignore
/// ```rust
/// # let (x, y) = (true, true);
/// if x {
/// if y {
/// …
/// //
/// }
/// }
///
/// ```
///
/// Use instead:
///
/// ```rust,ignore
/// ```rust
/// # let (x, y) = (true, true);
/// if x && y {
/// …
/// //
/// }
/// ```
#[clippy::version = "pre 1.29.0"]
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ declare_clippy_lint! {
/// if the `fn main()` is left implicit.
///
/// ### Examples
/// ``````rust
/// ```rust
/// /// An example of a doctest with a `main()` function
/// ///
/// /// # Examples
Expand All @@ -191,7 +191,7 @@ declare_clippy_lint! {
/// fn needless_main() {
/// unimplemented!();
/// }
/// ``````
/// ```
#[clippy::version = "1.40.0"]
pub NEEDLESS_DOCTEST_MAIN,
style,
Expand Down
3 changes: 2 additions & 1 deletion clippy_lints/src/large_include_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ declare_clippy_lint! {
/// let included_bytes = include_bytes!("very_large_file.txt");
/// ```
///
/// Instead, you can load the file at runtime:
/// Use instead:
/// ```rust,ignore
/// use std::fs;
///
/// // You can load the file at runtime
/// let string = fs::read_to_string("very_large_file.txt")?;
/// let bytes = fs::read("very_large_file.txt")?;
/// ```
Expand Down
1 change: 1 addition & 0 deletions clippy_lints/src/literal_representation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ declare_clippy_lint! {
/// - Does not match on `_127` since that is a valid grouping for decimal and octal numbers
///
/// ### Example
/// ```ignore
/// `2_32` => `2_i32`
/// `250_8 => `250_u8`
/// ```
Expand Down
1 change: 1 addition & 0 deletions clippy_lints/src/methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,7 @@ declare_clippy_lint! {
///
/// // Good
/// _.split('x');
/// ```
#[clippy::version = "pre 1.29.0"]
pub SINGLE_CHAR_PATTERN,
perf,
Expand Down
Loading