Skip to content

Commit 023eb41

Browse files
committed
add exception for open-source
1 parent 9b9b3c7 commit 023eb41

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

SWIFTLINT.markdown

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ These guides use SwiftLint as a standard. You can learn more about SwiftLint by
2020
* [Force cast](#force-cast)
2121
* [Force unwrapping](#force-unwrapping)
2222
* [SwiftUI and multiple trailing closures](#swiftui-and-multiple-trailing-closures)
23+
* [Open-source files](#open-source-files)
2324
* [Other notes](#other-notes)
2425

2526
## Installing SwiftLint
@@ -144,6 +145,14 @@ You can work around this by extracting the `Button`'s action into a separate met
144145

145146
In these cases, you're permitted to disable this rule **for the declaration of a SwiftUI view** only. The rule name is `multiple_closures_with_trailing_closure`.
146147

148+
### Open-source files
149+
150+
Occasionally, you'll find it necessary to include an unmodified open-source file in the sample project. It's a virtual certainty that these files won't comply with our style guide. Our practice has always been to leave these files in their original state. In this situation, you should disable SwiftLint for the entire file:
151+
152+
```
153+
// swiftlint:disable all
154+
```
155+
147156
## Other notes
148157

149158
While SwiftLint goes a long way towards making your source code compliant with our style guide, it doesn't cover everything. For example, it won't catch or force you to correct the formatting for multi-condition `guard` statements. (See [Golden Path](https://github.com/raywenderlich/swift-style-guide#golden-path) for correct formatting.)

0 commit comments

Comments
 (0)