abravalheri / validate-pyproject

Validation library for simple check on `pyproject.toml`
https://validate-pyproject.readthedocs.io/
Mozilla Public License 2.0
116 stars 11 forks source link

tool ruff can't validate lint subsection #185

Closed henryiii closed 1 month ago

henryiii commented 1 month ago

The following, from https://github.com/pypa/setuptools_scm/blob/main/pyproject.toml:

[tool.ruff]
fix = true
lint.select = ["E", "F", "B", "U", "YTT", "C", "DTZ", "PYI", "PT", "I", "FURB", "RUF"]
lint.ignore = ["B028"]
lint.preview = true

[tool.ruff.lint.isort]
force-single-line = true
from-first = false
lines-between-types = 1
order-by-type = true

Using https://json.schemastore.org/ruff.json (from validate-pyproject-scheme-store) produces:

Invalid file: pyproject.toml
[ERROR] `tool.ruff.lint` cannot be validated by any definition:

    - type: table
      keys:
        ...
        'isort':
          at least one of the following:
            - {}
            - {type: null}
        ...

Maybe multiple refs are not supported? See https://github.com/scientific-python/repo-review/issues/232.

henryiii commented 1 month ago

Nevermind, bad error message. The select list has preview-only items in it, which are not in the schema.