Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove error messages for removed CLI aliases #12833

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Aug 12, 2024

Summary

This PR removes the following CLI aliases:

  • ruff <path> to ruff check <path>
  • ruff --explain to ruff rule
  • ruff --clean to ruff clean
  • ruff --generate-shell-completion to ruff generate-shell-completion

The aliases are deprecated since Ruff 0.3 and using them became a hard error in 0.5.

Closes #10171

Test Plan

I tested that using any of the aliases becomes a hard error.

Alternatives

We could keep the error messages around a little longer. It's not a lot of code but I would also expect that most users have migrated at this time (unless they skip 0.5)

@MichaReiser MichaReiser added breaking Breaking API change cli Related to the command-line interface and removed breaking Breaking API change labels Aug 12, 2024
@MichaReiser MichaReiser changed the base branch from main to ruff-0.6 August 12, 2024 09:07
Copy link
Contributor

github-actions bot commented Aug 12, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

We could keep the error messages around a little longer. It's not a lot of code but I would also expect that most users have migrated at this time (unless they skip 0.5)

I'd lean towards keeping these for another minor release, but I don't feel strongly

@zanieb
Copy link
Member

zanieb commented Aug 12, 2024

Like until 0.7.0?

@AlexWaygood
Copy link
Member

Like until 0.7.0?

yes

@MichaReiser
Copy link
Member Author

yes

Are you sure you won't feel the same. IMO, we should either not remove the messages until like 1.0 or go ahead with it.

@AlexWaygood
Copy link
Member

Are you sure you won't feel the same.

Yeah, pretty sure :P

With a one-month period, I feel like folks who aren't super speedy in updating their dependencies could easily just bump their Ruff pin from 0.4 to 0.6 and never see the nice error message we're giving them right now. Doubling the period to two months doesn't get rid of that risk (nothing can), but I feel like there'll be substantially fewer people falling into that bucket.

Again, though, I don't feel strongly. They've been deprecated for ages and this abides by our versioning scheme.

@zanieb
Copy link
Member

zanieb commented Aug 12, 2024

This isn't that much code to keep around for another cycle 🤷‍♀️

@zanieb
Copy link
Member

zanieb commented Aug 12, 2024

IMO, we should either not remove the messages until like 1.0 or go ahead with it.

I don't really agree with this. I don't think we should special-case 1.0.

@MichaReiser
Copy link
Member Author

This isn't that much code to keep around for another cycle 🤷‍♀️

That's not my concern. My concern is that we keep spending time debating the same. That's why I rather postpone the removal indefinitely because the win of removing is very minimal (with the exception of --output-format=text)

@MichaReiser MichaReiser added this to the v0.7 milestone Aug 12, 2024
@MichaReiser MichaReiser changed the base branch from ruff-0.6 to main August 12, 2024 13:59
@zanieb
Copy link
Member

zanieb commented Aug 12, 2024

Sounds like Alex and I have loosely held opinions, maybe make the decision based on code maintenance? I agree we shouldn't discuss it every cycle: we should set a future milestone and stick to it unless we're getting clear feedback from the community that it is incorrect. We can also always revert (restore the helpful error) if we get reports from confused users.

Regardless, I think you should do what you think is best here.

@tmke8
Copy link
Contributor

tmke8 commented Aug 13, 2024

Just stumbling upon this PR... as a more long-term solution, it might be nice if there were a general mechanism that checks whether an unknown flag matches a subcommand, and then to suggest that subcommand in the error message. Could even be checking if there is a match with a small edit distance.

@MichaReiser MichaReiser changed the base branch from main to ruff-0.7 October 8, 2024 11:39
@AlexWaygood AlexWaygood added the internal An internal refactor or improvement label Oct 8, 2024
@MichaReiser MichaReiser merged commit 2a615d2 into ruff-0.7 Oct 8, 2024
20 checks passed
@MichaReiser MichaReiser deleted the remove-deprecated-cli-aliases branch October 8, 2024 11:52
AlexWaygood pushed a commit that referenced this pull request Oct 17, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
cli Related to the command-line interface internal An internal refactor or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove the ruff to ruff check alias
4 participants