-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.swiftlint.yml
More file actions
83 lines (74 loc) · 2.41 KB
/
Copy path.swiftlint.yml
File metadata and controls
83 lines (74 loc) · 2.41 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
# SwiftFormat (see Mintfile / `.swiftformat`) owns mechanical layout and spacing.
# Disable SwiftLint rules that duplicate it — especially correctable ones, or
# `swiftlint --fix` after SwiftFormat will fight the formatter (e.g. trailing_comma).
disabled_rules:
- closing_brace
- colon
- comma
- empty_parentheses_with_trailing_closure
- function_name_whitespace
- leading_whitespace
- opening_brace
- redundant_void_return
- return_arrow_whitespace
- trailing_comma
- trailing_newline
- trailing_semicolon
- trailing_whitespace
# Allow explicit empty init/deinit declarations when used to carry isolation intent.
- unneeded_synthesized_initializer
- vertical_whitespace
- void_return
# Fires on the common pattern of putting a // swiftlint:disable:next
# comment between a doc comment and the declaration it documents.
# The combined "explain why you're suppressing a rule" pattern is more
# valuable than the rule catches.
- orphaned_doc_comment
included:
- Brew
- BrewTests
- BrewUITests
- Sources
- Tests
excluded:
- .build
- docs
- scripts
line_length:
warning: 180
error: 200
ignores_comments: true
file_length:
warning: 600
error: 1000
identifier_name:
min_length:
warning: 1
excluded:
- id
- i
- j
- x
- y
- z
custom_rules:
unchecked_sendable:
name: "Unchecked Sendable"
regex: '@unchecked\s+Sendable'
message: "@unchecked Sendable bypasses concurrency checking. Justify with a comment explaining why this is safe, then add // swiftlint:disable:next unchecked_sendable"
severity: error
nonisolated_unsafe:
name: "Nonisolated Unsafe"
regex: 'nonisolated\(unsafe\)'
message: "nonisolated(unsafe) disables data-race checking. Justify with a comment explaining the synchronisation mechanism, then add // swiftlint:disable:next nonisolated_unsafe"
severity: error
preconcurrency_import:
name: "Preconcurrency Import"
regex: '@preconcurrency\s+import'
message: "@preconcurrency import suppresses isolation checking for the imported module. Document which APIs from this module are being bridged and why."
severity: error
assume_isolated:
name: "Assume Isolated"
regex: '\.assumeIsolated\s*\{'
message: "MainActor.assumeIsolated asserts isolation without compile-time verification. Justify with a comment explaining why the assumption holds at this call site."
severity: error