From 2a051c70640056a72ec507bf6b5b7cdd87b96e13 Mon Sep 17 00:00:00 2001 From: Michel de Graaf Date: Sun, 26 Jul 2026 16:09:34 +0200 Subject: [PATCH] chore: add a code quality baseline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three findings were never real. parse_request is 34 lines, not 426: the `'{'` char literal in it reads as an opening brace to the line counter, which then runs to EOF — 610 + 426 lands on line 1035 of a 1034-line file. The duplicate-block hits on home.tsx and install.tsx match the punctuation between entries of a data table, not logic; the records repeat the field names their type demands. Each is silenced at its own site with the reason, so the rule keeps working everywhere else. Nothing is switched off in config.yml — a `rules:` entry there would blind the rule across the project. `ci.failBelow: 100` makes the baseline enforceable: the check exits 1 on a single new warning. --- soulseek-rs/src/commands/transfer.rs | 1 + website/src/pages/home.tsx | 1 + website/src/pages/install.tsx | 1 + 3 files changed, 3 insertions(+) diff --git a/soulseek-rs/src/commands/transfer.rs b/soulseek-rs/src/commands/transfer.rs index 8c27a05..6200b5b 100644 --- a/soulseek-rs/src/commands/transfer.rs +++ b/soulseek-rs/src/commands/transfer.rs @@ -607,6 +607,7 @@ fn read_requests( } /// `Ok(None)` for a blank line, `Err` for something unusable. +// aislop-ignore-next-line complexity/function-too-long -- scanner bug, not a long function: the `'{'` char literal below reads as an opening brace, so aislop's counter never closes and measures to EOF. It is 34 lines. fn parse_request(line: &str) -> Result, String> { let line = line.trim_end_matches(['\r', '\n']); if line.trim().is_empty() { diff --git a/website/src/pages/home.tsx b/website/src/pages/home.tsx index f13b259..f1daf52 100644 --- a/website/src/pages/home.tsx +++ b/website/src/pages/home.tsx @@ -19,6 +19,7 @@ const PLATFORMS: readonly { name: OsName; note: string; anchor: string }[] = [ { name: 'Windows', note: 'cargo or .exe', anchor: 'windows' }, ] +// aislop-ignore-file code-quality/duplicate-block -- FEATURES is a data table; its entries repeat the field names the record shape requires, not logic. The rule matches the punctuation skeleton between entries. A factory would trade named fields for positional string args. const FEATURES = [ { glyph: '✦', diff --git a/website/src/pages/install.tsx b/website/src/pages/install.tsx index 3724de7..9e5b4dd 100644 --- a/website/src/pages/install.tsx +++ b/website/src/pages/install.tsx @@ -47,6 +47,7 @@ interface InstallRoute { alt: React.ReactNode } +// aislop-ignore-file code-quality/duplicate-block -- three findings here, all data tables: the INSTALLS records repeat the field names InstallRoute requires, and the two uninstall `lines` arrays repeat the `{ t, text }` shape around different commands. The rule matches punctuation, not logic. const INSTALLS: readonly InstallRoute[] = [ { id: 'macos',