Skip to content

The Ruff VS Code extension uses the wrong ruff.toml file #28483

Description

@ebbek

Summary

I have a bunch of projects that do not follow the PEP8 formatting rules (longer lines and non-standard indentation). For these I have made custom ruff.toml file that is referred to in the respective pyproject.toml files like this:

[tool.ruff]
extend = "~/projects/notpep8/ruff.toml"

The file structure is like this:

~/projects --- notpep8 -+- ruff.toml
                        |
                        +- proj -+- pyproject.toml
                        |        |
                        |        +- src --- example.py

This works perfectly when running ruff check from the command line in the respective project directories.

However when running ruff in VS Code using that Astral ruff extension, this seems to be ignored and instead the global PEP8 compliant ruff.toml file is used. This of course produces loads of errors.

I have tried several different things:

  • Made an intentional error in pyproject.toml. This is detected so ruff does look at the file.
  • Added "ruff.configuration": "~/projects/notpep8/ruff.toml" lines to the various settings.json files. That does not change anything.

As far as I can see from the attached log file ruff does seem to load the local ruff.toml file - and then it loads the global one immediately afterwards.

ruff.log

Version

ruff 0.16.6 (22f65a2 2026-09-03)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-mreNeeds more information for reproductionwindowsSpecific to the Windows platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions