Skip to content
This repository has been archived by the owner on Sep 6, 2018. It is now read-only.

Swiftlint reporting issues but build passes #31

Closed
Liquidsoul opened this issue May 7, 2017 · 1 comment
Closed

Swiftlint reporting issues but build passes #31

Liquidsoul opened this issue May 7, 2017 · 1 comment
Milestone

Comments

@Liquidsoul
Copy link
Member

Liquidsoul commented May 7, 2017

Steps to reproduce

From Xcode:

  1. clone the repository
  2. open the workspace
  3. run the tests

Results: build and tests passes but 10 buildtime errors are reported (identifier_name swiftlint errors)

From command line:

  1. clone the repository
  2. run rake lint:code

Results: command fails with the following output.

Output
== Linting the code ==
swiftlint lint --no-cache --strict --path Sources
Linting Swift files at path Sources
Linting 'AssetsCatalogParser.swift' (1/11)
Linting 'ColorsFileParser.swift' (2/11)
Linting 'FontsFileParser.swift' (3/11)
Linting 'StoryboardParser.swift' (4/11)
Linting 'StringsFileParser.swift' (5/11)
Linting 'AssetsCatalogContext.swift' (6/11)
Linting 'ColorsContext.swift' (7/11)
Linting 'FontsContext.swift' (8/11)
Linting 'StoryboardsContext.swift' (9/11)
Linting 'StringsContext.swift' (10/11)
Linting 'Command.swift' (11/11)
S/Users/sebastienduperron/Perso/wiftGen/SwiftGenKit/Sources/Parsers/FontsFileParser.swift:72:21: warning: Unused Optional Binding Violation: Prefer `!= nil` over `let _ =` (unused_optional_binding)
SwiftGen/SwiftGenKit/Sources/Parsers/StringsFileParser.swift:11:8: error: Identifier Name Violation: Enum element name should start with a lowercase character: 'FailureOnLoading' (identifier_name)
SwiftGen/SwiftGenKit/Sources/Parsers/StringsFileParser.swift:12:8: error: Identifier Name Violation: Enum element name should start with a lowercase character: 'InvalidFormat' (identifier_name)
SwiftGen/SwiftGenKit/Sources/Parsers/StringsFileParser.swift:54:10: error: Identifier Name Violation: Enum element name should start with a lowercase character: 'Object' (identifier_name)
SwiftGen/SwiftGenKit/Sources/Parsers/StringsFileParser.swift:55:10: error: Identifier Name Violation: Enum element name should start with a lowercase character: 'Float' (identifier_name)
SwiftGen/SwiftGenKit/Sources/Parsers/StringsFileParser.swift:56:10: error: Identifier Name Violation: Enum element name should start with a lowercase character: 'Int' (identifier_name)
SwiftGen/SwiftGenKit/Sources/Parsers/StringsFileParser.swift:57:10: error: Identifier Name Violation: Enum element name should start with a lowercase character: 'Char' (identifier_name)
SwiftGen/SwiftGenKit/Sources/Parsers/StringsFileParser.swift:59:10: error: Identifier Name Violation: Enum element name should start with a lowercase character: 'Pointer' (identifier_name)
SwiftGen/SwiftGenKit/Sources/Parsers/StringsFileParser.swift:60:10: error: Identifier Name Violation: Enum element name should start with a lowercase character: 'Unknown' (identifier_name)
SwiftGen/SwiftGenKit/Sources/Parsers/ColorsFileParser.swift:22:35: error: Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'k' (identifier_name)
Done linting! Found 10 violations, 9 serious in 11 files.
rake aborted!
Command failed with status (2): [swiftlint lint --no-cache --strict --path ...]
SwiftGen/SwiftGenKit/rakelib/utils.rake:64:in `plain'
SwiftGen/SwiftGenKit/rakelib/utils.rake:18:in `run'
SwiftGen/SwiftGenKit/rakelib/lint.rake:22:in `block (2 levels) in <top (required)>'
Tasks: TOP => lint:code
(See full trace by running task with --trace)

Solutions

I see two possible solutions for this:

  1. fix the issues.
    This seems to work but maybe I am missing the big picture here and the impact on the main SwiftGen project.
  2. ignore the identifier_name rule with a .swiftlint.yml file or with comments where appropriate.

Solution 1 is already implemented here Liquidsoul@4b98f49

@djbe
Copy link
Member

djbe commented May 7, 2017

Hi @Liquidsoul,

You're welcome to create a PR to fix this, we somehow missed it during the swift 3 migration, and haven't noticed them until now. 🤷‍♂️

Funnily enough, I partially addressed this in #14.

Liquidsoul added a commit to Liquidsoul/SwiftGenKit that referenced this issue May 7, 2017
Liquidsoul added a commit to Liquidsoul/SwiftGenKit that referenced this issue May 7, 2017
Liquidsoul added a commit to Liquidsoul/SwiftGenKit that referenced this issue May 8, 2017
@djbe djbe added this to the 2.0.0 milestone May 8, 2017
Liquidsoul added a commit to Liquidsoul/SwiftGenKit that referenced this issue May 8, 2017
@djbe djbe closed this as completed May 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants