Skip to content

JSON Schema invalid when using previous ruff version #14810

Open
@DaniBodor

Description

Hi,

I am using a previous version of ruff (v0.7.4) in a given project. Recently, my TOML formatting extension in VS (Even Better TOML) code has been showing an error on my ruff settings for this project. The error message appears under the [tool.ruff.lint] line in pyproject.toml and show all the settings together as being the problem (see below).
After digging into it a bit, it turns out that the specific reason for the error is that I ignore ANN101 and ANN102 (which have been removed in v0.8) and list TCH (which has been renamed to TC in v0.8) as a safe fix. I discovered this by removing the .lint part from the line (resulting in just [tools.ruff], at which point the errors appear at those specific lines. However, running ruff like this results in a deprecation warning, telling me that those settings should not be top level ruff settings any more.

So few issues here:

  1. When using v7.X, these should not be considered errors to start with. Removing them from the ignore/safe-fix lists leads to unwanted behavior.
  2. The errors should be displayed at the specific rules where they exist rather than in the header.
    • This is already the case when using ignore in top level ruff settings (despite it being deprecated). This makes me think it should be possible when listed under the lint-specific rules as well.
  3. The error message is not useful here. I guess that if 2 gets resolved, then 3 will automatically get resolved as well, but want to flag it as a specific issues as well.

NB: These issues seem reminiscent of #11880

Image

{"select":["ALL"],"pydocstyle":{"convention":"google"},"ignore":["FBT","ANN002","ANN003","ANN101","ANN102","ANN204","S105","S311","PT011","PD011","TD","FIX002","B028","D100","D104","D105","D107","COM812","ISC001"],"fixable":["ALL"],"unfixable":["F401","RUF100","B905"],"extend-safe-fixes":["D415","D300","D200","TCH","ISC001","EM","RUF013","B006","TID252"],"pylint":{"max-args":9},"flake8-tidy-imports":{"ban-relative-imports":"all"},"isort":{"known-first-party":["eitprocessing"]},"per-file-ignores":{".ipynb":["ERA001","T203","T201"],"tests/":["S101","ANN201","D103","PLR2004","SLF001"],"docs/*":["ALL"]}} is not valid under any of the given schemasEven Better TOML

Metadata

Assignees

No one assigned

    Labels

    configurationRelated to settings and configuration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions