Skip to content

Commit

Permalink
Add lint output to lint list
Browse files Browse the repository at this point in the history
  • Loading branch information
Serial-ATA committed Jun 7, 2022
1 parent 542d474 commit fdadebe
Show file tree
Hide file tree
Showing 10 changed files with 247 additions and 32 deletions.
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 }
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

0 comments on commit fdadebe

Please sign in to comment.