Skip to content

Fix SwiftLint style warnings (228 violations)#93

Merged
eyelock merged 13 commits into
mainfrom
chore/fix-lint-warnings
Jan 27, 2026
Merged

Fix SwiftLint style warnings (228 violations)#93
eyelock merged 13 commits into
mainfrom
chore/fix-lint-warnings

Conversation

@eyelock
Copy link
Copy Markdown
Owner

@eyelock eyelock commented Jan 27, 2026

Summary

Fixes all 228 style violations, reducing from 270 to 42 warnings (architectural refactoring only).

Changes

  • Force unwraps (167): Safe unwrapping, NSColor.hex() helper
  • Opening braces (39): Same-line formatting
  • Closures (16): Parameter positioning, trailing closure fixes
  • For-where (7): where clauses, first(where:)
  • Other (12): Identifier names, unused bindings, large tuple → struct, type names

Testing

✅ All 561 tests passing
✅ Zero build errors
✅ Zero new warnings

Remaining

42 architectural warnings (file/function/type length, complexity) - deferred for separate refactoring effort per .claude/plans/2026-01-27-lint-refactoring-plan.md

🤖 Generated with Claude Code

David Collie and others added 13 commits January 27, 2026 19:13
- Added NSColor.hex() static helper for compile-time constant colors
- Replaced 160 force unwraps (!  operator) with safe helper
- All hex values preserved correctly
- Zero test failures

Reduces lint warnings from 270 to 110.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- EnvironmentVariable.swift: Use optional binding for key.first
- BoardLoader.swift: Add fallback for Application Support directory
- TermQApp.swift: Guard let for application support access (3 locations)
- BackupManager.swift: Guard let in primaryBoardPath
- BoardPersistence.swift: Guard let in init

All force unwrapping warnings eliminated (167 → 0).
Zero test failures.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Move opening braces to same line as declaration per Swift style guide.
Fixed 22 violations across 9 files.
Zero test failures.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Move closure parameters to same line as opening brace.
Fixed 10 violations in CommandPaletteView and TerminalHostView.
Zero test failures.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Moved 17 standalone opening braces to end of condition lines.
Zero test failures.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Replaced 6 unused closure parameters with underscore
- Fixed 2 for-where violations (BoardViewModel, TerminalSessionManager)
- Disabled for-where rule for 4 cases with early returns/breaks
  (not suitable for where clause refactoring)

Zero test failures.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rename short variable names in ComponentInstallerError Equatable conformance:
- 'a', 'b' → 'lhsName', 'rhsName' (bundledComponentNotFound)
- 'a', 'b' → 'lhsMessage', 'rhsMessage' (installFailed, uninstallFailed)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace 'let _ = UUID()' with '!= nil' for clearer intent:
- BoardLoader.swift: findCardIndex UUID validation
- HeadlessWriter.swift: findCardIndex UUID validation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace tuple with BackupInfo struct in BackupManager:
- Create BackupInfo struct with exists, date, size properties
- Update backupInfo computed property to return struct instead of tuple
- Maintains backward compatibility with existing property access syntax

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
TerminalSessionManager.swift:
- Use where clause in allSessions loop instead of nested if
- Remove superfluous lint disable comment

SafePasteAnalyzer.swift:
- Refactor destructive pattern check to use first(where:)
- Cleaner implementation that finds first match without explicit loop

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rename typealias 'S' to 'Schema' in SchemaDefinitions:
- SwiftLint requires type names to be at least 3 characters
- 'Schema' is clearer and more descriptive
- Replace all 45 uses of 'S.' with 'Schema.'

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
TmuxPaneView.swift:
- Convert Button trailing closures to labeled 'label' parameter
- SwiftLint requires explicit labels when multiple closures present
- Affects 6 Button declarations in the toolbar

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
TmuxManager.swift:
- Replace loop with first(where:) for finding executable tmux path
- Cleaner implementation using higher-order function

CLI.swift (2 locations):
- Move file existence check to where clause in launch logic
- Simplifies loop structure while maintaining early-exit behavior

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude Bot commented Jan 27, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@eyelock eyelock merged commit 5c0405d into main Jan 27, 2026
8 checks passed
@eyelock eyelock deleted the chore/fix-lint-warnings branch January 27, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant