Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruff linter is not working #8

Open
jarryngandjui opened this issue Dec 27, 2024 · 4 comments
Open

Ruff linter is not working #8

jarryngandjui opened this issue Dec 27, 2024 · 4 comments

Comments

@jarryngandjui
Copy link
Owner

No description provided.

@jarryngandjui
Copy link
Owner Author

jarryngandjui commented Dec 27, 2024

Ruff is included in pylsp
https://github.com/python-lsp/python-lsp-ruff. However, it is not picking up my ruff.toml files locally.

lspconfig.pylsp.setup {
  on_attach = nvlsp.on_attach,
  on_init = nvlsp.on_init,
  capabilities = nvlsp.capabilities,
  settings = {
    pylsp = {
      plugins = {
        ruff = {
          enabled = true,
          formatEnabled = true,
          organizeImports = true,
        },
        black = { enabled = true },
        mypy = { enabled = true },
        pycodestyle = { enabled = false },
        flake8 = { enabled = false }, -- duplicate ruff warnings
        pylint = { enabled = false }, -- duplicate ruff warnings
        isort = { enabled = false, profile = "black" }, -- duplicate ruff sorting
      },
      filetypes = { "python" },
    },
  },
}

@jarryngandjui
Copy link
Owner Author

python-lsp/python-lsp-ruff#91 (comment)

The ruff.toml project config file is not being used. pyslp-ruff has issues recognizing the root of the project. However, adding pyproject.toml does not fix my issues as described.

@jarryngandjui
Copy link
Owner Author

I am switching to pipx to install and manage global dependencies such as the python lsp. Others have had better success and less issues with this package manager.
https://github.com/pypa/pipx/tree/main

@jarryngandjui
Copy link
Owner Author

Back in 2023, ruff configs could only be passed via the pyproject.toml file. python-lsp/python-lsp-ruff#28 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant