-
-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
248 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
:hidden: | ||
|
||
migration_to_0_11.rst | ||
migration_to_0_14.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
Migration guide to 0.14 | ||
======================= | ||
|
||
One of the most important things in this release was | ||
that we are focused on removing extra dependencies. | ||
|
||
Why? | ||
|
||
For several reasons: | ||
|
||
1. Some dependencies do not meet our quality standards: | ||
there are bugs, lack of recent releases, new language features support, etc | ||
|
||
2. Some dependencies are just really simple. Just several lines of code. | ||
We can simply recreate them inside. | ||
The good example would be ``flake8-print``, | ||
we have added just a single configuration line | ||
to have the very same check internally. | ||
|
||
3. Better installation experience. It is faster, less possible conflicts. | ||
|
||
Dropped dependencies | ||
-------------------- | ||
|
||
We have replaced the following dependencies in this release: | ||
|
||
- ``flake8-executable`` (check is ported) | ||
- ``flake8-print`` (check is ported) | ||
- ``flake8-builtins`` (check is ported) | ||
- ``flake8-annotations-complexity`` (check is ported) | ||
- ``flake8-pep3101`` (check is ported and modified) | ||
- ``flake8-loggin-format`` (check is dropped) | ||
- ``flake8-coding`` (check is dropped) | ||
- ``radon`` (check is dropped) | ||
- ``cognitive-complexity`` (check is ported) | ||
|
||
|
||
Changed codes | ||
------------- | ||
|
||
When we port a dependency to our own codebase, | ||
this means that we also change the error code. | ||
|
||
You would probably have to update it in your source code as well: | ||
|
||
- ``EXE001..EXE005`` -> ``WPS452`` (``flake8-executable``) | ||
- ``T001`` -> ``WPS421`` (``flake8-print``) | ||
- ``A001..A005`` -> ``WPS125`` (``flake8-builtins``) | ||
- ``TAE002`` -> ``WPS234`` (``flake8-annotations-complexity``) | ||
- ``S001`` -> ``WPS323`` (``flake8-pep3101``) | ||
|
||
You would possibly want to manually install dropped dependencies again. | ||
In case you need them. Or just ignore them (as we do). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
tests/test_visitors/test_ast/test_naming/test_naming_rules/test_builtin_shadowing.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import pytest | ||
|
||
from wemake_python_styleguide.violations.naming import ( | ||
BuiltinShadowingViolation, | ||
) | ||
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor | ||
|
||
|
||
@pytest.mark.parametrize('wrong_name', [ | ||
'list', | ||
'str', | ||
'sum', | ||
]) | ||
def test_builtin_shadowing( | ||
assert_errors, | ||
assert_error_text, | ||
parse_ast_tree, | ||
naming_template, | ||
default_options, | ||
mode, | ||
wrong_name, | ||
): | ||
"""Test names that shadow builtins.""" | ||
tree = parse_ast_tree(mode(naming_template.format(wrong_name))) | ||
|
||
visitor = WrongNameVisitor(default_options, tree=tree) | ||
visitor.run() | ||
|
||
assert_errors(visitor, [BuiltinShadowingViolation]) | ||
assert_error_text(visitor, wrong_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.