Extend `bad-dunder-method-name` to permit `__html__` (#7492)

## Summary

Fixes #7478

## Test Plan

`cargo test`
This commit is contained in:
Jaap Roes 2023-09-18 17:16:22 +02:00 committed by GitHub
parent 8ab2519717
commit c946bf157e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -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
...

View File

@ -123,6 +123,7 @@ fn is_known_dunder_method(method: &str) -> bool {
| "__getstate__"
| "__gt__"
| "__hash__"
| "__html__"
| "__iadd__"
| "__iand__"
| "__ifloordiv__"