realm / SwiftLint

A tool to enforce Swift style and conventions.
https://realm.github.io/SwiftLint
MIT License
18.58k stars 2.22k forks source link

Warnings and errors do not appear in Xcode 8 editor #1612

Closed prnewman closed 7 years ago

prnewman commented 7 years ago

SwiftLint is an amazing tool, but my team has been unable to get the warnings and errors to appear in Xcode 8.3.2 after adding a build phase as described here:

https://github.com/realm/SwiftLint#xcode

We get SwiftLint's output in Xcode's Report Navigator, but when you drill down to the offending line in a class, it is not highlighted yellow or red as you would expect:

https://github.com/realm/SwiftLint#defining-custom-rules

For what it's worth, if we lint using Tailor in the build phase, the classes are highlighted with the corresponding warnings.

marcelofabri commented 7 years ago

This works for me, can you setup a sample project with this issue? Thanks!

prnewman commented 7 years ago

@marcelofabri Thanks, I'll try to come up with something.

prnewman commented 7 years ago

I added Swiftlint to a new project and the warnings appear in the Xcode editor. So I'll have to figure out what's different about the project where the warnings do not appear. Thanks for your help!

marcelofabri commented 7 years ago

Thanks! Please share the outcome of your research later 😉

prnewman commented 7 years ago

@marcelofabri Incredibly, the issue was resolved by removing the included section from the swiftlint yaml file:

included: # paths to include during linting. `--path` is ignored if present.
  - WWMobile

We retained the excluded section that follows it:

excluded: # paths to ignore during linting. Takes precedence over `included`.
  - Pods
marcelofabri commented 7 years ago

@prnewman If you can come up with a sample project, please open a new issue. That shouldn't happen.

prnewman commented 7 years ago

@marcelofabri The bug has to do with case-sensitivity.

This works:

included:
  - WWMobile

This does not (notice one lowercase 'w'):

included:
  - WwMobile

Sent you sample app.

adriansergheev commented 5 years ago

I have the same issue, Xcode Version 10.1 (10B61), on two different projects ( both started from scratch).

Funny thing is, one of my past co-workers didn't experienced the issue, on the same project I did, so same configuration file,

Maybe there are some Xcode settings responsible for this issue here?

nteissler commented 5 years ago

totally deleting my included section made the errors show up immediately. Then I realized it was because my included section was getting the file paths wrong. Swiftlint was robust enough to still show the errors in the navigation, but I had to make sure all my paths were relative to .swiftlint.yml and case-sensitive

adriansergheev commented 5 years ago

totally deleting my included section made the errors show up immediately. Then I realized it was because my included section was getting the file paths wrong. Swiftlint was robust enough to still show the errors in the navigation, but I had to make sure all my paths were relative to .swiftlint.yml and case-sensitive

doesn't change anything for me. Still the same thing, errors shown only in logs, but not in the editor.

GabrielTargon commented 5 years ago

totally deleting my included section made the errors show up immediately. Then I realized it was because my included section was getting the file paths wrong. Swiftlint was robust enough to still show the errors in the navigation, but I had to make sure all my paths were relative to .swiftlint.yml and case-sensitive

doesn't change anything for me. Still the same thing, errors shown only in logs, but not in the editor.

For me too, still facing the same problem in the project even removing Excluded and Included

JillevdW commented 5 years ago

A quick sanity check for other people that are running into this: make sure you have the reporter property in your .swiftlint.yaml file set to "xcode". If you've been playing around with getting this to work in the AppCode IDE then you might have this property set to "csv" instead, and that of course won't make the errors show up in Xcode 😄

adriansergheev commented 5 years ago

nothing changed all this time, still the same bug

gwsounddsg commented 4 years ago

I hate when people do this, but I also have the same problem. I think this issue needs to be reopened. I might just create a new issue with the same info, and link to this if it doesn't reopen.

macOS: 10.14.6 AppCode: 2019.3.2 Swiftlint For AppCode: 1.10.3 Swiftlint Command Line: 0.38.1

jpsim commented 4 years ago

@gwsounddsg yes please open a new issue, you appear to be having issues integrating SwiftLint with AppCode, which is separate than the issue originally reported in this thread.