Skip to content

ruff config in pyproject.toml #1792

Answered by tvannahl
tvannahl asked this question in Q&A
Sep 19, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

No judgment for as long as its formatted automatically ;-).

I've been able to solve the issue for me just now. Hoping it helps you as well:

  1. It's not mason.vim who is doing the formatting. This is done by conform.nvim instead. You can check the formatter configuration using :ConformInfo.
  2. There are more formatters than just one ruff formatter. I've configured most of them using the following configuration:
return {
  {
    "stevearc/conform.nvim",
    opts = {
      formatters_by_ft = {
        python = { "ruff", "ruff_organize_imports", "ruff_format" },
      },
    },
  },
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@tvannahl
Comment options

Answer selected by tvannahl
@0gust1
Comment options

@tvannahl
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants