generated from eblume/project-template
fix: clippy single_match in heph-tui + add clippy pre-commit hook
All checks were successful
Build / validate (push) Successful in 9m35s
All checks were successful
Build / validate (push) Successful in 9m35s
CI on main failed on a clippy::single_match lint in the heph-tui sidebar key handler. Rewrite as `if let`. Also add a `cargo clippy -D warnings` prek hook mirroring cargo-fmt, so lints are caught locally before CI (prek previously only ran cargo fmt). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c29ac46559
commit
6ddc9b83bf
4 changed files with 19 additions and 4 deletions
|
|
@ -186,10 +186,11 @@ fn handle_key<B: heph_tui::Backend>(app: &mut App<B>, key: KeyEvent) -> Option<A
|
|||
KeyCode::Char('D') => app.begin_delete(),
|
||||
_ => {}
|
||||
},
|
||||
Focus::Sidebar => match key.code {
|
||||
KeyCode::Char('D') => app.begin_delete_project(),
|
||||
_ => {}
|
||||
},
|
||||
Focus::Sidebar => {
|
||||
if let KeyCode::Char('D') = key.code {
|
||||
app.begin_delete_project()
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
None
|
||||
|
|
|
|||
1
docs/changelog.d/+clippy-prek-hook.infra.md
Normal file
1
docs/changelog.d/+clippy-prek-hook.infra.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Add a `cargo clippy -D warnings` pre-commit hook so lints are caught locally before CI.
|
||||
1
docs/changelog.d/+fix-clippy-single-match.bugfix.md
Normal file
1
docs/changelog.d/+fix-clippy-single-match.bugfix.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Fix `clippy::single_match` lint in heph-tui sidebar key handling (CI failure on main).
|
||||
12
prek.toml
12
prek.toml
|
|
@ -97,6 +97,18 @@ language = "system"
|
|||
files = '\.rs$'
|
||||
pass_filenames = false
|
||||
|
||||
# Rust linting - cargo clippy over the whole workspace, denying warnings to
|
||||
# match CI (`dagger call check` / .forgejo/scripts/build run the same command).
|
||||
# Catches lints (e.g. clippy::single_match) before they reach CI. Uses the
|
||||
# system toolchain; runs whenever a .rs file is staged.
|
||||
[[repos.hooks]]
|
||||
id = "cargo-clippy"
|
||||
name = "cargo-clippy"
|
||||
entry = "cargo clippy --all-targets --all-features -- -D warnings"
|
||||
language = "system"
|
||||
files = '\.rs$'
|
||||
pass_filenames = false
|
||||
|
||||
# GitHub/Forgejo Actions workflow linting
|
||||
[[repos]]
|
||||
repo = "https://github.com/rhysd/actionlint"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue