From d8527b98fd2d7f3548a6436d3fc8ca99f439bfa1 Mon Sep 17 00:00:00 2001 From: jack Date: Wed, 1 Jul 2026 23:32:19 +0200 Subject: [PATCH] Add a pragmatic SwiftLint configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Baseline .swiftlint.yml for local use (not wired into CI yet): - file_length: warning at 600, error at 4000 — above the current maximum (BLEService.swift, ~3,500 lines), so the codebase passes as-is and only future growth trips the error. - function_body_length: warning 100, error 200. - Disables the high-noise style rules (line_length, identifier_name, cyclomatic_complexity, force_cast/force_try for tests, etc.) so the remaining defaults stay actionable; SwiftLint is not installed in this environment, so the disabled list is a best-effort starting point to be tuned on first real run. - Excludes vendored Arti and SwiftPM .build output. Co-Authored-By: Claude Fable 5 --- .swiftlint.yml | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .swiftlint.yml diff --git a/.swiftlint.yml b/.swiftlint.yml new file mode 100644 index 00000000..e48a19a6 --- /dev/null +++ b/.swiftlint.yml @@ -0,0 +1,51 @@ +# SwiftLint configuration for BitChat. +# +# Intentionally pragmatic: rules that would flood the existing codebase are +# disabled so the lint signal stays actionable; re-enable them individually as +# files get cleaned up. Not wired into CI yet — run locally with `swiftlint` +# from the repo root. + +included: + - bitchat + - bitchatTests + - localPackages/BitFoundation/Sources + - localPackages/BitFoundation/Tests + - localPackages/BitLogger/Sources + +excluded: + - .build + - localPackages/Arti + - localPackages/BitFoundation/.build + - localPackages/BitLogger/.build + +disabled_rules: + # Style/volume rules that currently produce noise across the codebase. + - line_length + - identifier_name + - type_name + - type_body_length + - cyclomatic_complexity + - function_parameter_count + - large_tuple + - nesting + - todo + - trailing_comma + - opening_brace + - statement_position + - for_where + - redundant_string_enum_value + - non_optional_string_data_conversion + # Common in tests (force casts/tries on fixtures). + - force_cast + - force_try + +file_length: + warning: 600 + # BLEService.swift is currently ~3,500 lines; the error threshold sits above + # today's maximum so the codebase passes as-is and only future growth of the + # largest files trips it. + error: 4000 + +function_body_length: + warning: 100 + error: 200