nvimtools / none-ls.nvim

null-ls.nvim reloaded / Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua.
The Unlicense
2.43k stars 72 forks source link

Fixes ruff python formatter #41

Closed jakenvac closed 9 months ago

jakenvac commented 9 months ago

Closed #40

This removes the broken duplicate ruff formatter and leaves only one working version.

bellini666 commented 9 months ago

@jakenvac @mochaaP ruff_format should not have been removed

It is not duplicated, it is a different command. ruff check/ruff fix only resolves issues with the linter, while ruff format is a different command that formats python code and replaces black

Both produce different outputs and are valid.

The changes to ruff.lua are fine, but ruff_format should be reverted back

bellini666 commented 9 months ago

For reference:

This is the ruff linter: https://docs.astral.sh/ruff/linter/, which can be called with ruff check and can be asked to auto fix validation errors by passing --fix to it, or calling it as ruff fix

This is the ruff formater: https://docs.astral.sh/ruff/formatter/, which can be called with ruff format

Mishosan commented 9 months ago

@jakenvac @mochaaP ruff_format should not have been removed

It is not duplicated, it is a different command. ruff check/ruff fix only resolves issues with the linter, while ruff format is a different command that formats python code and replaces black

Both produce different outputs and are valid.

The changes to ruff.lua are fine, but ruff_format should be reverted back

No, the changes to ruff.lua are NOT fine and should also be reverted! Now sorting of imports does not work anymore. See this: https://github.com/astral-sh/ruff/issues/8926

jakenvac commented 9 months ago

Apologies for the confusion and disruption to anyone relying on these. I tried both of the existing ruff formats & neither worked for me. It did after my change, however.

Must be something else going on on my end.

@mochaaP were you able to test this before approving & merging?

mochaaP commented 9 months ago

@mochaaP were you able to test this before approving & merging?

Sorry, but not recently. I've been busy with other stuff. 😔 If someone could take the reviews it will be very welcomed.

bellini666 commented 9 months ago

@mochaaP I saw that you invited me to the repo, and I accepted it

What we can do is define CODEOWNERS for some files, and they would be responsible for reviewing changes to those

For example, I can be the codeowner for ruff, flake8, isort, black and anything related to python. Glad to help by reviewing changes to those

Is there a place where we can talk about this together with other people interested in helping with the maintenance of this repo?

jakenvac commented 9 months ago

@bellini666 That's an excellent idea. I was also invited as a contributor & have been trying my best to chip in. However, clearly I shouldn't touch the python tools 😆

This project relies entirely on the community and I really don't want it to meet the same fate as null-ls.