Skip to content

Commit

Permalink
Make swiftformat directives case-insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed Oct 6, 2021
1 parent a5bfbf0 commit 4efef33
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Sources/Formatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ public class Formatter: NSObject {
}
// TODO: handle typos, error for invalid rule names
// TODO: warn when trying to enable a rule that isn't enabled at file level
return argumentsString.range(of: "\\b(\(rule.name)|all)\\b",
options: .regularExpression) != nil
return argumentsString.range(of: "\\b(\(rule.name)|all)\\b", options: [
.regularExpression, .caseInsensitive,
]) != nil
}
switch directive {
case "options":
Expand Down

0 comments on commit 4efef33

Please sign in to comment.