-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support formatters with different working directories #5
Comments
quote from the comments in the package:
perhaps you can use this to create a sh -c 'cd "..." && your-formatter' |
Hi @pmiddend! Which formatter is that? It's unusual to have a formatter which works on STDIN/STDOUT but needs to be run from the root of a project. Since
Ah, this won't work, because "program" must be the actual executable, not a command string, since it's passed to |
(Funnily enough, I contributed the code which allows |
@purcell it's https://github.com/asottile/reorder_python_imports and I admit it's pretty strange |
The source code of that script suggests that it doesn't use STDIN/STDOUT anyway, so presumably you're passing it arguments that rely on |
It actually does use STDIN/STDOUT, though I completely understand that you want to limit reformatter.el's scope and not support every hacky formatter out there ;) |
what about my earlier comment, but use /bin/sh as the executable, and do the "cd ... && ..." part in |
@purcell first of all, thanks a lot for this code! It really helps :) I'll build the case for this feature with a valid case of a non-awkward formatter. Elixir Mix Format taskUsing (reformatter-define elixir-format
:program "mix"
:args '("format" "-")) It just works. The problem is with a specific optionm This could be thought as a valid pattern in other languages too. I'd really appreciate if this could be built in Thanks once again for your wonderful work on Emacs. |
I, unfortunately, have a formatter that requires it to be run from the project's root directory. In my hand-written formatter, I pass
projectile-project-root
to the started subprocess. reformatter.el doesn't seem to support this. Any way to implement this easily?The text was updated successfully, but these errors were encountered: