bcomnes / sublime-standard-format

:sparkles: Runs standard --fix against the javascript in your ST3 window on save or manually.
https://packagecontrol.io/packages/StandardFormat
MIT License
60 stars 21 forks source link

Add filename placeholder #82

Closed carlpett closed 3 years ago

carlpett commented 3 years ago

This PR adds support for expanding placeholders in the commands setting. This is required for ts-standard, which has a flag --stdin-filename that is mandatory.

(I also added a fix so the plugin no longer outputs b'' to the console for successful runs)

carlpett commented 3 years ago

@bcomnes linting fixed, please let me know what you think!

bcomnes commented 3 years ago

Lgtm. Thank you! I'll do a release when I'm at the keys next time.

bcomnes commented 3 years ago

Going to test this out today. Just looking at it, the only thing that worries me is the context when a format is attempted on a buffer without a file path yet. The plugin will probably be fine, I'm just worried how the tool will behave if passed a flag with an empty value. Maybe its possible to disable formats on tools that need the replacement on these buffers.

bcomnes commented 3 years ago

Tested this out all day yesterday, no new bugs on my end. I'll do a release today. If anyone notices anything odd, please open issues.

bcomnes commented 3 years ago

Sorry, been a busy few weeks. I got this out on https://github.com/bcomnes/sublime-standard-format/releases/tag/v6.5.0

Should be in package control soon. Let me know if you run into any issues and thanks for figuring this out!

bcomnes commented 2 years ago

This came in handy today btw. Thanks for this. Been thinking I might make the defaults work better for these things.