Skip to content

Commit 713d5ff

Browse files
committed
fix(ci): run Rust linting on Windows and improve pre-commit hook
- Move lint-rust job to windows-latest (app is Windows-only) - Add --all-targets --all-features to pre-commit clippy - Fix conditional import of AppSettings for Windows-only code - Fix clippy warning in test (case-sensitive extension comparison)
1 parent 3f6a89b commit 713d5ff

4 files changed

Lines changed: 10 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535

3636
lint-rust:
3737
name: Lint Rust
38-
runs-on: ubuntu-latest
38+
runs-on: windows-latest
3939
steps:
4040
- uses: actions/checkout@v4
4141

@@ -49,11 +49,6 @@ jobs:
4949
with:
5050
workspaces: src-tauri
5151

52-
- name: Install Tauri dependencies
53-
run: |
54-
sudo apt-get update
55-
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev
56-
5752
- name: Check formatting
5853
run: cargo fmt --manifest-path src-tauri/Cargo.toml -- --check
5954

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Format and lint Rust code
22
cargo fmt --manifest-path src-tauri/Cargo.toml
3-
cargo clippy --manifest-path src-tauri/Cargo.toml -- -D warnings
3+
cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets --all-features -- -D warnings
44

55
# Format and lint UI code (auto-fix)
66
cd ui && pnpm biome check --write && cd ..

src-tauri/src/services/connection_manager.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ use crate::config::connection::{JITTER_MAX_SECS, RETRY_BACKOFF_SECS};
2020
use crate::db::Database;
2121
use crate::error::AppError;
2222
use crate::models::{
23-
normalize_url, AppSettings, Notification, NotificationDisplayMethod, NtfyMessage, Subscription,
23+
normalize_url, Notification, NotificationDisplayMethod, NtfyMessage, Subscription,
2424
};
25+
#[cfg(windows)]
26+
use crate::models::AppSettings;
2527
use crate::services::TrayManager;
2628

2729
/// Connection entry storing both the shutdown sender and a unique connection ID.

src-tauri/src/services/image_cache.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,13 @@ mod tests {
280280

281281
#[test]
282282
fn test_cache_filename() {
283+
use std::path::Path;
284+
283285
let url = "https://example.com/path/to/image.jpg";
284286
let filename = get_cache_filename(url);
285-
assert!(filename.ends_with(".jpg"));
287+
assert!(Path::new(&filename)
288+
.extension()
289+
.is_some_and(|ext| ext.eq_ignore_ascii_case("jpg")));
286290

287291
let url2 = "https://example.com/image.png?query=1";
288292
let filename2 = get_cache_filename(url2);

0 commit comments

Comments
 (0)