Reputation: 19572
Current SwiftLint rules:
file_length:
warning: 800
error: 1500
The error
I followed this answer but the error doesn't go away
// swiftlint:disable force_cast
import UIKit
class MyClass: UIViewController {
}
// swiftlint:enable force_cast
How can I ignore SwiftLint rules in certain file?
Upvotes: 9
Views: 16596
Reputation: 3692
The rule name is file_length
, so you have to disable this rule:
// swiftlint:disable file_length
import UIKit
class MyClass: UIViewController {
}
Note: // swiftlint:enable <rule>
is for cases when you want to ignore a specific rule only in a small code block (like a single func). If you'd like to disable a rule in file scope, there is no need to enable anything.
See Swiftlint docs.
Upvotes: 23