astral-sh / ruff

An extremely fast Python linter and code formatter, written in Rust.
https://docs.astral.sh/ruff
MIT License
32.85k stars 1.1k forks source link

PLW3201: Customize error message for dunder methods removed with Python 3 #12883

Closed MichaReiser closed 2 months ago

MichaReiser commented 3 months ago

https://github.com/astral-sh/ruff/pull/12607 proposed a new dango-model-with-dunder-unicode rule that flags any __unicode__ dunder method. We realized that this is already covered by PLW3201 (preview), but the error message could be improved to state that a dunder method is Python2 only explicitly.

The comments list a few dunder methods that were removed with python 3:

We should change PLW3201 to use a custom error message for any dunder method that was removed with Python 3.

iamlucasvieira commented 2 months ago

Hey @MichaReiser, I've picked up this issue and opened a pull request. This is my first contribution to the project, so I hope I've followed the contributing guidelines correctly. Any feedback is appreciated 😊!