feat: swiftformat.path workspace-local overrides - #61
Conversation
|
While I get the use case for this PR, I am not really convinced regarding the potential security risk vs actual use tradeoff. In my opinion project specifics should not require global solutions that might conflict with other projects. Instead you could create a global shell script that performs the check up and decides which path of swiftformat to use and set If #59 (comment) is correct, could you have a look what it does different there? In theory the 3 extensions for swiftformat, apple's swift-format and SwiftLint should behave similarly. If there is such a central difference, this is likely a bug or unwanted inconsistency. In the end take all of this with a grain of salt as I am no longer part of the swift or vscode communities and don't use any of these anymore. Also I will only be notified by pull requests, not issues. I can review this, but cannot provide any guarantees when or if I do as it requires me quite a lot of ceremony to set everything up before the review and frankly does not provide any benefit for me. I hope you understand and that I could be a little bit helpful here and there. |
|
The decisive difference to the SwiftLint extension is this line. Changing it to At the moment, local paths work, but they need to be configured centrally in the user |
SimplyDanny
left a comment
There was a problem hiding this comment.
Would you like to the make the necessary adaptions in the package manifest, @maximkrouk?
The proposed changes are not required to make it work.
|
I guess if changes in package manifest are sufficient (those changes are at least necessary) and path option allows to set relative path to swiftformat binary than it's much better to just introduce mentioned manifest mods. From readme and high level code overview it looked like only global binaries are supported 🤔 |
|
If you set an explicit (local) path, it will be preferred. |
Yes, but afaiu it returns string as it is and is used here so the path should be global, not workspace-related 🤔 I'm a bit confused because from looking at code it shouldn't work with local paths, but even release version seem to work (with global settings override) with workspace-local path 🌚 |
45130f3 to
91c93d1
Compare
|
I reverted changes in |
The code you are referring to falls back to |
|
I guess it should be fine now to be merged and released 👉👈 |
|
Great work from you two! @SimplyDanny I trust you, if it's fine for you, it's fine for me. Feel free to merge and release PRs. :) |
I'm not sure if it works, so it would be cool if you could check it, but the idea is to resolve relative paths so that users of this extension will be able to set project-specific executables.
Current implementation should try to resolve local path and in case it fails (no matching local path found) it will run fallback logic for the global path.