Skip to content

Commit

Permalink
Fix correction when correction range is before the violation location
Browse files Browse the repository at this point in the history
  • Loading branch information
swiftty committed Jun 23, 2024
1 parent 6a3ef8e commit 80bf895
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Source/SwiftLintCore/Extensions/SwiftLintFile+Regex.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ extension SwiftLintFile {
return violatingRanges.filter { range in
let region = fileRegions.first {
$0.contains(Location(file: self, characterOffset: range.location))
|| $0.contains(Location(file: self, characterOffset: range.location + range.length - 1))
}
return region?.isRuleEnabled(rule) ?? true
}
Expand Down

0 comments on commit 80bf895

Please sign in to comment.