Skip to content

Commit

Permalink
Add check on autocorrect for disabled range
Browse files Browse the repository at this point in the history
  • Loading branch information
norio-nomura committed Oct 29, 2016
1 parent 19db7b6 commit 9b64c7d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Source/SwiftLintFramework/Rules/ExplicitInitRule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public struct ExplicitInitRule: ASTRule, ConfigurationProviderRule, CorrectableR

public func correctFile(file: File) -> [Correction] {
let matches = violationRangesInFile(file)
.filter { !file.ruleEnabledViolatingRanges([$0], forRule: self).isEmpty }
guard !matches.isEmpty else { return [] }

let description = self.dynamicType.description
Expand Down

0 comments on commit 9b64c7d

Please sign in to comment.