Skip to content

Conversation

@otakutyrant
Copy link
Contributor

@otakutyrant otakutyrant commented May 26, 2025

Summary

I struggled to make ruff_organize_imports work and then I found out I missed the key note about conform.nvim before because it was put in the Vim section wrongly! So I refined them both.

I struggled to make ruff_organize_imports work and then I found out I missed the key note about conform.nvim before because it was in the Vim section! So I refine them both.
@MichaReiser MichaReiser requested a review from dhruvmanila May 26, 2025 16:50
@AlexWaygood AlexWaygood added the documentation Improvements or additions to documentation label May 26, 2025
Copy link
Member

@dhruvmanila dhruvmanila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I made a couple of edits mainly around rearranging the ALE plugin section.

@dhruvmanila dhruvmanila changed the title [ruff] Update setup.md about Neovim and Vim Update editor setup docs about Neovim and Vim Jun 3, 2025
@dhruvmanila dhruvmanila enabled auto-merge (squash) June 3, 2025 07:39
@dhruvmanila dhruvmanila merged commit d1cb8e2 into astral-sh:main Jun 3, 2025
33 checks passed
dcreager added a commit that referenced this pull request Jun 3, 2025
…aration

* origin/main:
  [ty] Infer `list[T]` when unpacking non-tuple type (#18438)
  [ty] Meta-type of type variables should be type[..] (#18439)
  [`pyupgrade`] Make fix unsafe if it deletes comments (`UP050`) (#18390)
  [`pyupgrade`] Make fix unsafe if it deletes comments (`UP004`) (#18393)
  [ty] Support using legacy typing aliases for generic classes in type annotations (#18404)
  Use ty's completions in playground (#18425)
  Update editor setup docs about Neovim and Vim (#18324)
  Update NPM Development dependencies (#18423)
  Infer `list[T]` for starred target in unpacking (#18401)
  [`refurb`] Mark `FURB180` fix unsafe when class has bases (#18149)
  [`fastapi`] Avoid false positive for class dependencies (`FAST003`) (#18271)
carljm added a commit to mtshiba/ruff that referenced this pull request Jun 4, 2025
* main:
  [ty] Add tests for empty list/tuple unpacking (astral-sh#18451)
  [ty] Argument type expansion for overload call evaluation (astral-sh#18382)
  [ty] Minor cleanup for `site-packages` discovery logic (astral-sh#18446)
  [ty] Add generic inference for dataclasses (astral-sh#18443)
  [ty] dataclasses: Allow using dataclasses.dataclass as a function. (astral-sh#18440)
  [ty] Create separate `FunctionLiteral` and `FunctionType` types (astral-sh#18360)
  [ty] Infer `list[T]` when unpacking non-tuple type (astral-sh#18438)
  [ty] Meta-type of type variables should be type[..] (astral-sh#18439)
  [`pyupgrade`] Make fix unsafe if it deletes comments (`UP050`) (astral-sh#18390)
  [`pyupgrade`] Make fix unsafe if it deletes comments (`UP004`) (astral-sh#18393)
  [ty] Support using legacy typing aliases for generic classes in type annotations (astral-sh#18404)
  Use ty's completions in playground (astral-sh#18425)
  Update editor setup docs about Neovim and Vim (astral-sh#18324)
  Update NPM Development dependencies (astral-sh#18423)
@BarrensZeppelin
Copy link

FWIW 3rd party plugins are not required, native LSP works as well with a config like this:

local ms = vim.lsp.protocol.Methods
vim.lsp.config("ruff", {
  on_attach = function(client, bufnr)
    -- Set a keymap to both ruff fix and ruff format
    vim.keymap.set("n", "<Leader>f", function()
      client:request_sync(ms.workspace_executeCommand, {
        command = "ruff.applyAutofix",
        arguments = { { uri = vim.uri_from_bufnr(bufnr), version = vim.lsp.util.buf_versions[bufnr] } },
      }, 1000, bufnr)
      vim.lsp.buf.format({
        async = true,
        bufnr = bufnr,
        id = client.id,
      })
    end, { buffer = bufnr, desc = "Format buffer with ruff" })
  end,
} --[[@as vim.lsp.Config]])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants