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

force_unwrapping: False positive inside of strings when used as opt_in_rules #721

Closed
cmittendorf opened this issue Jul 12, 2016 · 1 comment
Labels
bug Unexpected and reproducible misbehavior.

Comments

@cmittendorf
Copy link

When using for_unwrapping as opt_in_rules in .swiftlint.yml

opt_in_rules:
  - force_unwrapping

the following line

print("\(xVar)!")

results in a false positive violation:

Loading configuration from '.swiftlint.yml'
Linting Swift files in current working directory
Linting 'test.swift' (1/1)
…/test.swift:3:15: warning: Force Unwrapping Violation: Force unwrapping should be avoided. (force_unwrapping)
Done linting! Found 1 violation, 0 serious in 1 file.

swiftlint version is 0.11.1

@jpsim
Copy link
Collaborator

jpsim commented Jul 12, 2016

Yes, that would happen! This is a bug and should be relatively easy to fix.

@jpsim jpsim added the bug Unexpected and reproducible misbehavior. label Jul 12, 2016
daniel-beard pushed a commit to daniel-beard/SwiftLint that referenced this issue Jul 12, 2016
jpsim added a commit that referenced this issue Jul 12, 2016
…se_positive

Fix force unwrap false positive. Fixes #721
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected and reproducible misbehavior.
Projects
None yet
Development

No branches or pull requests

2 participants