SwiftLintAppCode icon indicating copy to clipboard operation
SwiftLintAppCode copied to clipboard

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

Open gabatx opened this issue 3 years ago • 8 comments

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.

gabatx avatar Oct 18 '22 11:10 gabatx

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

bealex avatar Oct 18 '22 11:10 bealex

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)

AlesMMichalek avatar Oct 20 '22 12:10 AlesMMichalek

@AlesMMichalek Thanks!

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

bealex avatar Oct 20 '22 12:10 bealex

Did you make the update?

icedice avatar Nov 17 '22 12:11 icedice

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

icedice avatar Nov 17 '22 12:11 icedice

@AlesMMichalek Thanks!

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

Hi @bealex , did you fix this issue?

arham-saeed avatar Jan 18 '23 14:01 arham-saeed

@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.

bealex avatar Jan 18 '23 14:01 bealex

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 :-(

AleMaMi avatar Feb 02 '23 18:02 AleMaMi