Skip to content
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

shebang should be ignored by all rules #1294

Closed
norio-nomura opened this issue Feb 8, 2017 · 2 comments
Closed

shebang should be ignored by all rules #1294

norio-nomura opened this issue Feb 8, 2017 · 2 comments
Labels
enhancement Ideas for improvements of existing features and rules.

Comments

@norio-nomura
Copy link
Collaborator

Current implementation detects two operator_usage_whitespace violations in shebang.
e.g:

$  echo '#!/usr/bin/env swift'|swiftlint lint --enable-all-rules --use-stdin
<nopath>:1:7: warning: Operator Usage Whitespace Violation: Operators should be surrounded by a single whitespace when they are being used. (operator_usage_whitespace)
<nopath>:1:11: warning: Operator Usage Whitespace Violation: Operators should be surrounded by a single whitespace when they are being used. (operator_usage_whitespace)
Done linting! Found 2 violations, 0 serious in 1 file.

screenshot 2017-02-08 19 24 04

@norio-nomura norio-nomura added the enhancement Ideas for improvements of existing features and rules. label Feb 8, 2017
@marcelofabri
Copy link
Collaborator

Maybe we should do some pre-processing in SwiftLint before passing the contents to the rules? This feels hacky and potentially dangerous with offsets, positioning, etc, but I don't think all the rules should treat this by theirselves.

@ChristopherRogers
Copy link

ChristopherRogers commented Jul 12, 2017

I'd like to add that if used with autocorrect, it turns into #!/usr / bin / env swift.

marcelofabri added a commit that referenced this issue Jul 21, 2017
By making a creative use of regions.
Fixes #1294.
marcelofabri added a commit that referenced this issue Jul 21, 2017
By making a creative use of regions.
Fixes #1294.
marcelofabri added a commit that referenced this issue Jul 22, 2017
By making a creative use of regions.
Fixes #1294.
marcelofabri added a commit that referenced this issue Jul 23, 2017
By making a creative use of regions.
Fixes #1294.
marcelofabri added a commit that referenced this issue Jul 23, 2017
By making a creative use of regions.
Fixes #1294.
marcelofabri added a commit that referenced this issue Jul 25, 2017
By making a creative use of regions.
Fixes #1294.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Ideas for improvements of existing features and rules.
Projects
None yet
Development

No branches or pull requests

3 participants