Files
letro-ios/.swiftlint.yml
Mauro 56eec826df Fix A11y tests (#5104)
* replace NavigationStack with ElementNavigationStack to allow the content to be rendered without a NavigationStack in a11y tests

* fix a11y tests

* update xcodeproject

* swiftformat fix

* use iOS 26.1 for CI

* use a wrapper to solve the issue for a11y tests

* ElementNavigationStack only uses the trick in DEBUG mode, and added a swiftlint rule to prevent the usage of NavigationStack
2026-02-13 16:45:58 +01:00

99 lines
2.1 KiB
YAML
Executable File

disabled_rules:
- trailing_whitespace
- unused_setter_value
- redundant_discardable_let
- identifier_name
opt_in_rules:
- force_unwrapping
- private_action
- explicit_init
- shorthand_optional_binding
- trailing_closure
included:
- "*/Sources/*"
- Tools/Scripts/Templates
excluded:
- "*/Sources/Generated/*"
- Tools/Sources # Our command-line tools use a lot of print commands.
- Secrets
- compound-ios/Inspector
line_length:
warning: 250
error: 1000
file_length:
warning: 2000
type_name:
min_length: 3
max_length:
warning: 150
error: 1000
type_body_length:
warning: 1000
error: 1000
function_body_length:
warning: 100
error: 100
function_parameter_count:
warning: 10
error: 10
cyclomatic_complexity:
ignores_case_statements: true
nesting:
type_level:
warning: 5
custom_rules:
vstack_spacing:
regex: "(?-s)VStack((?!spacing:).)*\\s*\\{"
match_kinds: identifier
message: "Please use explicit spacing in VStacks."
severity: warning
hstack_spacing:
regex: "(?-s)HStack((?!spacing:).)*\\s*\\{"
match_kinds: identifier
message: "Please use explicit spacing in HStacks."
severity: warning
compound_color_conversion:
regex: "UIColor\\(\\.compound"
match_kinds: identifier
message: "Please use the UIColor token directly to ensure the colour scheme is honoured."
severity: warning
print_deprecation:
regex: "\\b(print)\\b"
match_kinds: identifier
message: "MXLog should be used instead of print()"
severity: error
print_ln_deprecation:
regex: "\\b(println)\\b"
match_kinds: identifier
message: "MXLog should be used instead of println()"
severity: error
os_log_deprecation:
regex: "\\b(os_log)\\b"
match_kinds: identifier
message: "MXLog should be used instead of os_log()"
severity: error
prefer_element_navigation_stack:
regex: "\\b(NavigationStack)\\b"
match_kinds: identifier
message: "Use ElementNavigationStack instead of NavigationStack"
severity: error
included: "ElementX/Sources/.*\\.swift"
excluded: "ElementNavigationStack.swift"