Skip to content

Commit b1cbfa4

Browse files
committed
Add exclusion comment for lint rules
1 parent b4088ac commit b1cbfa4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Sources/SwiftFormatRules/AlwaysUseLowerCamelCase.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ import SwiftSyntax
1616
/// All values should be written in lower camel-case (`lowerCamelCase`).
1717
/// Underscores (except at the beginning of an identifier) are disallowed.
1818
///
19+
/// This rule does not apply to test code, defined as code which:
20+
/// * Contains the line `import XCTest`
21+
///
1922
/// Lint: If an identifier contains underscores or begins with a capital letter, a lint error is
2023
/// raised.
2124
public final class AlwaysUseLowerCamelCase: SyntaxLintRule {

Sources/SwiftFormatRules/NeverForceUnwrap.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ import SwiftSyntax
1515

1616
/// Force-unwraps are strongly discouraged and must be documented.
1717
///
18+
/// This rule does not apply to test code, defined as code which:
19+
/// * Contains the line `import XCTest`
20+
///
1821
/// Lint: If a force unwrap is used, a lint warning is raised.
1922
public final class NeverForceUnwrap: SyntaxLintRule {
2023

0 commit comments

Comments
 (0)