Fix message for __aenter__ in PLC2801 (#9492)

<!--
Thank you for contributing to Ruff! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

Fix the message for `__aenter__ ` in PLC2801 (introduced in
https://github.com/astral-sh/ruff/pull/9166)
There is no `aenter` builtin in Python, so the current message is
misleading.
I take the message from original lint
https://github.com/pylint-dev/pylint/blob/main/pylint/constants.py#L211

P.S. I think here should be more accurate synchronization with original
lint (e.g. the current implementation will not lint `__enter__` on my
first sight), but it is out-of-scope of this change.

<!-- What's the purpose of the change? What does it do, and why? -->

## Test Plan

<!-- How was it tested? -->
This commit is contained in:
Aleksei Latyshev 2024-01-12 14:48:45 +01:00 committed by GitHub
parent 395cdf04e5
commit 1602df1643
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -273,7 +273,7 @@ impl DunderReplacement {
"__str__" => Some(Self::Builtin("str", "Use `str()` builtin")),
"__subclasscheck__" => Some(Self::Builtin("issubclass", "Use `issubclass()` builtin")),
"__aenter__" => Some(Self::MessageOnly("Use `aenter()` builtin")),
"__aenter__" => Some(Self::MessageOnly("Invoke context manager directly")),
"__ceil__" => Some(Self::MessageOnly("Use `math.ceil()` function")),
"__copy__" => Some(Self::MessageOnly("Use `copy.copy()` function")),
"__deepcopy__" => Some(Self::MessageOnly("Use `copy.deepcopy()` function")),