Aventuras/src-tauri/src
Tony Frazier 20b35b5e79
Run Clippy on push and in CI, and split lint into lint:ts and lint:rust (#608)
## Summary

The Rust crate is format-checked but never linted. This fixes the
crate's existing Clippy warnings and adds `cargo clippy -D warnings` to
the pre-push hook and to CI. To keep Rust and TypeScript linting
independent, `lint` is split into `lint:ts` and `lint:rust`, and hooks,
CI and the release script call the half they need.

## Changes

- **Clippy fixes.** In `backup.rs`, two nested `if let … { if … }`
blocks become let-chains (`collapsible_if`). In `migration_patch.rs`,
`apply_checksum_patch` takes `&Path` instead of `&PathBuf` (`ptr_arg`).
No behaviour change.
- **Scripts.** `package.json` adds `lint:ts` / `lint:ts:fix` (ESLint)
and `lint:rust` / `lint:rust:fix` (`cargo fmt` plus `cargo +1.99.0
clippy --all-targets --all-features -D warnings`). `lint` and `lint:fix`
run both halves through `scripts/pm.js`.
- **Pre-push hook.** `lefthook.yml` runs `lint:ts` and `lint:rust`
through `scripts/pm.js`, under the same globs as before.
- **CI.** `rust-lint.yml` gains a `clippy` job on Rust 1.99.0 with the
Linux WebKit/GTK build dependencies and a Rust cache.
`lint-and-typecheck.yml` runs `lint:ts`.
- **Release script.** `scripts/release.js` runs `lint:ts:fix`, so a
release never needs the Rust toolchain or rewrites Rust code.
- **Docs.** `CLAUDE.md`, `README.md` and `docs/development/release.md`
describe the split scripts, the hook commands, the Clippy job, and how
to bump the pinned toolchain.

### Changes to existing behaviour

- `npm run lint` and `npm run lint:fix` now also lint the Rust crate, so
they need `cargo` and the 1.99.0 toolchain with Clippy (`rustup
toolchain install 1.99.0 --component clippy`). `lint:ts` / `lint:ts:fix`
keep the old ESLint-only behaviour.
- The pre-push commands are renamed `lint` → `lint-ts` and `rust-fmt` →
`lint-rust`. Anything that skips or overrides them by name
(`LEFTHOOK_EXCLUDE`, `lefthook-local.yml`) needs the new names.

## Test plan

- [ ] `npm run lint:rust` passes
- [ ] The "Rust Lint" `Clippy` job runs on this PR and passes
- [ ] `npm run lint` runs ESLint, then rustfmt and Clippy
- [ ] Pushing a commit that touches only `.rs` files runs `lint-rust`
but not `lint-ts` or `check`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01Mp6GGHh2aY397TuZXyUXKX


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Developer Tooling**
* TypeScript and Rust linting run separately, with Rust formatting and
Clippy checks included in the standard lint workflow.
* Rust lint checks also run in continuous integration, with warnings
treated as errors.
* Pre-push checks now run both TypeScript and Rust linting. Release
preparation runs TypeScript formatting and lint fixes.
* **Documentation**
* Updated build-script descriptions to reflect the TypeScript and Rust
lint commands and their fix options.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 14:50:50 -04:00
..
sync Check Rust formatting on push and in CI (#607) 2026-10-11 10:02:44 -04:00
avt_import.rs Check Rust formatting on push and in CI (#607) 2026-10-11 10:02:44 -04:00
backup.rs Run Clippy on push and in CI, and split lint into lint:ts and lint:rust (#608) 2026-10-11 14:50:50 -04:00
db.rs Check Rust formatting on push and in CI (#607) 2026-10-11 10:02:44 -04:00
db_tx.rs Check Rust formatting on push and in CI (#607) 2026-10-11 10:02:44 -04:00
lib.rs iOS follow-ups: iPadOS detection, backup restore, app icon, and a first pass of iOS bug fixes (#559) 2026-10-09 10:56:10 -04:00
main.rs Move the Rust crate to edition 2024 (#605) 2026-10-11 00:33:22 -04:00
migration_patch.rs Run Clippy on push and in CI, and split lint into lint:ts and lint:rust (#608) 2026-10-11 14:50:50 -04:00
time_anchors.rs Assert, check and reconcile story time, and start a new story at its opening's time (#530) 2026-09-24 15:19:19 -04:00