Skip to content

ruff not reading nested config in lsp-mode #4831

@lunik1

Description

@lunik1

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

When running the ruff LSP server I am not seeing diagnostics I have enabled using a pyproject.toml in a subdirectory. This behaviour cannot be reproduced with VSCode, eglot, or the standalone ruff-lsp server. Please see the bug ticket on the ruff repository for more context astral-sh/ruff#19200.

Steps to reproduce

There is a mwe at this repo: https://github.com/lunik1/ruff-server-bug-mwe

Start lsp-mode + ruff server at the root, and open main.py.

Expected behavior

main.py contains some code that violates F401 (a default rule enabled with the top-level config) and RUF005 (enabled in the subdirectory's config), but only the former is reported.
Image

I expected both to be reported, and this is the case when using ruff-lsp or the ruff cli.

Which Language Server did you use?

ruff server

OS

MacOS

Error callstack

Anything else?

This comment has logs from Emacs and VSCode, showing it does not read the nested pyproject.toml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions