-
-
Notifications
You must be signed in to change notification settings - Fork 394
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 3265: Add WPS476 SneakyTypeVarWithDefaultViolation #3314
base: master
Are you sure you want to change the base?
Conversation
…thDefaultViolation and corresponding tests
# Conflicts: # wemake_python_styleguide/visitors/ast/classes.py
# Conflicts: # tests/test_visitors/test_ast/test_classes/test_type_var_with_default.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
tests/test_visitors/test_ast/test_classes/test_type_var_with_default.py
Outdated
Show resolved
Hide resolved
tests/test_visitors/test_ast/test_classes/test_type_var_with_default.py
Outdated
Show resolved
Hide resolved
tests/test_visitors/test_ast/test_classes/test_type_var_with_default.py
Outdated
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3314 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 357 361 +4
Lines 11715 11774 +59
Branches 802 804 +2
=========================================
+ Hits 11715 11774 +59 ☔ View full report in Codecov by Sentry. |
tests/test_checker/test_noqa.py
Outdated
IGNORED_VIOLATIONS3_13 = ( | ||
|
||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IGNORED_VIOLATIONS3_13 = ( | |
) | |
IGNORED_VIOLATIONS3_13 = () |
tests/test_checker/test_noqa.py
Outdated
SHOULD_BE_RAISED3_13 = types.MappingProxyType( | ||
dict.fromkeys(SHOULD_BE_RAISED, 0) | { | ||
'WPS476': 1 | ||
} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SHOULD_BE_RAISED3_13 = types.MappingProxyType( | |
dict.fromkeys(SHOULD_BE_RAISED, 0) | { | |
'WPS476': 1 | |
} | |
) | |
SHOULD_BE_RAISED3_13 = types.MappingProxyType( | |
{ | |
'WPS476': 1 | |
} | |
) |
Let's simplify this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testcases check that every violation code is defined in such dictionary, so I was forced to add that line. Formatter ate my comment on this, btw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'class_header', | ||
[ | ||
( | ||
"T = TypeVar('T')\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, move multiline example to variables, it is easier to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole list, or each individual example to its variable?
I have made things!
Checklist
CHANGELOG.md
Related issues
TypeVarTuple
afterTypeVar
with a default #3265Note
Making of this feature resulted into a refactoring of
visitors.ast.classes
following the complexity waterfall. Thorough checking is required🙏 Please, if you or your company is finding wemake-python-styleguide valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/wemake-python-styleguide. As a thank you, your profile/company logo will be added to our main README which receives hundreds of unique visitors per day.