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

VPP001: Error: tool.ruff.lint cannot be validated by any definition #232

Closed
DimitriPapadopoulos opened this issue Aug 4, 2024 · 9 comments

Comments

@DimitriPapadopoulos
Copy link

See:
https://learn.scientific-python.org/development/guides/repo-review/?repo=pypa%2Fsetuptools_scm&branch=main

The error message is unclear, I think the failure originates here:

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

henryiii commented Aug 4, 2024

Are one of those fairly new? We might need ti bum validate-pyproject-schema-store. Or the SchemaStore might need a new update (which the stuff team does pretty regularly).

@DimitriPapadopoulos
Copy link
Author

None of these settings is very recent, the most recent is from-first from 2023 (astral-sh/ruff#8663).

In the error message, the isort key is almost empty:

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

Is that expected?

@henryiii
Copy link
Collaborator

henryiii commented Aug 4, 2024

Hard to check on my phone, is it in here: https://json.schemastore.org/ruff.json

@DimitriPapadopoulos
Copy link
Author

It points to the IsortOptions definitions:

Screen Capture

@henryiii
Copy link
Collaborator

henryiii commented Aug 5, 2024

It's mad about

lint.select = ["E", "F", "B", "U", "YTT", "C", "DTZ", "PYI", "PT", "I", "FURB", "RUF"]

I think because it has preview only selections in it.

@henryiii
Copy link
Collaborator

henryiii commented Aug 5, 2024

The issue is "U" is not a valid code. "UP" is the correct code. See pypa/setuptools-scm#1064.

@henryiii henryiii closed this as completed Aug 5, 2024
@DimitriPapadopoulos
Copy link
Author

What got me confused is that there were 2 error messages for the same issue;

  • RF103: pyupgrade must be selected. Must select the pyupgrade UP checks.
  • VPP001: Error: tool.ruff.lint cannot be validated by any definition

The error message could be more helpful (perhaps show the actual invalid code).

@henryiii
Copy link
Collaborator

henryiii commented Aug 5, 2024

For validation, that's handled by validate-pyproject, maybe the error message can be improved there (it's from fastjsonshema). For our end (sp-repo-review, that is), RF103: pyupgrade must be selected. Must select the pyupgrade UP checks. described exactly what was missing (no UP code).

@DimitriPapadopoulos
Copy link
Author

Because RF103 had already been raised about the UP typo, I was misled into looking elsewhere for the VPP001 cause.

The same root cause should not result into different error messages, especially without enough details to clearly identify the root cause (at least a line number).

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

2 participants