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

False positive in array_init rule with prefix operators #1877

Closed
2 tasks done
marcelofabri opened this issue Oct 4, 2017 · 2 comments
Closed
2 tasks done

False positive in array_init rule with prefix operators #1877

marcelofabri opened this issue Oct 4, 2017 · 2 comments
Labels
bug Unexpected and reproducible misbehavior.

Comments

@marcelofabri
Copy link
Collaborator

New Issue Checklist

Bug Report

$ Pods/SwiftLint/swiftlint lint --path file.swift                                         
Loading configuration from '.swiftlint.yml'
Linting Swift files at path file.swift
Linting 'file.swift' (1/1)
file.swift:1:1: warning: Array Init Violation: Prefer using Array(seq) than seq.map { $0 } to convert a sequence into an Array. (array_init)
Done linting! Found 1 violation, 0 serious in 1 file.

Environment

  • SwiftLint version (run swiftlint version to be sure)? 0.23.0
  • Installation method used (Homebrew, CocoaPods, building from source, etc)? CocoaPods
  • Paste your configuration file:
opt_in_rules:
  - array_init

No

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

Xcode 9

  • Do you have a sample that shows the issue? Run echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
    to quickly test if your example is really demonstrating the issue. If your example is more
    complex, you can use swiftlint lint --path [file here] --no-cache --enable-all-rules.
array.map { !$0 }
@marcelofabri marcelofabri added the bug Unexpected and reproducible misbehavior. label Oct 4, 2017
@ArchieR7
Copy link

ArchieR7 commented Jan 2, 2019

same as here, does anyone know how to fix this issue?

@marcelofabri
Copy link
Collaborator Author

@ArchieR7 feel free to send a PR fixing this! Let me know if you have any questions ☺️

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