bealex / SwiftLintAppCode

Provides highlighting of the SwiftLint errors in the AppCode
MIT License
52 stars 8 forks source link

.swiftlint.yml ignored when running "Inspect Code" in AppCode #21

Closed adamjmurray closed 7 years ago

adamjmurray commented 7 years ago

I'm using the SwiftLint AppCode plugin and it mostly works as expected. When I build in AppCode, it shows me the same warnings I get when I run swiftlint on the command line.

AppCode has a feature where you can "Inspect Code" separately from the build process (for example: right click a folder in the project pane and select "Inspect Code..." from the context menu). This is IMO a nicer workflow to review and fix SwiftLint issues along with other inspection results.

Unfortunately it seems using "Inspect Code" causes SwiftLint to run with the default ruleset instead of using my .swiftlint.yml config. That's my guess, because I am getting hundreds of extra warnings. I checked my AppCode preferences for inspections and SwiftLint settings, and don't see a way to address this.

It's not a huge deal, but is this a fixable issue? Any workarounds?

PS - Thanks for making this plug-in!

bealex commented 7 years ago

Thanks for the kind words!

That is very odd behaviour. I've used "Run Inspection by Name" from the menu and it worked as intended.

But I'll check this.

reitzig commented 7 years ago

I thought the plugin ignored the config file, anyway?

bealex commented 7 years ago

Plugin should use the config file if it is placed in the project folder, but it will not automatically rerun after config file is being changed (that is a known thing).

mekarthedev commented 7 years ago

In my case (plugin v1.8) when I use "Run Inspection by Name" it actually takes my .swiftlint.yml settings into account except for included / excluded settings. It suggests me to chose the file scope to run on, but I can't see a way to tell it to run using my .swiftlint.yml's included / excluded paths.

Maybe I'm missing something?

bealex commented 7 years ago

I'm sorry but there are no plans to do this. Inspection is working on all project files and should not use this specific setting for exclude/include files. Please use AppCode scope feature for this.

mekarthedev commented 7 years ago

I'm actually using Custom Scope as an alternative. It's just a little inconvinient having to duplicate excluded paths set in two places.

Anyway, thanks for great plugin.