Skip to content

Commit

Permalink
Extend bad-dunder-method-name to permit __html__
Browse files Browse the repository at this point in the history
  • Loading branch information
jaap3 committed Sep 18, 2023
1 parent 8ab2519 commit 83a1e9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ def __attrs_pre_init__(self):
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
...
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ fn is_known_dunder_method(method: &str) -> bool {
| "__getstate__"
| "__gt__"
| "__hash__"
| "__html__"
| "__iadd__"
| "__iand__"
| "__ifloordiv__"
Expand Down

0 comments on commit 83a1e9b

Please sign in to comment.