Skip to content

Commit

Permalink
Do not check | in type hints in WPS226 (#2495)
Browse files Browse the repository at this point in the history
* Do not check | in type hints in WPS226

* Update wemake_python_styleguide/visitors/ast/complexity/overuses.py

* Update test_overused_string.py

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
  • Loading branch information
dolfinus and sobolevn committed Sep 23, 2022
1 parent 8e7389e commit 45cd76a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ Semantic versioning in our case means:
- Domain name was changed from `wemake-python-stylegui.de`
to `wemake-python-styleguide.rtfd.io`

### Bugfixes

- Fixes `WPS226` false positives on `|` use in `SomeType | AnotherType` type hints syntax


## 0.16.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ def test_string_overuse(
'"GenericType[int, str]"',
'"int"',
'List["int"]',
'list[int]',
'int | None',
])
def test_string_type_annotations(
assert_errors,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class StringOveruseVisitor(base.BaseNodeVisitor):
'\n',
'\r\n',
'\t',
'|',
b' ',
b'.',
b',',
Expand Down

0 comments on commit 45cd76a

Please sign in to comment.