SwiftLintAppCode icon indicating copy to clipboard operation
SwiftLintAppCode copied to clipboard

SwiftLint triggers FileWatch plugin

Open markeissler opened this issue 3 years ago • 5 comments

This is an issue that has occurred previously:

Issue #51: Swiftlint plugin is triggering the plugin File Watcher

It's not clear what the resolution was before or if the issue was, in fact, resolved since the issue reporter did not respond for further comments.

In particular, I have a watcher setup to trigger swiftformat on a file save. With all other inspections disabled, any change to a file (without manually saving, auto-save disabled) results on swiftlint running but then also a trigger of the swiftformat File Watcher as the file is visibly reformatted.

markeissler avatar Feb 11 '22 18:02 markeissler

Well, this is a tough one. We need to save a file so that SwiftLint is able to process it (as I've said already, I do not know how to successfully use stdin instead of a file). So yes, SwiftLint saves file before checking it (src/com/lonelybytes/swiftlint/annotator/SwiftLintHighlightingAnnotator.kt:82). And yes, it does not work without it.

Don't have a solution for this for now :(

PS. If you need specific Swift formatting rules, please tell JetBrains about that. They are really awesome in formatting other languages, it is very sad that Swift is not being formatted properly. I'm trying to improve that, but more bugs/votes will always help.

bealex avatar Feb 11 '22 19:02 bealex

No problem. I'll see if I can dig into this a little more.

markeissler avatar Feb 11 '22 19:02 markeissler

It's not clear what the resolution was before or if the issue was

Possibly I just tried to experiment with stdin solution and thought that everything will be cool. :-)

bealex avatar Feb 11 '22 19:02 bealex

Any development on this? I'm using Injection to hot refresh my UI when developing and because of the constant persisting of the files the hot reload goes crazy....

icedice avatar Nov 21 '22 08:11 icedice

Unfortunately no, sorry. Right now I need to find out how to use new plugin framework for IJ IDEs. I will update the plugin itself right after.

bealex avatar Nov 21 '22 08:11 bealex