-
-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy path.swiftlint.yml
More file actions
97 lines (90 loc) · 2.73 KB
/
Copy path.swiftlint.yml
File metadata and controls
97 lines (90 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Lint every first-party Swift target, not just the app: CLI/ ships a real
# binary and MactermTests/ is enforced-convention code too. (Previously only
# `Macterm` was scanned, silently exempting both.)
included:
- Macterm
- CLI
- MactermTests
excluded:
- build
- GhosttyKit
disabled_rules:
- todo
- nesting
- type_body_length
- file_length
- function_body_length
- opening_brace
- closure_parameter_position
- cyclomatic_complexity
# Trailing commas are owned by SwiftFormat's `trailingCommas` rule, which
# (unlike SwiftLint's `trailing_comma`) correctly omits the comma on
# single-element multiline collections. Running both fought each other on
# `[Foo(\n…\n)]` literals — one tool's fix was the other's violation. One
# tool per concern: SwiftFormat wins here.
- trailing_comma
# `String(decoding:as:UTF8.self)` is the modern, non-optional, LOSSLESS
# conversion this codebase deliberately uses (KERN_PROCARGS2 argv parsing in
# ProcessInspector must not drop non-UTF-8 bytes — see §5.8; CLI JSON output
# is already valid UTF-8). This rule pushes toward the failable
# `String(bytes:encoding:)`, which would reintroduce the byte-dropping the
# lossless form exists to avoid. Off project-wide.
- optional_data_string_conversion
opt_in_rules:
- closure_end_indentation
- closure_spacing
- collection_alignment
- contains_over_filter_count
- contains_over_filter_is_empty
- contains_over_first_not_nil
- contains_over_range_nil_comparison
- empty_collection_literal
- empty_count
- empty_string
- enum_case_associated_values_count
- explicit_init
- fatal_error_message
- first_where
- flatmap_over_map_reduce
- force_unwrapping
- identical_operands
- implicit_return
- joined_default_parameter
- last_where
- legacy_multiple
- lower_acl_than_parent
- modifier_order
- operator_usage_whitespace
- overridden_super_call
- prefer_self_type_over_type_of_self
- prefer_zero_over_explicit_init
- private_action
- redundant_nil_coalescing
- redundant_type_annotation
- sorted_first_last
- toggle_bool
- unneeded_parentheses_in_closure_argument
- vertical_whitespace_closing_braces
- vertical_whitespace_opening_braces
- yoda_condition
line_length:
warning: 140
error: 200
ignores_urls: true
ignores_function_declarations: false
ignores_comments: true
type_name:
min_length: 2
max_length: 60
identifier_name:
min_length: 1
max_length: 60
allowed_symbols: ["_"]
# `H`/`V` are the documented TreeBuilder split-tree DSL (H(pane("a"), …)) —
# single-uppercase by design for terse test trees. Allow them by name rather
# than lower-casing a deliberately-compact DSL.
excluded:
- H
- V
vertical_whitespace:
max_empty_lines: 1