Skip to content

Resolve SwiftLint violations and preserve type annotations - #60

Merged
ctreffs merged 21 commits into
masterfrom
lint
Aug 24, 2026
Merged

Resolve SwiftLint violations and preserve type annotations#60
ctreffs merged 21 commits into
masterfrom
lint

Conversation

@ctreffs

@ctreffs ctreffs commented Aug 24, 2026

Copy link
Copy Markdown
Member

Summary & Context

This PR updates .swiftlint.yml and .swiftformat to preserve explicit type annotations (critical for Swift compiler type-checker optimization) and resolves all 113 SwiftLint warnings/violations across the Sources/FirebladeMath codebase without altering any public APIs.

What & Why

  1. Linter & Formatter Configuration:

    • Disabled redundant_type_annotation in .swiftlint.yml and redundantType in .swiftformat to prevent automatic removal of explicit type annotations.
    • Disabled wrapMultilineStatementBraces in .swiftformat to prevent conflicts with SwiftLint's opening_brace rule on multiline declarations.
    • Cleaned up .swiftlint.yml warnings by removing invalid anyobject_protocol and moving explicit_self, unused_declaration, and unused_import under analyzer_rules.
  2. Codebase Lint Fixes (Sources/FirebladeMath/):

    • static_operator (43): Converted free operator declarations in Matrix+Operators.swift and Quaternion+Operators.swift to static func overloads within type extensions.
    • identifier_name (21): Expanded single-letter parameter and local variable names (e, q, a, b, c, m) to descriptive identifiers in Quat4f+Euler.swift, determinant.swift, and adjugate.swift.
    • attributes (19): Standardized @inlinable, @usableFromInline, and @inline(__always) positioning across matrix/quaternion types and properties.
    • opening_brace (6): Fixed opening brace positioning in MatrixStorage+SIMD.swift.
    • multiline_arguments (6): Formatted multiline arguments consistently in matrix.swift.
    • computed_accessors_order (4): Reordered get before set in QuaternionStorage+NO_SIMD.swift.
    • function_parameter_count (4): Suppressed parameter count warning for orthographic projection methods in Matrix4x4+Projections.swift while preserving public API signatures.
    • blanket_disable_command (3): Replaced blanket disables with disable:next / disable:this.
    • identical_operands (2): Updated sign.swift to use isNaN.
    • let_var_whitespace (1): Added blank line in Quat.swift.
    • todo (1): Clarified comment in MatrixStorage+NO_SIMD.swift.
    • file_length (1): Suppressed file length warning in Matrix+Multiplication.swift.

Reviewer Guidance

Risk of Regression (RoR)

Low. All changes are purely code style, attribute layout, variable renaming, and operator scoping improvements. Public APIs, function signatures, and mathematical calculations are strictly preserved.

Testing & Verification

  1. Linting Check:
    make lint (swiftlint + swiftformat) -> 0 errors / 0 violations.
  2. Unit Tests Pass:
    swift test -> 258/258 tests pass across 21 test suites.
  3. Compiler Profiling:
    ./Scripts/profile-compiler-stats.sh -> Build frontend wall time improved (~22.3s vs ~24.9s baseline).

ctreffs added 19 commits August 24, 2026 10:29
@ctreffs
ctreffs enabled auto-merge (squash) August 24, 2026 08:56
@ctreffs
ctreffs disabled auto-merge August 24, 2026 08:57
@ctreffs ctreffs changed the title refactor(lint): resolve SwiftLint violations and preserve type annotations Resolve SwiftLint violations and preserve type annotations Aug 24, 2026
@ctreffs
ctreffs enabled auto-merge (squash) August 24, 2026 09:03
@ctreffs
ctreffs merged commit 7b0bb20 into master Aug 24, 2026
12 checks passed
@ctreffs
ctreffs deleted the lint branch August 24, 2026 09:04
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