google / vim-codefmt

Vim plugin for syntax-aware code formatting
Apache License 2.0
1.11k stars 114 forks source link

Add ruff as formatter for Python #223

Closed Bidaya0 closed 1 month ago

Bidaya0 commented 1 year ago

Formatter tool ruff

Filetype(s)

Additional context

dbarnett commented 1 year ago

Hadn't heard about ruff yet but it looks great!

As a formatter, do you know if

st1020 commented 1 year ago

@dbarnett As far as I know, ruff is more of a linter than a formatter. But because it has autofix support, it can also be regarded as a formatting tool (and it also have some rules related to code format).

Bidaya0 commented 1 year ago

Hadn't heard about ruff yet but it looks great!

As a formatter, do you know if

  • it has built-in support for range formatting (updating only a few target lines out of a file, plus whatever surrounding lines it needs to touch to make a complete valid formatting change)
  • its formatting decisions tend to be stable (avoid fighting with existing valid formatting when there are multiple valid ways to format a piece of code, such as a list that's short enough to fit on one line) ?

Sorry for the late reply, the situation with the library is basically as described by st1020