Closed Mazyod closed 3 years ago
Seemed like a straightforward issue, so I didn't bother with all the required issue checklist, but would be happy to provide more context if it was actually needed.
Which version of SwiftLint are you using? We made a fix for this a while ago (but could be a regression!)
@marcelofabri no violations found, but it is being autocorrected anyway. v0.22.0 and v0.23.0.
OK, I could reproduce, thanks!
Fixing this is probably tricker than I thought, since the rules themselves overwrite the files contents. Ideally, we'd special case the shebang so no rule would have to know about it, but I couldn't come up with a simple way to do it. Maybe @jpsim has any ideas?
Possible idea:
Hack File.ruleEnabled
, and from within, hard code disabling shebangs, or treat a shebang as a LOC with disable flag for all rules.
I think that was the original implementation, but at some point we moved the check to Linter
.
We ran into this issue too. It would be nice to get a fix, so we can have our automations run on all of our swift files. Thanks
Seems since #1700 in linting the shebang is ignored, but autocorrect still manipulates the shebang swiftlint version 0.32.0
This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!
This is still an issue, autocorrect moves #!/usr/bin/swift
to #!/usr / bin / swift
New Issue Checklist
Bug Report
Environment
swiftlint version
to be sure)?