From 78721c37283d6ad94b16cb58b36f67ab6d4a7e00 Mon Sep 17 00:00:00 2001 From: nejcgalof Date: Fri, 27 Sep 2024 09:40:26 +0000 Subject: [PATCH 1/4] chore(ci): update pedantic lint command --- .github/workflows/ci.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3dd9f6e00c..64c8c2eabf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,7 +98,24 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - args: --tests --verbose -- -W clippy::pedantic + args: --all-targets --verbose -- -W clippy::pedantic \ + -A clippy::needless_raw_string_hashes \ + -A clippy::unreadable_literal \ + -A clippy::redundant_else \ + -A clippy::items_after_statements \ + -A clippy::missing_errors_doc \ + -A clippy::module_name_repetitions \ + -A clippy::uninlined_format_args \ + -A clippy::manual_string_new \ + -A clippy::must_use_candidate \ + -A clippy::too_many_lines \ + -A clippy::wildcard_imports \ + -A clippy::missing_panics_doc \ + -A clippy::inefficient_to_string \ + -A clippy::redundant_closure_for_method_calls \ + -A clippy::map_unwrap_or \ + -A clippy::struct_excessive_bools \ + -A clippy::unnecessary_wraps rustfmt: name: Formatting From daa5a025a33f56fac96bd0d34fc14c12556e6141 Mon Sep 17 00:00:00 2001 From: nejcgalof Date: Fri, 27 Sep 2024 10:08:12 +0000 Subject: [PATCH 2/4] refactor(clippy): Fix basic clippy lints (new version) --- git-cliff-core/src/repo.rs | 12 ++++++------ git-cliff-core/src/template.rs | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/git-cliff-core/src/repo.rs b/git-cliff-core/src/repo.rs index 7ddcf9c908..8fe1f08731 100644 --- a/git-cliff-core/src/repo.rs +++ b/git-cliff-core/src/repo.rs @@ -137,32 +137,32 @@ impl Repository { (Some(include_pattern), Some(exclude_pattern)) => { // check if the commit has any changed files that match any of the // include patterns and non of the exclude patterns. - return changed_files.iter().any(|path| { + changed_files.iter().any(|path| { include_pattern .iter() .any(|pattern| pattern.matches_path(path)) && !exclude_pattern .iter() .any(|pattern| pattern.matches_path(path)) - }); + }) } (Some(include_pattern), None) => { // check if the commit has any changed files that match the include // patterns. - return changed_files.iter().any(|path| { + changed_files.iter().any(|path| { include_pattern .iter() .any(|pattern| pattern.matches_path(path)) - }); + }) } (None, Some(exclude_pattern)) => { // check if the commit has at least one changed file that does not // match all exclude patterns. - return changed_files.iter().any(|path| { + changed_files.iter().any(|path| { !exclude_pattern .iter() .any(|pattern| pattern.matches_path(path)) - }); + }) } (None, None) => true, } diff --git a/git-cliff-core/src/template.rs b/git-cliff-core/src/template.rs index 4cbe4966e6..0d280082a3 100644 --- a/git-cliff-core/src/template.rs +++ b/git-cliff-core/src/template.rs @@ -171,7 +171,7 @@ impl Template { Ok(v) } Err(e) => { - return if let Some(source1) = e.source() { + if let Some(source1) = e.source() { if let Some(source2) = source1.source() { Err(Error::TemplateRenderDetailedError( source1.to_string(), @@ -182,7 +182,7 @@ impl Template { } } else { Err(Error::TemplateError(e)) - }; + } } } } From f43627f39af4fce9227955752a724899ec4acfb4 Mon Sep 17 00:00:00 2001 From: nejcgalof Date: Fri, 27 Sep 2024 10:14:04 +0000 Subject: [PATCH 3/4] chore(ci): Try multiple lines on yml way --- .github/workflows/ci.yml | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64c8c2eabf..8304f787c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,23 +98,24 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - args: --all-targets --verbose -- -W clippy::pedantic \ - -A clippy::needless_raw_string_hashes \ - -A clippy::unreadable_literal \ - -A clippy::redundant_else \ - -A clippy::items_after_statements \ - -A clippy::missing_errors_doc \ - -A clippy::module_name_repetitions \ - -A clippy::uninlined_format_args \ - -A clippy::manual_string_new \ - -A clippy::must_use_candidate \ - -A clippy::too_many_lines \ - -A clippy::wildcard_imports \ - -A clippy::missing_panics_doc \ - -A clippy::inefficient_to_string \ - -A clippy::redundant_closure_for_method_calls \ - -A clippy::map_unwrap_or \ - -A clippy::struct_excessive_bools \ + args: > + --all-targets --verbose -- -W clippy::pedantic + -A clippy::needless_raw_string_hashes + -A clippy::unreadable_literal + -A clippy::redundant_else + -A clippy::items_after_statements + -A clippy::missing_errors_doc + -A clippy::module_name_repetitions + -A clippy::uninlined_format_args + -A clippy::manual_string_new + -A clippy::must_use_candidate + -A clippy::too_many_lines + -A clippy::wildcard_imports + -A clippy::missing_panics_doc + -A clippy::inefficient_to_string + -A clippy::redundant_closure_for_method_calls + -A clippy::map_unwrap_or + -A clippy::struct_excessive_bools -A clippy::unnecessary_wraps rustfmt: From 8f3748cc570b0680a536197aa2db009a3acba16e Mon Sep 17 00:00:00 2001 From: nejcgalof Date: Fri, 27 Sep 2024 10:14:49 +0000 Subject: [PATCH 4/4] chore(ci): format ci.yml --- .github/workflows/ci.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8304f787c0..cd55987c1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,22 +101,22 @@ jobs: args: > --all-targets --verbose -- -W clippy::pedantic -A clippy::needless_raw_string_hashes - -A clippy::unreadable_literal - -A clippy::redundant_else - -A clippy::items_after_statements - -A clippy::missing_errors_doc - -A clippy::module_name_repetitions - -A clippy::uninlined_format_args - -A clippy::manual_string_new - -A clippy::must_use_candidate - -A clippy::too_many_lines - -A clippy::wildcard_imports - -A clippy::missing_panics_doc - -A clippy::inefficient_to_string - -A clippy::redundant_closure_for_method_calls - -A clippy::map_unwrap_or - -A clippy::struct_excessive_bools - -A clippy::unnecessary_wraps + -A clippy::unreadable_literal + -A clippy::redundant_else + -A clippy::items_after_statements + -A clippy::missing_errors_doc + -A clippy::module_name_repetitions + -A clippy::uninlined_format_args + -A clippy::manual_string_new + -A clippy::must_use_candidate + -A clippy::too_many_lines + -A clippy::wildcard_imports + -A clippy::missing_panics_doc + -A clippy::inefficient_to_string + -A clippy::redundant_closure_for_method_calls + -A clippy::map_unwrap_or + -A clippy::struct_excessive_bools + -A clippy::unnecessary_wraps rustfmt: name: Formatting