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

Remove deprecated extend-ignore and extend-unfixable options #12007

Closed

Conversation

MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Jun 24, 2024

Summary

This PR removes the deprecated lint.extend-ignore and lint.extend-unfixable options. The options were deprecated in #2312 (0.0.238)

Part of #7650

Test Plan

Running ruff with a configuration containing extend-ignore or extend-unfixable now fails

❯ ../ruff/target/debug/ruff check test.py --no-cache
ruff failed
  Cause: Failed to parse /home/micha/astral/test/pyproject.toml
  Cause: TOML parse error at line 38, column 1
   |
38 | [tool.ruff.lint]
   | ^^^^^^^^^^^^^^^^
unknown field `extend-ignore`

Changing the option to ignore "ignores" the rule as expected.

@MichaReiser MichaReiser changed the base branch from main to ruff-0.5 June 24, 2024 07:19
@MichaReiser MichaReiser force-pushed the remove-deprecated-ignore-and-unfixable-options branch from 8493d77 to b156c7b Compare June 24, 2024 07:26
Comment on lines -1258 to -1264
ignore: self
.ignore
.iter()
.cloned()
.chain(self.extend_ignore.iter().cloned())
.flatten()
.collect(),
Copy link
Member Author

@MichaReiser MichaReiser Jun 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit unfortunate. We never added deprecation warnings to the CLI. I'm inclined to keep and hide the CLI options for now but add a deprecation warning instead.

It also seems that python-lsp-ruff is using the CLI option :(

https://github.com/python-lsp/python-lsp-ruff/blob/34acd6ed6daaaa3f2756a1a1cf1bfc2d76df7d0f/pylsp_ruff/plugin.py#L611-L612

@MichaReiser MichaReiser force-pushed the remove-deprecated-ignore-and-unfixable-options branch from b156c7b to f8c6f56 Compare June 24, 2024 07:39
@MichaReiser MichaReiser added the breaking Breaking API change label Jun 24, 2024
@MichaReiser MichaReiser marked this pull request as ready for review June 24, 2024 07:40
@MichaReiser MichaReiser added this to the v0.5.0 milestone Jun 24, 2024
@MichaReiser MichaReiser added configuration Related to settings and configuration cli Related to the command-line interface labels Jun 24, 2024
@charliermarsh
Copy link
Member

Yeah, I would vote not to remove these. They were never properly deprecated. Honestly, I would vote not to deprecate them, even (or to un-deprecate them). I think it would be surprising to users that they don't exist. If they didn't exist, I would consider adding them, even though they're undifferentiated from ignore and unfixable.

Copy link
Contributor

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check encountered linter errors. (no lint changes; 4 project errors)

latchbio/latch (error)

ruff failed
  Cause: Failed to parse /home/runner/work/ruff/ruff/checkouts/latchbio:latch/pyproject.toml
  Cause: TOML parse error at line 18, column 1
   |
18 | [tool.ruff]
   | ^^^^^^^^^^^
unknown field `extend-ignore`

python-trio/trio (error)

ruff failed
  Cause: Failed to parse /home/runner/work/ruff/ruff/checkouts/python-trio:trio/pyproject.toml
  Cause: TOML parse error at line 102, column 1
    |
102 | [tool.ruff.lint]
    | ^^^^^^^^^^^^^^^^
unknown field `extend-ignore`

mesonbuild/meson-python (error)

ruff failed
  Cause: Failed to parse /home/runner/work/ruff/ruff/checkouts/mesonbuild:meson-python/pyproject.toml
  Cause: TOML parse error at line 80, column 1
   |
80 | [tool.ruff]
   | ^^^^^^^^^^^
unknown field `extend-ignore`

pdm-project/pdm (error)

ruff failed
  Cause: Failed to parse /home/runner/work/ruff/ruff/checkouts/pdm-project:pdm/pyproject.toml
  Cause: TOML parse error at line 169, column 1
    |
169 | [tool.ruff.lint]
    | ^^^^^^^^^^^^^^^^
unknown field `extend-ignore`

Linter (preview)

ℹ️ ecosystem check encountered linter errors. (no lint changes; 4 project errors)

latchbio/latch (error)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

ruff failed
  Cause: Failed to parse /home/runner/work/ruff/ruff/checkouts/latchbio:latch/pyproject.toml
  Cause: TOML parse error at line 18, column 1
   |
18 | [tool.ruff]
   | ^^^^^^^^^^^
unknown field `extend-ignore`

python-trio/trio (error)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

ruff failed
  Cause: Failed to parse /home/runner/work/ruff/ruff/checkouts/python-trio:trio/pyproject.toml
  Cause: TOML parse error at line 102, column 1
    |
102 | [tool.ruff.lint]
    | ^^^^^^^^^^^^^^^^
unknown field `extend-ignore`

mesonbuild/meson-python (error)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

ruff failed
  Cause: Failed to parse /home/runner/work/ruff/ruff/checkouts/mesonbuild:meson-python/pyproject.toml
  Cause: TOML parse error at line 80, column 1
   |
80 | [tool.ruff]
   | ^^^^^^^^^^^
unknown field `extend-ignore`

pdm-project/pdm (error)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

ruff failed
  Cause: Failed to parse /home/runner/work/ruff/ruff/checkouts/pdm-project:pdm/pyproject.toml
  Cause: TOML parse error at line 169, column 1
    |
169 | [tool.ruff.lint]
    | ^^^^^^^^^^^^^^^^
unknown field `extend-ignore`

@MichaReiser
Copy link
Member Author

MichaReiser commented Jun 24, 2024

I'll create an issue to follow up on this. Closing as per @charliermarsh's comment.

Follow up in #12014

@MichaReiser MichaReiser deleted the remove-deprecated-ignore-and-unfixable-options branch August 12, 2024 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking API change cli Related to the command-line interface configuration Related to settings and configuration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants