Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not check | in type hints in WPS226 #2495

Merged
merged 3 commits into from Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
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
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 All @@ -202,6 +204,7 @@ def test_string_type_annotations(
'""',
'","',
'"."',
'"|"',
])
@pytest.mark.parametrize('prefix', [
'b',
Expand Down
2 changes: 2 additions & 0 deletions wemake_python_styleguide/visitors/ast/complexity/overuses.py
Expand Up @@ -48,13 +48,15 @@ class StringOveruseVisitor(base.BaseNodeVisitor):
'\n',
'\r\n',
'\t',
'|',
b' ',
b'.',
b',',
b'',
b'\n',
b'\r\n',
b'\t',
b'|',
dolfinus marked this conversation as resolved.
Show resolved Hide resolved
sobolevn marked this conversation as resolved.
Show resolved Hide resolved
))

def __init__(self, *args, **kwargs) -> None:
Expand Down