New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

legacy_constructor autocorrect doesn't correct all cases #2098

fbarraganef opened this Issue Mar 15, 2018 · 0 comments


None yet
2 participants

fbarraganef commented Mar 15, 2018

New Issue Checklist

Bug Report

When I execute the swiftlint command, It show me the detected errors and when I execute the swiftlint autocorrect it show that all found errors were corrected, but when I open the file again the issue is persisting.

Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint
Done linting! Found 10 violations, 0 serious in 146 files.

swiftlint autocorrect 
Done correcting 146 files!


  • SwiftLint version (run swiftlint version to be sure)?

  • Installation method used (Homebrew, CocoaPods, building from source, etc)?

  • Are you using nested configurations?

  • Which Xcode version are you using (check xcode-select -p)? 9.2

// This triggers a violation:
static func strikePrice(value: String) -> NSAttributedString { let attributeString: NSMutableAttributedString = NSMutableAttributedString(string: value) attributeString.addAttribute(NSBaselineOffsetAttributeName, value: 0, range: NSMakeRange(0, attributeString.length)) attributeString.addAttribute(NSStrikethroughStyleAttributeName, value: 1, range: NSMakeRange(0, attributeString.length)) return attributeString }

@marcelofabri marcelofabri changed the title from swiftlint autocorrect is not working properly to legacy_constructor autocorrect doesn't correct all cases Mar 18, 2018

@marcelofabri marcelofabri added the bug label Mar 18, 2018

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Mar 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment