Skip to content

Commit

Permalink
chore(deps): Bump deps and pre-commit
Browse files Browse the repository at this point in the history
Signed-off-by: dark0dave <dark0dave@mykolab.com>
  • Loading branch information
dark0dave committed Dec 24, 2024
1 parent 94ac998 commit 3270478
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 46 deletions.
37 changes: 26 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,11 @@ repos:
stages: [pre-commit]

- repo: https://github.com/commitizen-tools/commitizen
rev: v3.30.0
rev: v4.1.0
hooks:
- id: commitizen
stages: [commit-msg]

- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
stages: [pre-commit]
- id: cargo-check
stages: [pre-commit]
- id: clippy
stages: [pre-commit]

- repo: local
hooks:
- id: cargo-test
Expand All @@ -68,6 +58,31 @@ repos:
language: system
types: [rust]
pass_filenames: false
- id: cargo-fmt
stages: [pre-commit]
name: cargo fmt
description: Format files with cargo fmt.
entry: cargo fmt
language: system
types: [rust]
args: ["--"]
- id: cargo-check
stages: [pre-commit]
name: cargo check
description: Check the package for errors.
entry: cargo check
language: system
types: [rust]
pass_filenames: false
- id: cargo-clippy
stages: [pre-commit]
name: cargo clippy
description: Lint rust sources
entry: cargo clippy
language: system
args: ["--", "-D", "warnings"]
types: [rust]
pass_filenames: false
- id: version-check
stages: [pre-commit]
name: version check
Expand Down
52 changes: 26 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 11 additions & 9 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,19 @@ fn find_mod_folder(mod_component: &Component, mod_dir: &Path, depth: usize) -> O
.find_map(|entry| match entry {
Ok(entry)
if entry
.path()
.parent()
.unwrap()
.file_name()
.unwrap_or_default()
.eq_ignore_ascii_case(&mod_component.name)
&& entry
.file_name()
.eq_ignore_ascii_case(&mod_component.tp_file) =>
.eq_ignore_ascii_case(&mod_component.tp_file) =>
{
return Some(entry.into_path().parent().unwrap().into());
if let Some(parent) = entry.path().parent() {
if parent
.file_name()
.unwrap_or_default()
.eq_ignore_ascii_case(&mod_component.name)
{
return Some(parent.to_path_buf());
}
}
None
}
_ => None,
})
Expand Down

0 comments on commit 3270478

Please sign in to comment.