lassik / emacs-format-all-the-code

Auto-format source code in many languages with one command
https://melpa.org/#/format-all
MIT License
623 stars 108 forks source link

Add support for the python formatter ruff #247

Closed doolio closed 1 year ago

lassik commented 1 year ago

Thanks! LGTM.

Please add ruff (with a link to its home page) to README.md as well.

doolio commented 1 year ago

Would you like me to squash into one commit?

doolio commented 1 year ago

Aside: Just for my own education do you happen to know what the "-" argument represents? I included it as the last argument because I've seen it here and elsewhere (e.g. The docstring for python-flymake-command when it describes how to use flake8 instead of pyflakes though it this case these are linters and not formatters but I think the argument is serving the same purpose) but I'm not entirely sure what is for and if it is necessary in all cases.

lassik commented 1 year ago

Thanks!

Would you like me to squash into one commit?

No need. I can do a "squash and merge" from GitHub's UI.

Just for my own education do you happen to know what the "-" argument represents?

When - is used instead of a filename, it generally means the program should read from standard input, or write to standard output, instead of using an input or output file. This convention is very common among all kinds of Unix programs.

The docstring for python-flymake-command when it describes how to use flake8 instead of pyflakes though it this case these are linters and not formatters but I think the argument is serving the same purpose)

It almost certainly has the same purpose, yes.

doolio commented 1 year ago

When - is used instead of a filename, it generally means the program should read from standard input, or write to standard output, instead of using an input or output file. This convention is very common among all kinds of Unix programs.

I see. Thanks for taking the time to explain. Perhaps then it or --stdin-filename=stdin is unnecessary then in that case.

lassik commented 1 year ago

Perhaps then it or --stdin-filename=stdin is unnecessary then in that case.

I don't know. That's not astandard convention; it depends on the details of each program.

doolio commented 1 year ago

Removing the "-" and it still works but it seems --stdin-filename=stdin is necessary and the value must be stdin.

lassik commented 1 year ago

Removing the "-" and it still works

That makes sense. It often works.

but it seems --stdin-filename=stdin is necessary and the value must be stdin.

That's weird. The value of --stdin-filename shouldn't matter.