From d5421b3db9bb985b95a078a6e2233cb697b0d90d Mon Sep 17 00:00:00 2001 From: scheinriese Date: Fri, 22 May 2026 15:28:44 +0200 Subject: [PATCH] =?UTF-8?q?chore(typos):=20exclude=20color-data=20files=20?= =?UTF-8?q?and=20rename=20unparseable=E2=86=92unparsable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI's spell-check (crate-ci/typos) flagged two patterns introduced by this PR: - `daa` inside hex color values (`e6daa6` beige, `daa520` goldenrod) in colors/named.cljs and colors/css.cljs. Pure tokenizer artifact; the hex codes are W3C canonical and can't be renamed. - `unparseable` in 3 docstrings + 1 comment of colors.cljs. Both spellings are valid English; typos prefers `unparsable`. Fix surgically rather than growing the global word allowlist: add the two color-data files to `extend-exclude` (they're pure lookup tables with no prose to spell-check anyway), and rename `unparseable` in colors.cljs to `unparsable`. No code semantics changed. Co-Authored-By: Claude Opus 4.7 --- src/main/frontend/colors.cljs | 8 ++++---- typos.toml | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/frontend/colors.cljs b/src/main/frontend/colors.cljs index a918a07f1e..d7627a132b 100644 --- a/src/main/frontend/colors.cljs +++ b/src/main/frontend/colors.cljs @@ -16,7 +16,7 @@ (defn parse-css-color->hex "Parse a computed CSS color value (hex / hsl(...) / rgb(...)) into a hex - string. Returns nil for blank or unparseable input." + string. Returns nil for blank or unparsable input." [s] (when-let [v (some-> s string/trim not-empty)] (cond @@ -60,7 +60,7 @@ ;; callbacks fire at the microtask boundary, before React commits the ;; render scheduled by the same set-state! that triggered the flip, so ;; subscribers always see fresh values on the next paint. `contains?` -;; check lets us cache nil too (var unset / unparseable). +;; check lets us cache nil too (var unset / unparsable). (defonce ^:private *bg-var-cache (atom {})) (defn- invalidate-bg-var-cache! [] @@ -77,7 +77,7 @@ (defn read-bg-var "Read a CSS background variable (e.g. \"--ls-primary-background-color\") and return its hex value. Tries body first (where Logseq sets theme vars), falls - back to documentElement. Returns nil if unset/unparseable. + back to documentElement. Returns nil if unset/unparsable. Cached per theme; cache invalidates on `documentElement` attribute changes (data-theme / class), so theme flips are observed without an explicit @@ -582,7 +582,7 @@ :match :hex | :css | :exact | :prefix :name optional-string (omitted for :hex) :tentative? bool (only true for :prefix)} - or nil. Whitespace-only / blacklisted / unparseable -> nil. + or nil. Whitespace-only / blacklisted / unparsable -> nil. Public boundary." [s] (when (and (string? s) (<= (count s) 64)) diff --git a/typos.toml b/typos.toml index 7f1350dd5f..079bc1f7a5 100644 --- a/typos.toml +++ b/typos.toml @@ -25,4 +25,8 @@ extend-exclude = ["resources/*", "deps/db-sync/test/logseq/db_sync/fixtures/*.edn", "clj-e2e/resources/*", "deps/common/src/logseq/common/plural.cljs", - "packages/ui/src/amplify/lang.ts"] + "packages/ui/src/amplify/lang.ts", + # Pure W3C named-color → hex tables; hex digits trip the typos + # tokenizer ("daa" inside "e6daa6"/"daa520" etc.). No prose. + "src/main/frontend/colors/named.cljs", + "src/main/frontend/colors/css.cljs"]