Skip to content

Commit

Permalink
Extend bad-dunder-method-name to permit __html__ (#7492)
Browse files Browse the repository at this point in the history
## Summary

Fixes #7478

## Test Plan

`cargo test`
  • Loading branch information
jaap3 authored Sep 18, 2023
1 parent 8ab2519 commit c946bf1
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 c946bf1

Please sign in to comment.