From ebe5c46948818b62b04d60461fa975c87fdd5ef3 Mon Sep 17 00:00:00 2001 From: "Shahar \"Dawn\" Or" Date: Sun, 17 Aug 2025 02:02:20 +0700 Subject: [PATCH] chore: bump flake inputs --- bin/Cargo.toml | 2 +- bin/src/config.rs | 8 ++++---- bin/src/dirs.rs | 2 +- bin/src/fix.rs | 4 ++-- bin/src/fix/all.rs | 6 +++--- bin/src/fix/single.rs | 2 +- bin/src/lint.rs | 4 ++-- bin/src/main.rs | 4 ++-- bin/src/utils.rs | 2 +- flake-parts/ci.nix | 6 ++++-- flake.lock | 24 ++++++++++++------------ lib/Cargo.toml | 4 ++-- lib/src/lib.rs | 4 ++-- lib/src/lints/bool_comparison.rs | 4 ++-- lib/src/lints/bool_simplification.rs | 4 ++-- lib/src/lints/collapsible_let_in.rs | 4 ++-- lib/src/lints/deprecated_to_path.rs | 6 +++--- lib/src/lints/empty_inherit.rs | 4 ++-- lib/src/lints/empty_let_in.rs | 4 ++-- lib/src/lints/empty_list_concat.rs | 4 ++-- lib/src/lints/empty_pattern.rs | 4 ++-- lib/src/lints/eta_reduction.rs | 4 ++-- lib/src/lints/legacy_let_syntax.rs | 4 ++-- lib/src/lints/manual_inherit.rs | 4 ++-- lib/src/lints/manual_inherit_from.rs | 4 ++-- lib/src/lints/redundant_pattern_bind.rs | 4 ++-- lib/src/lints/repeated_keys.rs | 8 +++++--- lib/src/lints/unquoted_splice.rs | 4 ++-- lib/src/lints/unquoted_uri.rs | 4 ++-- lib/src/lints/useless_has_attr.rs | 4 ++-- lib/src/lints/useless_parens.rs | 4 ++-- lib/src/make.rs | 2 +- macros/src/lib.rs | 4 ++-- macros/src/metadata.rs | 2 +- 34 files changed, 81 insertions(+), 77 deletions(-) diff --git a/bin/Cargo.toml b/bin/Cargo.toml index bfe198e..fba12b8 100644 --- a/bin/Cargo.toml +++ b/bin/Cargo.toml @@ -22,7 +22,7 @@ lib.workspace = true rayon.workspace = true rnix.workspace = true serde.workspace = true -serde_json = { workspace = true, optional = true } +serde_json = { optional = true, workspace = true } similar.workspace = true thiserror.workspace = true toml.workspace = true diff --git a/bin/src/config.rs b/bin/src/config.rs index e14623f..a10e239 100644 --- a/bin/src/config.rs +++ b/bin/src/config.rs @@ -5,10 +5,10 @@ use std::{ str::FromStr, }; -use crate::{dirs, err::ConfigErr, utils, LintMap}; +use crate::{LintMap, dirs, err::ConfigErr, utils}; use clap::Parser; -use lib::{session::Version, LINTS}; +use lib::{LINTS, session::Version}; use serde::{Deserialize, Serialize}; use vfs::ReadOnlyVfs; @@ -282,7 +282,7 @@ impl ConfFile { }; if statix_toml_path.exists() { return Self::from_path(statix_toml_path); - }; + } } Ok(Self::default()) } @@ -362,7 +362,7 @@ fn vfs(files: &[PathBuf]) -> vfs::ReadOnlyVfs { vfs.set_file_contents(file, data.as_bytes()); } else { println!("`{}` contains non-utf8 content", file.display()); - }; + } } vfs } diff --git a/bin/src/dirs.rs b/bin/src/dirs.rs index f5e746c..bccc555 100644 --- a/bin/src/dirs.rs +++ b/bin/src/dirs.rs @@ -7,8 +7,8 @@ use std::{ use crate::dirs; use ignore::{ - gitignore::{Gitignore, GitignoreBuilder}, Error as IgnoreError, Match, + gitignore::{Gitignore, GitignoreBuilder}, }; #[derive(Debug)] diff --git a/bin/src/fix.rs b/bin/src/fix.rs index 227b3d6..6c18523 100644 --- a/bin/src/fix.rs +++ b/bin/src/fix.rs @@ -90,7 +90,7 @@ pub mod main { std::fs::write(path, &*fix_result.src).map_err(FixErr::InvalidPath)?; } _ => (), - }; + } } Ok(()) } @@ -138,7 +138,7 @@ pub mod main { std::fs::write(path, &*single_result.src).map_err(FixErr::InvalidPath)?; } (_, Err(e)) => return Err(e.into()), - }; + } Ok(()) } } diff --git a/bin/src/fix/all.rs b/bin/src/fix/all.rs index f3e3a49..14e3da1 100644 --- a/bin/src/fix/all.rs +++ b/bin/src/fix/all.rs @@ -1,11 +1,11 @@ use std::borrow::Cow; -use lib::{session::SessionInfo, Report}; -use rnix::{parser::ParseError as RnixParseErr, WalkEvent}; +use lib::{Report, session::SessionInfo}; +use rnix::{WalkEvent, parser::ParseError as RnixParseErr}; use crate::{ - fix::{FixResult, Fixed}, LintMap, + fix::{FixResult, Fixed}, }; fn collect_fixes( diff --git a/bin/src/fix/single.rs b/bin/src/fix/single.rs index 8e73a9e..ed4d10f 100644 --- a/bin/src/fix/single.rs +++ b/bin/src/fix/single.rs @@ -1,6 +1,6 @@ use std::{borrow::Cow, convert::TryFrom}; -use lib::{session::SessionInfo, Report}; +use lib::{Report, session::SessionInfo}; use rnix::{TextSize, WalkEvent}; use crate::{err::SingleFixErr, fix::Source, utils}; diff --git a/bin/src/lint.rs b/bin/src/lint.rs index 4f9e90c..34f4bae 100644 --- a/bin/src/lint.rs +++ b/bin/src/lint.rs @@ -1,6 +1,6 @@ -use crate::{utils, LintMap}; +use crate::{LintMap, utils}; -use lib::{session::SessionInfo, Report}; +use lib::{Report, session::SessionInfo}; use rnix::WalkEvent; use vfs::{FileId, VfsEntry}; diff --git a/bin/src/main.rs b/bin/src/main.rs index bf0e549..782f9b1 100644 --- a/bin/src/main.rs +++ b/bin/src/main.rs @@ -7,7 +7,7 @@ use statix::{ lint, fix, explain, dump, list, }; -fn _main() -> Result<(), StatixErr> { +fn main_() -> Result<(), StatixErr> { let opts = Opts::parse(); match opts.cmd { SubCommand::Check(config) => lint::main::main(&config), @@ -20,7 +20,7 @@ fn _main() -> Result<(), StatixErr> { } fn main() { - if let Err(e) = _main() { + if let Err(e) = main_() { eprintln!("{e}"); } } diff --git a/bin/src/utils.rs b/bin/src/utils.rs index d453813..4c5296a 100644 --- a/bin/src/utils.rs +++ b/bin/src/utils.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use lib::{Lint, LINTS}; +use lib::{LINTS, Lint}; use rnix::SyntaxKind; #[allow(clippy::borrowed_box)] diff --git a/flake-parts/ci.nix b/flake-parts/ci.nix index 4b47e31..998467b 100644 --- a/flake-parts/ci.nix +++ b/flake-parts/ci.nix @@ -52,7 +52,8 @@ in jobs = { ${ids.jobs.getCheckNames} = { runs-on = runner.name; - outputs.${ids.outputs.jobs.getCheckNames} = "\${{ steps.${ids.steps.getCheckNames}.outputs.${ids.outputs.steps.getCheckNames} }}"; + outputs.${ids.outputs.jobs.getCheckNames} = + "\${{ steps.${ids.steps.getCheckNames}.outputs.${ids.outputs.steps.getCheckNames} }}"; steps = [ steps.checkout steps.cachixInstallNix @@ -69,7 +70,8 @@ in ${ids.jobs.check} = { needs = ids.jobs.getCheckNames; runs-on = runner.name; - strategy.matrix.${matrixParam} = "\${{ fromJson(needs.${ids.jobs.getCheckNames}.outputs.${ids.outputs.jobs.getCheckNames}) }}"; + strategy.matrix.${matrixParam} = + "\${{ fromJson(needs.${ids.jobs.getCheckNames}.outputs.${ids.outputs.jobs.getCheckNames}) }}"; steps = [ steps.checkout steps.cachixInstallNix diff --git a/flake.lock b/flake.lock index f495041..e5af741 100644 --- a/flake.lock +++ b/flake.lock @@ -8,11 +8,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1731738660, - "narHash": "sha256-tIXhc9lX1b030v812yVJanSR37OnpTb/OY5rU3TbShA=", + "lastModified": 1755326578, + "narHash": "sha256-rSJDBT+4DFEieHY4ljTzUmAjYcdSNAvonxYoW4eN9sY=", "owner": "nix-community", "repo": "fenix", - "rev": "e10ba121773f754a30d31b6163919a3e404a434f", + "rev": "69397a3079106e7b40ee892f9a96ffac1abb08ff", "type": "github" }, "original": { @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1751413152, - "narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=", + "lastModified": 1754487366, + "narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "77826244401ea9de6e3bac47c2db46005e1f30b5", + "rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18", "type": "github" }, "original": { @@ -43,11 +43,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1731890469, - "narHash": "sha256-D1FNZ70NmQEwNxpSSdTXCSklBH1z2isPR84J6DQrJGs=", + "lastModified": 1755268003, + "narHash": "sha256-nNaeJjo861wFR0tjHDyCnHs1rbRtrMgxAKMoig9Sj/w=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5083ec887760adfe12af64830a66807423a859a7", + "rev": "32f313e49e42f715491e1ea7b306a87c16fe0388", "type": "github" }, "original": { @@ -68,11 +68,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1731693936, - "narHash": "sha256-uHUUS1WPyW6ohp5Bt3dAZczUlQ22vOn7YZF8vaPKIEw=", + "lastModified": 1755004716, + "narHash": "sha256-TbhPR5Fqw5LjAeI3/FOPhNNFQCF3cieKCJWWupeZmiA=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "1b90e979aeee8d1db7fe14603a00834052505497", + "rev": "b2a58b8c6eff3c3a2c8b5c70dbf69ead78284194", "type": "github" }, "original": { diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 65fd486..b6ae5fc 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -12,8 +12,8 @@ lazy_static.workspace = true macros.workspace = true rnix.workspace = true rowan.workspace = true -serde = { workspace = true, optional = true } -serde_json = { workspace = true, optional = true } +serde = { optional = true, workspace = true } +serde_json = { optional = true, workspace = true } [features] default = [] diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 45c17ea..3157c5c 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -7,13 +7,13 @@ mod utils; pub use lints::LINTS; use session::SessionInfo; -use rnix::{parser::ParseError, SyntaxElement, SyntaxKind, TextRange}; +use rnix::{SyntaxElement, SyntaxKind, TextRange, parser::ParseError}; use std::{convert::Into, default::Default}; #[cfg(feature = "json-out")] use serde::{ - ser::{SerializeStruct, Serializer}, Serialize, + ser::{SerializeStruct, Serializer}, }; #[derive(Debug, Default)] diff --git a/lib/src/lints/bool_comparison.rs b/lib/src/lints/bool_comparison.rs index 246fb30..17a856c 100644 --- a/lib/src/lints/bool_comparison.rs +++ b/lib/src/lints/bool_comparison.rs @@ -1,10 +1,10 @@ -use crate::{make, session::SessionInfo, Metadata, Report, Rule, Suggestion}; +use crate::{Metadata, Report, Rule, Suggestion, make, session::SessionInfo}; use if_chain::if_chain; use macros::lint; use rnix::{ - types::{BinOp, BinOpKind, Ident, TokenWrapper, TypedNode}, NodeOrToken, SyntaxElement, SyntaxKind, SyntaxNode, + types::{BinOp, BinOpKind, Ident, TokenWrapper, TypedNode}, }; /// ## What it does diff --git a/lib/src/lints/bool_simplification.rs b/lib/src/lints/bool_simplification.rs index a5582ab..7ef3502 100644 --- a/lib/src/lints/bool_simplification.rs +++ b/lib/src/lints/bool_simplification.rs @@ -1,10 +1,10 @@ -use crate::{make, session::SessionInfo, Metadata, Report, Rule, Suggestion}; +use crate::{Metadata, Report, Rule, Suggestion, make, session::SessionInfo}; use if_chain::if_chain; use macros::lint; use rnix::{ - types::{BinOp, BinOpKind, Paren, TypedNode, UnaryOp, UnaryOpKind, Wrapper}, NodeOrToken, SyntaxElement, SyntaxKind, + types::{BinOp, BinOpKind, Paren, TypedNode, UnaryOp, UnaryOpKind, Wrapper}, }; /// ## What it does diff --git a/lib/src/lints/collapsible_let_in.rs b/lib/src/lints/collapsible_let_in.rs index 1c04d9c..9cc9f30 100644 --- a/lib/src/lints/collapsible_let_in.rs +++ b/lib/src/lints/collapsible_let_in.rs @@ -1,10 +1,10 @@ -use crate::{make, session::SessionInfo, Metadata, Report, Rule, Suggestion}; +use crate::{Metadata, Report, Rule, Suggestion, make, session::SessionInfo}; use if_chain::if_chain; use macros::lint; use rnix::{ - types::{LetIn, TypedNode}, NodeOrToken, SyntaxElement, SyntaxKind, TextRange, + types::{LetIn, TypedNode}, }; use rowan::Direction; diff --git a/lib/src/lints/deprecated_to_path.rs b/lib/src/lints/deprecated_to_path.rs index 98a077c..7b37f1e 100644 --- a/lib/src/lints/deprecated_to_path.rs +++ b/lib/src/lints/deprecated_to_path.rs @@ -1,10 +1,10 @@ -use crate::{session::SessionInfo, Metadata, Report, Rule}; +use crate::{Metadata, Report, Rule, session::SessionInfo}; use if_chain::if_chain; use macros::lint; use rnix::{ - types::{Apply, TypedNode}, NodeOrToken, SyntaxElement, SyntaxKind, + types::{Apply, TypedNode}, }; /// ## What it does @@ -46,7 +46,7 @@ impl Rule for DeprecatedIsNull { if let NodeOrToken::Node(node) = node; if let Some(apply) = Apply::cast(node.clone()); let lambda_path = apply.lambda()?.to_string(); - if ALLOWED_PATHS.iter().any(|&p| p == lambda_path.as_str()); + if ALLOWED_PATHS.contains(&lambda_path.as_str()); then { let at = node.text_range(); let message = format!("`{lambda_path}` is deprecated, see `:doc builtins.toPath` within the REPL for more"); diff --git a/lib/src/lints/empty_inherit.rs b/lib/src/lints/empty_inherit.rs index 871c218..48f17fc 100644 --- a/lib/src/lints/empty_inherit.rs +++ b/lib/src/lints/empty_inherit.rs @@ -1,10 +1,10 @@ -use crate::{make, session::SessionInfo, utils, Metadata, Report, Rule, Suggestion}; +use crate::{Metadata, Report, Rule, Suggestion, make, session::SessionInfo, utils}; use if_chain::if_chain; use macros::lint; use rnix::{ - types::{Inherit, TypedNode}, NodeOrToken, SyntaxElement, SyntaxKind, + types::{Inherit, TypedNode}, }; /// ## What it does diff --git a/lib/src/lints/empty_let_in.rs b/lib/src/lints/empty_let_in.rs index 0714ac0..460e369 100644 --- a/lib/src/lints/empty_let_in.rs +++ b/lib/src/lints/empty_let_in.rs @@ -1,10 +1,10 @@ -use crate::{session::SessionInfo, Metadata, Report, Rule, Suggestion}; +use crate::{Metadata, Report, Rule, Suggestion, session::SessionInfo}; use if_chain::if_chain; use macros::lint; use rnix::{ - types::{EntryHolder, LetIn, TypedNode}, NodeOrToken, SyntaxElement, SyntaxKind, + types::{EntryHolder, LetIn, TypedNode}, }; /// ## What it does diff --git a/lib/src/lints/empty_list_concat.rs b/lib/src/lints/empty_list_concat.rs index 34148cb..3ff7e40 100644 --- a/lib/src/lints/empty_list_concat.rs +++ b/lib/src/lints/empty_list_concat.rs @@ -1,10 +1,10 @@ -use crate::{session::SessionInfo, Metadata, Report, Rule, Suggestion}; +use crate::{Metadata, Report, Rule, Suggestion, session::SessionInfo}; use if_chain::if_chain; use macros::lint; use rnix::{ - types::{BinOp, BinOpKind, List, TypedNode}, NodeOrToken, SyntaxElement, SyntaxKind, SyntaxNode, + types::{BinOp, BinOpKind, List, TypedNode}, }; /// ## What it does diff --git a/lib/src/lints/empty_pattern.rs b/lib/src/lints/empty_pattern.rs index 163528b..6d54e4a 100644 --- a/lib/src/lints/empty_pattern.rs +++ b/lib/src/lints/empty_pattern.rs @@ -1,10 +1,10 @@ -use crate::{make, session::SessionInfo, Metadata, Report, Rule, Suggestion}; +use crate::{Metadata, Report, Rule, Suggestion, make, session::SessionInfo}; use if_chain::if_chain; use macros::lint; use rnix::{ - types::{AttrSet, EntryHolder, Lambda, Pattern, TypedNode}, NodeOrToken, SyntaxElement, SyntaxKind, SyntaxNode, + types::{AttrSet, EntryHolder, Lambda, Pattern, TypedNode}, }; /// ## What it does diff --git a/lib/src/lints/eta_reduction.rs b/lib/src/lints/eta_reduction.rs index b6767b9..7a12126 100644 --- a/lib/src/lints/eta_reduction.rs +++ b/lib/src/lints/eta_reduction.rs @@ -1,10 +1,10 @@ -use crate::{session::SessionInfo, Metadata, Report, Rule, Suggestion}; +use crate::{Metadata, Report, Rule, Suggestion, session::SessionInfo}; use if_chain::if_chain; use macros::lint; use rnix::{ - types::{Apply, Ident, Lambda, TokenWrapper, TypedNode}, NodeOrToken, SyntaxElement, SyntaxKind, SyntaxNode, + types::{Apply, Ident, Lambda, TokenWrapper, TypedNode}, }; /// ## What it does diff --git a/lib/src/lints/legacy_let_syntax.rs b/lib/src/lints/legacy_let_syntax.rs index e0b8980..b33043e 100644 --- a/lib/src/lints/legacy_let_syntax.rs +++ b/lib/src/lints/legacy_let_syntax.rs @@ -1,10 +1,10 @@ -use crate::{make, session::SessionInfo, Metadata, Report, Rule, Suggestion}; +use crate::{Metadata, Report, Rule, Suggestion, make, session::SessionInfo}; use if_chain::if_chain; use macros::lint; use rnix::{ - types::{EntryHolder, Ident, Key, LegacyLet, TokenWrapper, TypedNode}, NodeOrToken, SyntaxElement, SyntaxKind, + types::{EntryHolder, Ident, Key, LegacyLet, TokenWrapper, TypedNode}, }; /// ## What it does diff --git a/lib/src/lints/manual_inherit.rs b/lib/src/lints/manual_inherit.rs index 4fddce5..9b9651c 100644 --- a/lib/src/lints/manual_inherit.rs +++ b/lib/src/lints/manual_inherit.rs @@ -1,10 +1,10 @@ -use crate::{make, session::SessionInfo, Metadata, Report, Rule, Suggestion}; +use crate::{Metadata, Report, Rule, Suggestion, make, session::SessionInfo}; use if_chain::if_chain; use macros::lint; use rnix::{ - types::{Ident, KeyValue, TokenWrapper, TypedNode}, NodeOrToken, SyntaxElement, SyntaxKind, + types::{Ident, KeyValue, TokenWrapper, TypedNode}, }; /// ## What it does diff --git a/lib/src/lints/manual_inherit_from.rs b/lib/src/lints/manual_inherit_from.rs index 1d88b8e..f1814c8 100644 --- a/lib/src/lints/manual_inherit_from.rs +++ b/lib/src/lints/manual_inherit_from.rs @@ -1,10 +1,10 @@ -use crate::{make, session::SessionInfo, Metadata, Report, Rule, Suggestion}; +use crate::{Metadata, Report, Rule, Suggestion, make, session::SessionInfo}; use if_chain::if_chain; use macros::lint; use rnix::{ - types::{Ident, KeyValue, Select, TokenWrapper, TypedNode}, NodeOrToken, SyntaxElement, SyntaxKind, + types::{Ident, KeyValue, Select, TokenWrapper, TypedNode}, }; /// ## What it does diff --git a/lib/src/lints/redundant_pattern_bind.rs b/lib/src/lints/redundant_pattern_bind.rs index 56957ce..b55a3fa 100644 --- a/lib/src/lints/redundant_pattern_bind.rs +++ b/lib/src/lints/redundant_pattern_bind.rs @@ -1,10 +1,10 @@ -use crate::{session::SessionInfo, Metadata, Report, Rule, Suggestion}; +use crate::{Metadata, Report, Rule, Suggestion, session::SessionInfo}; use if_chain::if_chain; use macros::lint; use rnix::{ - types::{Pattern, TokenWrapper, TypedNode}, NodeOrToken, SyntaxElement, SyntaxKind, + types::{Pattern, TokenWrapper, TypedNode}, }; /// ## What it does diff --git a/lib/src/lints/repeated_keys.rs b/lib/src/lints/repeated_keys.rs index e4dc0f6..b1617f3 100644 --- a/lib/src/lints/repeated_keys.rs +++ b/lib/src/lints/repeated_keys.rs @@ -1,10 +1,12 @@ -use crate::{session::SessionInfo, Metadata, Report, Rule}; +use std::fmt::Write as _; + +use crate::{Metadata, Report, Rule, session::SessionInfo}; use if_chain::if_chain; use macros::lint; use rnix::{ - types::{AttrSet, EntryHolder, Ident, KeyValue, TokenWrapper, TypedNode}, NodeOrToken, SyntaxElement, SyntaxKind, + types::{AttrSet, EntryHolder, Ident, KeyValue, TokenWrapper, TypedNode}, }; /// ## What it does @@ -96,7 +98,7 @@ impl Rule for RepeatedKeys { 1 => "... and here (`1` occurrence omitted).".to_string(), n => format!("... and here (`{n}` occurrences omitted)."), }; - message.push_str(&format!(" Try `{} = {{ {}=...; {}=...; {}=...; }}` instead.", first_component_ident.as_str(), first_subkey, second_subkey, third_subkey)); + write!(message, " Try `{} = {{ {}=...; {}=...; {}=...; }}` instead.", first_component_ident.as_str(), first_subkey, second_subkey, third_subkey).unwrap(); message }; diff --git a/lib/src/lints/unquoted_splice.rs b/lib/src/lints/unquoted_splice.rs index ba1641a..1cd6003 100644 --- a/lib/src/lints/unquoted_splice.rs +++ b/lib/src/lints/unquoted_splice.rs @@ -1,10 +1,10 @@ -use crate::{make, session::SessionInfo, Metadata, Report, Rule, Suggestion}; +use crate::{Metadata, Report, Rule, Suggestion, make, session::SessionInfo}; use if_chain::if_chain; use macros::lint; use rnix::{ - types::{Dynamic, TypedNode}, NodeOrToken, SyntaxElement, SyntaxKind, + types::{Dynamic, TypedNode}, }; /// ## What it does diff --git a/lib/src/lints/unquoted_uri.rs b/lib/src/lints/unquoted_uri.rs index 440b278..d11a651 100644 --- a/lib/src/lints/unquoted_uri.rs +++ b/lib/src/lints/unquoted_uri.rs @@ -1,8 +1,8 @@ -use crate::{make, session::SessionInfo, Metadata, Report, Rule, Suggestion}; +use crate::{Metadata, Report, Rule, Suggestion, make, session::SessionInfo}; use if_chain::if_chain; use macros::lint; -use rnix::{types::TypedNode, NodeOrToken, SyntaxElement, SyntaxKind}; +use rnix::{NodeOrToken, SyntaxElement, SyntaxKind, types::TypedNode}; /// ## What it does /// Checks for URI expressions that are not quoted. diff --git a/lib/src/lints/useless_has_attr.rs b/lib/src/lints/useless_has_attr.rs index 0c52bce..41eab35 100644 --- a/lib/src/lints/useless_has_attr.rs +++ b/lib/src/lints/useless_has_attr.rs @@ -1,10 +1,10 @@ -use crate::{make, session::SessionInfo, Metadata, Report, Rule, Suggestion}; +use crate::{Metadata, Report, Rule, Suggestion, make, session::SessionInfo}; use if_chain::if_chain; use macros::lint; use rnix::{ - types::{BinOp, BinOpKind, IfElse, Select, TypedNode}, NodeOrToken, SyntaxElement, SyntaxKind, + types::{BinOp, BinOpKind, IfElse, Select, TypedNode}, }; /// ## What it does diff --git a/lib/src/lints/useless_parens.rs b/lib/src/lints/useless_parens.rs index 9cba4b3..14be74f 100644 --- a/lib/src/lints/useless_parens.rs +++ b/lib/src/lints/useless_parens.rs @@ -1,10 +1,10 @@ -use crate::{session::SessionInfo, Diagnostic, Metadata, Report, Rule, Suggestion}; +use crate::{Diagnostic, Metadata, Report, Rule, Suggestion, session::SessionInfo}; use if_chain::if_chain; use macros::lint; use rnix::{ - types::{KeyValue, LetIn, Paren, ParsedType, TypedNode, Wrapper}, NodeOrToken, SyntaxElement, SyntaxKind, + types::{KeyValue, LetIn, Paren, ParsedType, TypedNode, Wrapper}, }; /// ## What it does diff --git a/lib/src/make.rs b/lib/src/make.rs index 4c963a4..2b9fc3f 100644 --- a/lib/src/make.rs +++ b/lib/src/make.rs @@ -1,8 +1,8 @@ use std::{fmt::Write, iter::IntoIterator}; use rnix::{ - types::{self, TokenWrapper, TypedNode}, SyntaxNode, + types::{self, TokenWrapper, TypedNode}, }; fn ast_from_text(text: &str) -> N { diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 935221f..cc10e30 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -2,11 +2,11 @@ mod explain; mod metadata; use explain::generate_explain_impl; -use metadata::{generate_meta_impl, RawLintMeta}; +use metadata::{RawLintMeta, generate_meta_impl}; use proc_macro::TokenStream; use proc_macro2::TokenStream as TokenStream2; use quote::quote; -use syn::{parse_macro_input, Ident, ItemStruct}; +use syn::{Ident, ItemStruct, parse_macro_input}; fn generate_self_impl(struct_name: &Ident) -> TokenStream2 { quote! { diff --git a/macros/src/metadata.rs b/macros/src/metadata.rs index b128ef5..1bf7bad 100644 --- a/macros/src/metadata.rs +++ b/macros/src/metadata.rs @@ -3,9 +3,9 @@ use std::collections::HashMap; use proc_macro2::TokenStream as TokenStream2; use quote::{format_ident, quote}; use syn::{ + Expr, ExprArray, Ident, Lit, Path, Token, parse::{Parse, ParseStream, Result}, punctuated::Punctuated, - Expr, ExprArray, Ident, Lit, Path, Token, }; struct KeyValue { -- 2.51.2