mirror of https://github.com/astral-sh/ruff
Extend `bad-dunder-method-name` to permit `__html__` (#7492)
## Summary Fixes #7478 ## Test Plan `cargo test`
This commit is contained in:
parent
8ab2519717
commit
c946bf157e
|
|
@ -59,6 +59,10 @@ class Apples:
|
|||
def __attrs_init__(self):
|
||||
pass
|
||||
|
||||
# Allow __html__, used by Jinja2 and Django.
|
||||
def __html__(self):
|
||||
pass
|
||||
|
||||
|
||||
def __foo_bar__(): # this is not checked by the [bad-dunder-name] rule
|
||||
...
|
||||
|
|
|
|||
|
|
@ -123,6 +123,7 @@ fn is_known_dunder_method(method: &str) -> bool {
|
|||
| "__getstate__"
|
||||
| "__gt__"
|
||||
| "__hash__"
|
||||
| "__html__"
|
||||
| "__iadd__"
|
||||
| "__iand__"
|
||||
| "__ifloordiv__"
|
||||
|
|
|
|||
Loading…
Reference in New Issue