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

ruff: lint.ignoreignore #106

Closed
wants to merge 1 commit into from

Conversation

DimitriPapadopoulos
Copy link
Contributor

ignore is part of the Top-level Ruff Settings.

I am sorry for missing that in my previous PR.

`ignore` is part of the Top-level ruff Settings:
	https://docs.astral.sh/ruff/settings/#top-level
@abravalheri
Copy link
Contributor

Hi @DimitriPapadopoulos, see my comment in pypa/setuptools#4125 (comment).

@DimitriPapadopoulos
Copy link
Contributor Author

DimitriPapadopoulos commented Jan 4, 2024

Most settings should indeed appear under lint or format, for example:

  • keep-runtime-typing
    [lint.pyupgrade]
    # Preserve types, even if a file imports `from __future__ import annotations`.
    keep-runtime-typing = true
    
  • quote-style
    [format]
    # Prefer single quotes over double quotes.
    quote-style = "single"
    

However, the Top-Level settings are clearly documented to fall outside these categories:

  • ignore
    # Skip unused variable rules (`F841`).
    ignore = ["F841"]
    

@abravalheri
Copy link
Contributor

abravalheri commented Jan 4, 2024

Thanks @DimitriPapadopoulos, that is a very good point and makes all sense.

I am just a bit confused, because these seems to be some mixed signals. In their discussions, the maintainers say they "recommend1 it going forward, but the settings at the top-level [ruff] section are still respected for backwards compatibility".

I asked the ruff maintainers further clarification about this in astral-sh/ruff#8297 (reply in thread).

Footnotes

  1. In the context where they discuss [lint], so my interpretation is that they recommend [lint] going forward.

@abravalheri
Copy link
Contributor

We got a definitive answer from the ruff maintainers: astral-sh/ruff#8297 (reply in thread)

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

Successfully merging this pull request may close these issues.

2 participants