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

Comments

Projects
None yet
3 participants
@norio-nomura
Collaborator

norio-nomura commented Feb 8, 2017

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

@marcelofabri

This comment has been minimized.

Show comment
Hide comment
@marcelofabri

marcelofabri Feb 21, 2017

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.

Collaborator

marcelofabri commented Feb 21, 2017

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

This comment has been minimized.

Show comment
Hide comment
@ChristopherRogers

ChristopherRogers Jul 12, 2017

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

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

Ignore shebang in all rules
By making a creative use of regions.
Fixes #1294.

marcelofabri added a commit that referenced this issue Jul 21, 2017

Ignore shebang in all rules
By making a creative use of regions.
Fixes #1294.

marcelofabri added a commit that referenced this issue Jul 22, 2017

Ignore shebang in all rules
By making a creative use of regions.
Fixes #1294.

marcelofabri added a commit that referenced this issue Jul 23, 2017

Ignore shebang in all rules
By making a creative use of regions.
Fixes #1294.

marcelofabri added a commit that referenced this issue Jul 23, 2017

Ignore shebang in all rules
By making a creative use of regions.
Fixes #1294.

marcelofabri added a commit that referenced this issue Jul 25, 2017

Ignore shebang in all rules
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