Questions tagged [swiftlint]

A tool to enforce Swift style and conventions, loosely based on GitHub's Swift Style Guide. SwiftLint hooks into Clang and SourceKit to use the AST representation of your source files for more accurate results.

A tool to enforce Swift style and conventions, loosely based on GitHub's Swift Style Guide. SwiftLint hooks into Clang and SourceKit to use the AST representation of your source files for more accurate results.

The tool verifies that your Swift code conforms to a set of rules syntactic rules defined by you and your teammates.

More details at SwiftLint Github.

185 questions
-1
votes
4 answers

SwiftLint Warning: File Name Violation. How can I fix it?

I am using SwiftLint to clean up my code formatting of the project. I met a File Name Violation warning. I tried many ways but I can't fix it. Those are what I did: Create a class -> LoginPageViewController. Got a warning -> Length of class name…
LightOwlGG
  • 139
  • 10
-1
votes
1 answer

Lint for Swift in Xcode

I found SwiftLint included it in my podfile and did a pod install. I cannot find where to invoke it in my build phases. I would be grateful for pointers and maybe a line or two of clarification.
user462990
  • 5,472
  • 3
  • 33
  • 35
-1
votes
2 answers

How to safely force unwrap time in dictionary

I have an issue. I have a dictionary type [String: Any] my code that works is dict["start"] = "\(start.hour!):\(start.minute!)" if let end = end { dict["end"] = "\(end.hour!):\(end.minute!)" } But as I use swiftlint it throws me an error for…
Jkrist
  • 748
  • 1
  • 6
  • 24
-1
votes
1 answer

SwiftLint: Could not cast value of type 'Swift.Int64' to 'Swift.String', Build SwiftLint

I am integrating Swiftlint with my project in Xcode 9, Swift 4. I installed swiftlint with Cocoapods. My Podfile looks like this: # Uncomment the next line to define a global platform for your project platform :ios, '10.0' target 'my_target' do …
-3
votes
1 answer

Refactor a switch statement with cyclomatic complexity

Currently i am getting the warning "Cyclomatic Complexity Violation: Function should have complexity 8 or less: currently complexity equals 9 (cyclomatic_complexity)" I want to refactor it so it doesn't show the warning anymore My code is below
LenKen
  • 1
  • 2
1 2 3
12
13