bealex / SwiftLintAppCode

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

I can't get "Run swiftlist autocorrect" (⌥⏎) in AppCode to work. #70

Open gabatx opened 1 year ago

gabatx commented 1 year ago

Hi, I'm trying to get the option to work that pops up when I press ⌥⏎ in AppCode where it says "Run swiftlist autocorrect" but I can't get it to work. I have to say that it works perfectly the autocorrect works when I enter the command "swiftlint -fix filename.swift" in the terminal. Any solution?. Thanks.

bealex commented 1 year ago

Hi, can you provide some code and which problem you want to fix with the autocorrect?

AlesMMichalek commented 1 year ago

Same for me. It is perhaps related to swiftlint version 0.49.0 (and later), because command for autocorrect was removed:

The autocorrect command that was deprecated in 0.43.0 has now been
completely removed. Use --fix instead.

(https://github.com/realm/SwiftLint/releases/tag/0.49.0)

bealex commented 1 year ago

@AlesMMichalek Thanks!

Why can't they stay with the interface... Now I need to prepare an update.

icedice commented 1 year ago

Did you make the update?

icedice commented 1 year ago

btw. reverting to 0.48 did fix it for me...

arham-saeed commented 1 year ago

@AlesMMichalek Thanks!

Why can't they stay with the interface... Now I need to prepare an update.

Hi @bealex , did you fix this issue?

bealex commented 1 year ago

@arham-saeed I did. Unfortunately, JB kinda broke old plugin development workflow, and new one (with the new Gradle plugin) is not fully supporting AppCode yet. So I'm in a stupid position of wanting to do something but being unable to build the plugin.

My plan is (and always was) to return to this problem every couple of weeks and try again. Next iteration will be this weekend. I'll know by Monday was it a success or not.

AleMaMi commented 1 year ago

AppCode is ... dead :-( I do not expect any effort to fix this plugin. For those who want to use AppCode to the very end, I have naive and stupid solution:

Small shell script

#!/usr/bin/env sh

SWIFTLINT=/opt/homebrew/bin/swiftlint
fix=""

if [ "$1" = "autocorrect" ]; then
    shift;
    fix="--fix "
fi

$SWIFTLINT $fix $@

and put the script to AppCode plugin configuration instead of real binary.

Please, take it with a pinch of salt, but it works for me.

R.I.P AppCode :-(