lint: dead code cleanup + redundant expression fixes#647
Merged
datdamnzotz merged 7 commits intoOrcpub:developfrom Feb 20, 2026
Merged
lint: dead code cleanup + redundant expression fixes#647datdamnzotz merged 7 commits intoOrcpub:developfrom
datdamnzotz merged 7 commits intoOrcpub:developfrom
Conversation
- Rename :if to :missing-else-branch (correct clj-kondo linter name) - Add :clojure-lsp/unused-public-var :exclude for 5 live vars that LSP can't trace (cross-file macro refs, test-only callers) - Add :exclude-when-defined-by for re-frame reg-event-db, reg-event-fx, reg-sub, reg-sub-raw (keyword dispatch is invisible to LSP)
#_ discard 43 dead vars: - common.cljc (4): ptime, hours-per-day, rounds-to-hours, rounds-to-minutes - character.cljc (6): add-namespaces + 2 cascade helpers, base-climbing-speed, saving-throw-advantages, max-armor-class - classes.cljc (4): blessings-of-knowledge-skill, spell-level-to-cleric-level, spell-in-spells-known?, pact-weapon-option - options.cljc (15): deprecated ua/scag refs (skill-or-expertise-selection, subclass-plugin, subclass-cantrip-selection, druid-cantrip-selection, eldritch-invocation-option, deep-gnome-option-cfg, subrace-prereq), #_ template refs (add-sources, artisans-tools-choice-cfg), zero-caller defs (levels, key-to-name, any-language-selection, charge-summary, defensive-duelist-summary, ability-modifiers, subclass-level-option) - template.cljc (14): ability roller UI (6 fns + score-costs + point-buy-points), amazon frames (3), content-list, custom-race-builder; #_ subscribe/dispatch refers (no live callers remain) Redundant expression fixes: - classes.cljc: remove nested (str (str ...)) - options.cljc: flatten (and (and ...)) in dual-wield checks, remove duplicate source destructuring param
#_ discard 49 dead vars: - views.cljs (25): style defs (header-tab-style, desktop-menu-item-style, search-icon-style, transparent-search-input-style, row-style, light-row-style, list-style, thumbnail-style, summary-style, option-pack-styles, invalid-styling), duplicate constants (rounds-per-minute, minutes-per-hour, hours-per-day), superseded components (srd-link, realize-char, svg-icon-section, compare-spell, equipment-section, default-image, select-builder-field, text-field, subrace-damage-resistance, selection-selector, no-https-images) - events.cljs (22): dead defs (max-iterations, dnd-5e-characters-path, validate-registration, set-active-tabs, remove-subtypes), 17 never-dispatched reg-event-db/fx handlers (toggle-public, load-characters, hide-warning, open-orcacle, set-builder-item, set-spell-list, set-feature-prop, toggle-feat-selection, toggle-*-value-prop, toggle-*-map-prop, etc.); remove unused tab-path refer - db.cljs (1): musical-instrument-choice-cfg (duplicate of classes.cljc) - subs.cljs (1): ::char5e/summary reg-sub (never subscribed to) Redundant expression fixes: - views.cljs: remove (str ...) wrapping bare strings - character_builder.cljs: remove (str "CLICK HERE...") on 4 string literals - events.cljs: remove (str "all-content.orcbrew") on 2 string literals
Merge the top-level :clojure-lsp/unused-public-var into the :linters section where clj-kondo actually reads it. Add missing settings from the lint-missing-else branch: :output exclude-files, garden.selectors unresolved-var, read-string exclude, folder-test/with-conn lint-as, and :missing-else-branch :warning.
Removed broken with-conn lint-as, added orcpub.errors unresolved-var exclude, added spell_subs cross-file refs to unused-public-var exclude.
The def was incorrectly marked as dead code, but the legal footer in main-page still references it. Remove the #_ reader discard and the stale "dead" comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lint maintenance part 2!
Summary
.clj-kondo/config.ednwith LSP suppression rules for re-frameregistrations and 5 live false-positives; fix deprecated
:iflintername →
:missing-else-branch#_) ~92 dead vars across 10 source files (shared.cljc and frontend .cljs), each annotated with reason
(dead/deprecated/superseded)
(str (str ...))→ bare strings,(and (and ...))→ flattened, duplicate destructuring param removalDetails
Config (
.clj-kondo/config.edn)::exclude-when-defined-byforreg-event-db,reg-event-fx,reg-sub,reg-sub-raw(re-frame keyword dispatch is invisible to LSP):excludefor 5 live vars that trigger false-positive unused warnings:iflinter →:missing-else-branch {:level :off}Dead code (11 files, 235 insertions / 126 deletions):
common.cljc: 4 unused time-conversion helperscharacter.cljc: 6 dead vars (namespace helpers, speed, AC)classes.cljc: 4 dead vars + redundantstroptions.cljc: 15 dead vars + flatten nestedand+ remove duplicate paramtemplate.cljc: 14 dead vars (ability roller UI, amazon frames, point-buy)views.cljs: 25 dead vars + redundantstrfixesevents.cljs: 22 dead event handlers + remove unusedtab-pathreferdb.cljs,subs.cljs,character_builder.cljs: 1-4 dead vars/fixes eachAll
#_discards include a comment explaining why.Verified: 0 lint errors, 0 lint warnings, 102 JVM tests pass, CLJS compiles clean.
Test plan
lein test— 102 tests passlein cljsbuild once dev— CLJS compiles with 0 errorslein with-profile lint run -m clj-kondo.main --lint src— 0 errors, 0 warnings