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

chore(ci): update pedantic lint command #890

Merged
merged 4 commits into from
Sep 27, 2024
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
20 changes: 19 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,25 @@ 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
Expand Down
12 changes: 6 additions & 6 deletions git-cliff-core/src/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
4 changes: 2 additions & 2 deletions git-cliff-core/src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -182,7 +182,7 @@ impl Template {
}
} else {
Err(Error::TemplateError(e))
};
}
}
}
}
Expand Down
Loading