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

Deprecate ruff <path> ruff --explain, ruff --clean and ruff --generate-shell-completion #10169

Merged
merged 2 commits into from Feb 29, 2024

Conversation

MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Feb 29, 2024

Summary

Deprecate ruff <path> ruff --explain, ruff --clean and ruff --generate-shell-completion in favor of ruff check <path>, ruff rule, ruff clean and ruff generate-shell-completion.

Closes #9692

Test Plan

--clean

./target/debug/ruff --clean
warning: `ruff --clean` is deprecated. Use `ruff clean` instead.
Removing cache at: .ruff_cache

❯ ./target/debug/ruff clean

--generate-shell-completion

❯ ./target/debug/ruff --generate-shell-completion fish > /dev/null
warning: `ruff --generate-shell-completion <SHELL>` is deprecated. Use `ruff generate-shell-completion <SHELL>` instead.


❯ ./target/debug/ruff generate-shell-completion fish > /dev/null

ruff --explain

❯ ./target/debug/ruff --explain RUF001
warning: `ruff --explain <RULE>` is deprecated. Use `ruff rule <RULE>` instead.
# ambiguous-unicode-character-string (RUF001)

Derived from the **Ruff-specific rules** linter.

...

❯ ./target/debug/ruff rule RUF001
# ambiguous-unicode-character-string (RUF001)

ruff

❯ ./target/debug/ruff .
warning: `ruff <path>` is deprecated. Use `ruff check <path>` instead.
warning: Detected debug build without --no-cache.
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `crates/ruff/resources/test/fixtures/include-test/nested-project/pyproject.toml`:
  - 'select' -> 'lint.select'

❯ ./target/debug/ruff check  .
warning: Detected debug build without --no-cache.
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `crates/ruff/resources/test/fixtures/include-test/nested-project/pyproject.toml`:
  - 'select' -> 'lint.select'

@MichaReiser MichaReiser added breaking Breaking API change cli Related to the command-line interface labels Feb 29, 2024
Copy link

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Some("--clean") => {
Some("`ruff --clean` is deprecated. Use `ruff clean` instead.")
}
Some("--generate-shell-completion") => {
Copy link
Member

Choose a reason for hiding this comment

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

I’ll check, but this one might be used in our Homebrew formula. (Which is ok.)

Copy link
Member Author

Choose a reason for hiding this comment

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

@MichaReiser MichaReiser merged commit eceffe7 into main Feb 29, 2024
17 checks passed
@MichaReiser MichaReiser deleted the deprecate-command-aliases branch February 29, 2024 13:50
nkxxll pushed a commit to nkxxll/ruff that referenced this pull request Mar 10, 2024
plietar added a commit to mrc-ide/outpack-py that referenced this pull request Apr 9, 2024
ruff has deprecated top-level lint settings, instead they must be moved
into a dedicated `lint` section. Additionally, the CLI now needs to be
invoked with a `check` subcommand.

https://astral.sh/blog/ruff-v0.2.0#configuration-changes
astral-sh/ruff#10169
plietar added a commit to mrc-ide/outpack-py that referenced this pull request Apr 9, 2024
ruff has deprecated top-level lint settings, instead they must be moved
into a dedicated `lint` section. Additionally, the CLI now needs to be
invoked with a `check` subcommand.

https://astral.sh/blog/ruff-v0.2.0#configuration-changes
astral-sh/ruff#10169
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate the ruff alias to ruff check
2 participants