Closed meliache closed 7 months ago
We do this for the phpcs formatter:
If you add a script to that directory then it will be automatically available on Apheleia's $PATH
.
The advantage of this approach is that you can identify the specific nonzero exit codes that are to be ignored, but other presumably unexpected errors such as interrupts will not be treated as success.
I had totally missed the scripts
directory. So turns out docformatter
is really not the only formatter with this behavior and that there's no easy way to solve this purely via apheleia-formatters
customization.
That wasn't the main part of the issue, but could we add docformatter then? Maybe I should then just do the PR
I tried setting up docformatter as a formatter for formatting python docstrings. By default it outputs a diff but with
--in-place
it fixes the file.But it didn't work for me because in both modes of operation returns a non-zero error code when it found a style mistake, even if it successfully fixed it with
--in-place
. Can I somehow suppress the error. I tried adding toapheleia-formatters
the elementBut this
||
didn't work due to shell escaping in Emacs and probablymake-process
doesn't allow for pipes anyway.Anyway, I my temorary solution was just to write a bash script wrapper that adds docformatter and suppresses errors, but that solution isn't nice...