Skip to content

Commit

Permalink
Added test for disable all
Browse files Browse the repository at this point in the history
  • Loading branch information
mildm8nnered committed May 3, 2024
1 parent d379add commit 2aa98d0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Tests/SwiftLintFrameworkTests/CustomRulesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,19 @@ final class CustomRulesTests: SwiftLintTestCase {
XCTAssertTrue(try violations(forExample: example, customRules: customRules).isEmpty)
}

func testDisableAll() throws {
let customRules: [String: Any] = [
"dont_print": [
"regex": "print\\("
]
]
let example = Example("""
// swiftlint:disable:next all
print("Hello, world")
""")
XCTAssertTrue(try violations(forExample: example, customRules: customRules).isEmpty)
}

private func getCustomRules(_ extraConfig: [String: Any] = [:]) -> (Configuration, CustomRules) {
var config: [String: Any] = ["regex": "pattern",
"match_kinds": "comment"]
Expand Down

0 comments on commit 2aa98d0

Please sign in to comment.