repo_id string | cross_repo_split string | commit_index int32 | commit_sha string | in_repo_split string | test_file string | file_split string | split_group string | lineno int32 | col_offset int32 | assertion_type string | test_function string | prefix large_string | target string | assertion_event_type string | assertion_event_id string | assertion_anchor large_string | old_target string | old_lineno int32 | old_col_offset int32 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wemake-services/wemake-python-styleguide | train | 495 | e060f74cd94f7ec378f8c849657e21fed4edc98d | train | tests/test_visitors/test_ast/test_complexity/test_access/test_access.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_access/test_access.py | 70 | 4 | assert_* | test_incorrect_access | import pytest
from wemake_python_styleguide.violations.complexity import (
TooDeepAccessViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.access import (
AccessVisitor,
)
# boundary expressions
subscript_access = 'my_matrix[0][0][0][0]'
attribute_access = 'self.attr.inner.wrapper.value'
mixed... | [TooDeepAccessViolation]) | modified | 32fc8fb34a9e936e1d3d884ba9415a2270af2fdd1477b8a19953938c6820c47c | assert_*|test_incorrect_access|import pytest from wemake_python_styleguide.violations.complexity import ( TooDeepAccessViolation, ) from wemake_python_styleguide.visitors.ast.complexity.access import ( AccessVisitor, ) # boundary expressions subscript_access = 'my_matrix[0][0][0][0]' attribute_access = 'self.attr.inner... | [TooDeepAccessViolation]) | 70 | 4 |
wemake-services/wemake-python-styleguide | train | 495 | e060f74cd94f7ec378f8c849657e21fed4edc98d | train | tests/test_visitors/test_ast/test_complexity/test_nested/test_nested_functions.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_nested/test_nested_functions.py | 193 | 4 | assert_* | test_nested_function | import pytest
from wemake_python_styleguide.violations.best_practices import (
NestedFunctionViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.nested import (
NESTED_FUNCTIONS_WHITELIST,
NestedComplexityVisitor,
)
# Functions:
nested_function_in_function = """
def container():
def {0... | nested_name) | modified | 107d4a636addfff6aaecd972aecdddfc9a50b3e958942cc573bb96091cd8342a | assert_*|test_nested_function|import pytest from wemake_python_styleguide.violations.best_practices import ( NestedFunctionViolation, ) from wemake_python_styleguide.visitors.ast.complexity.nested import ( NESTED_FUNCTIONS_WHITELIST, NestedComplexityVisitor, ) # Functions: nested_function_in_function = """ def containe... | nested_name) | 193 | 4 |
wemake-services/wemake-python-styleguide | train | 495 | e060f74cd94f7ec378f8c849657e21fed4edc98d | train | tests/test_visitors/test_ast/test_functions/test_call_context/test_type_compare.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_functions/test_call_context/test_type_compare.py | 129 | 4 | assert_* | test_type_with_compare | import pytest
from wemake_python_styleguide.violations.refactoring import TypeCompareViolation
from wemake_python_styleguide.visitors.ast.functions import (
WrongFunctionCallContextVisitor,
)
# Wrong:
simple_compare = '{0} == other'
is_compare = '{0} is other'
nested_compare = '{0} == int and other()'
triple_com... | [TypeCompareViolation]) | modified | 628bc02cba782252b0b272d5b2427b6b5401a4d753f6d7a3c363f6f76aa81773 | assert_*|test_type_with_compare|import pytest from wemake_python_styleguide.violations.refactoring import TypeCompareViolation from wemake_python_styleguide.visitors.ast.functions import ( WrongFunctionCallContextVisitor, ) # Wrong: simple_compare = '{0} == other' is_compare = '{0} is other' nested_compare = '{0} == in... | [TypeCompareViolation]) | 129 | 4 |
wemake-services/wemake-python-styleguide | train | 495 | e060f74cd94f7ec378f8c849657e21fed4edc98d | train | tests/test_visitors/test_ast/test_keywords/test_consistency_returning/test_consistency_return.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_consistency_returning/test_consistency_return.py | 180 | 4 | assert_* | test_double_wrong_return_statement | import pytest
from wemake_python_styleguide.violations.consistency import (
InconsistentReturnViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import (
ConsistentReturningVisitor,
)
# Correct:
correct_example1 = """
def function():
...
"""
correct_example2 = """
def function():
retur... | [ InconsistentReturnViolation, InconsistentReturnViolation, ]) | added | 9e347a8b84f9b98bba3f78801c178cd5cbea58f957e7756c53c7883b922f3897 | assert_*|test_double_wrong_return_statement|import pytest from wemake_python_styleguide.violations.consistency import ( InconsistentReturnViolation, ) from wemake_python_styleguide.visitors.ast.keywords import ( ConsistentReturningVisitor, ) # Correct: correct_example1 = """ def function(): ... """ correct_example2 = "... | null | null | null |
wemake-services/wemake-python-styleguide | train | 496 | 7354cb0dc51d5ffad4a4b9fd87efef903b1ba2fd | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 315 | 12 | assert | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | errors | modified | 26e96e5b6a040384ab0cb89ff909547b2b5e364e56f757930906ebcf999fa2bf | assert||""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contrib... | errors | 314 | 12 | |
wemake-services/wemake-python-styleguide | train | 496 | 7354cb0dc51d5ffad4a4b9fd87efef903b1ba2fd | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 319 | 8 | assert | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | errors.get(found_error) | modified | 48319067ed9c252becc36bbafe20966516f42c230a92fe14f3b9abb29746c830 | assert||""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contrib... | errors.get(found_error) | 318 | 8 | |
wemake-services/wemake-python-styleguide | train | 496 | 7354cb0dc51d5ffad4a4b9fd87efef903b1ba2fd | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 328 | 4 | assert | test_codes | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | len(all_violations) | modified | 2f0e39405908adc2d570a5531ccc1380c0d1fb5aaf47347b13403640c5d14d56 | assert|test_codes|""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/a... | len(all_violations) | 327 | 4 |
wemake-services/wemake-python-styleguide | train | 496 | 7354cb0dc51d5ffad4a4b9fd87efef903b1ba2fd | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 402 | 4 | assert | test_noqa_fixture_disabled_no_control | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | len(all_controlled_violations) | modified | d40f5f337a335700ae9f91c44e9bf6a477a6b927d77f498e80bcf3326a2be882 | assert|test_noqa_fixture_disabled_no_control|""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-st... | len(all_controlled_violations) | 401 | 4 |
wemake-services/wemake-python-styleguide | train | 496 | 7354cb0dc51d5ffad4a4b9fd87efef903b1ba2fd | train | tests/test_visitors/test_tokenize/test_statements/test_inconsistent_comprehension.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_statements/test_inconsistent_comprehension.py | 326 | 4 | assert_* | test_wrong_comprehension_consistency | import pytest
from wemake_python_styleguide.violations.consistency import (
InconsistentComprehensionViolation,
)
from wemake_python_styleguide.visitors.tokenize.statements import (
InconsistentComprehensionVisitor,
)
# Tests that should NOT be flagged
# List comprehension tests
correct_list_empty = """
a =... | [InconsistentComprehensionViolation]) | added | 4c20293791b4cdda3de15f78279b3bc1490355d59705cdadf6d82957e2189902 | assert_*|test_wrong_comprehension_consistency|import pytest from wemake_python_styleguide.violations.consistency import ( InconsistentComprehensionViolation, ) from wemake_python_styleguide.visitors.tokenize.statements import ( InconsistentComprehensionVisitor, ) # Tests that should NOT be flagged # List comprehension ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 497 | c56d8a77a198102fc927f907fb49c482772aa745 | train | tests/test_visitors/test_ast/test_blocks/test_control_variables.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_blocks/test_control_variables.py | 235 | 4 | assert_* | test_control_variable_used_after_block | import pytest
from wemake_python_styleguide.violations.best_practices import (
ControlVarUsedAfterBlockViolation,
)
from wemake_python_styleguide.visitors.ast.blocks import (
AfterBlockVariablesVisitor,
)
# Correct:
correct_for_loop1 = """
def wrapper():
for i, j in ():
print(i, j)
"""
correct_f... | [ControlVarUsedAfterBlockViolation]) | added | 123659189d0ef528993b6b0f55d6433b03a759c327a0911988b34376730de158 | assert_*|test_control_variable_used_after_block|import pytest from wemake_python_styleguide.violations.best_practices import ( ControlVarUsedAfterBlockViolation, ) from wemake_python_styleguide.visitors.ast.blocks import ( AfterBlockVariablesVisitor, ) # Correct: correct_for_loop1 = """ def wrapper(): for i, j in (): p... | null | null | null |
wemake-services/wemake-python-styleguide | train | 498 | 9b3e342426cc6e1b931a135410032119282531fa | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 316 | 12 | assert | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | errors | modified | 10790175332180809f02c294c5b742d75eaa5130bfa9cb8afad560fd03f6eccf | assert||""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contrib... | errors | 315 | 12 | |
wemake-services/wemake-python-styleguide | train | 498 | 9b3e342426cc6e1b931a135410032119282531fa | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 320 | 8 | assert | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | errors.get(found_error) | modified | 1dae25984527d27b4a29b9ac63286bf175743003ee31eefc2c6aff4a2df323ad | assert||""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contrib... | errors.get(found_error) | 319 | 8 | |
wemake-services/wemake-python-styleguide | train | 498 | 9b3e342426cc6e1b931a135410032119282531fa | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 329 | 4 | assert | test_codes | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | len(all_violations) | modified | ee5afd773e330681cde7e947be276793c180c1db1ba41c865974d022d83321c5 | assert|test_codes|""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/a... | len(all_violations) | 328 | 4 |
wemake-services/wemake-python-styleguide | train | 498 | 9b3e342426cc6e1b931a135410032119282531fa | train | tests/test_visitors/test_ast/test_classes/test_getter_setter.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_getter_setter.py | 215 | 4 | assert_* | test_invalid_getter_and_setter | import pytest
from wemake_python_styleguide.violations.oop import (
UnpythonicGetterSetterViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
module_getter_and_setter = """
attribute = 1
def get_attribute():
...
def set_attribute():
...
"""
static_getter_and_setter ... | [ UnpythonicGetterSetterViolation, UnpythonicGetterSetterViolation, ]) | added | b9c6bc78021018f2cdcde46eab0e45e2941fcb4f7bda23a446d180f495f04c5d | assert_*|test_invalid_getter_and_setter|import pytest from wemake_python_styleguide.violations.oop import ( UnpythonicGetterSetterViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor module_getter_and_setter = """ attribute = 1 def get_attribute(): ... def set_attribute(): ... """ st... | null | null | null |
wemake-services/wemake-python-styleguide | train | 498 | 9b3e342426cc6e1b931a135410032119282531fa | train | tests/test_visitors/test_ast/test_classes/test_getter_setter.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_getter_setter.py | 293 | 4 | assert_* | test_instance_getter_setter | import pytest
from wemake_python_styleguide.violations.oop import (
UnpythonicGetterSetterViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
module_getter_and_setter = """
attribute = 1
def get_attribute():
...
def set_attribute():
...
"""
static_getter_and_setter ... | [UnpythonicGetterSetterViolation]) | added | c84e2e80be502bbc039a9f5c84c9eaf244c1ed7f47354ae4d0b3196129ce0f96 | assert_*|test_instance_getter_setter|import pytest from wemake_python_styleguide.violations.oop import ( UnpythonicGetterSetterViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor module_getter_and_setter = """ attribute = 1 def get_attribute(): ... def set_attribute(): ... """ stati... | null | null | null |
wemake-services/wemake-python-styleguide | train | 498 | 9b3e342426cc6e1b931a135410032119282531fa | train | tests/test_visitors/test_ast/test_classes/test_getter_setter.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_getter_setter.py | 367 | 4 | assert_* | test_class_attributes_getter_setter | import pytest
from wemake_python_styleguide.violations.oop import (
UnpythonicGetterSetterViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
module_getter_and_setter = """
attribute = 1
def get_attribute():
...
def set_attribute():
...
"""
static_getter_and_setter ... | [UnpythonicGetterSetterViolation]) | added | a3baecfce7de64021966f4f167dce335729ed1f65885f5aaa7619088e2094b7e | assert_*|test_class_attributes_getter_setter|import pytest from wemake_python_styleguide.violations.oop import ( UnpythonicGetterSetterViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor module_getter_and_setter = """ attribute = 1 def get_attribute(): ... def set_attribute(): ... "... | null | null | null |
wemake-services/wemake-python-styleguide | train | 498 | 9b3e342426cc6e1b931a135410032119282531fa | train | tests/test_visitors/test_ast/test_complexity/test_function/test_raises.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_raises.py | 134 | 4 | assert_* | test_raises_wrong_count | import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyRaisesViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
)
module_many_raises = """
if some:
raise SomeException
raise SomeOtherException
"""
lambda_many_raises =... | [TooManyRaisesViolation]) | modified | 71a70e1a016ba8e89fbee402ce13b4e727a0161148401387f4fd16db7171b3af | assert_*|test_raises_wrong_count|import pytest from wemake_python_styleguide.violations.complexity import ( TooManyRaisesViolation, ) from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, ) module_many_raises = """ if some: raise SomeException raise SomeOtherException """ la... | [TooManyRaisesViolation]) | 136 | 4 |
wemake-services/wemake-python-styleguide | train | 498 | 9b3e342426cc6e1b931a135410032119282531fa | train | tests/test_visitors/test_ast/test_complexity/test_function/test_raises.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_raises.py | 135 | 4 | assert_* | test_raises_wrong_count | import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyRaisesViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
)
module_many_raises = """
if some:
raise SomeException
raise SomeOtherException
"""
lambda_many_raises =... | option_values.max_raises) | modified | a20fd556b4ec76fbd6a4bd8b1c7a39f5cdc0119176c3951a1dd447bd20c7f193 | assert_*|test_raises_wrong_count|import pytest from wemake_python_styleguide.violations.complexity import ( TooManyRaisesViolation, ) from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, ) module_many_raises = """ if some: raise SomeException raise SomeOtherException """ la... | option_values.max_raises) | 137 | 4 |
wemake-services/wemake-python-styleguide | train | 499 | 272f4d3e9030e4af6584d389fca042d0a06cb6e5 | train | tests/test_formatter/test_formatter_output.py | train | wemake-services/wemake-python-styleguide:tests/test_formatter/test_formatter_output.py | 116 | 4 | assert_* | test_formatter_correct | """
We use direct string assertiong on the formatter.
So, no unit tests for formatter, only e2e ones.
We use ``snapshottest`` to render and assert equality of the output:
https://github.com/syrusakbary/snapshottest
To update snapshots use ``--snapshot-update`` flag, when running ``pytest``.
We also don't use ``abso... | 'formatter_correct_{0}'.format(output)) | modified | 8fdc3f46b4a613e40d3dcdbd5cad9d3d2b4a173711911479e8e88d4c7bb3a333 | assert_*|test_formatter_correct|""" We use direct string assertiong on the formatter. So, no unit tests for formatter, only e2e ones. We use ``snapshottest`` to render and assert equality of the output: https://github.com/syrusakbary/snapshottest To update snapshots use ``--snapshot-update`` flag, when running ``pytest... | 'formatter_correct_{0}'.format(output)) | 114 | 4 |
wemake-services/wemake-python-styleguide | train | 500 | 01d5d88d66258f9f0be6704a5fbfa8910cbbf76b | train | tests/test_visitors/test_ast/test_naming/test_variable_self_reassignment.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_variable_self_reassignment.py | 173 | 4 | assert_* | test_self_variable_reassignment | import pytest
from wemake_python_styleguide.violations.best_practices import (
ReassigningVariableToItselfViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
WrongVariableAssignmentVisitor,
)
# Correct:
right_fragment = """
test_variable = 5
test_variable = 10
"""
right_typed_fragment = ... | [ReassigningVariableToItselfViolation]) | added | f6392a764d721833d593f67c4a9c88ac293b86429f18093faad662110c2da3e5 | assert_*|test_self_variable_reassignment|import pytest from wemake_python_styleguide.violations.best_practices import ( ReassigningVariableToItselfViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( WrongVariableAssignmentVisitor, ) # Correct: right_fragment = """ test_variable = 5 test_variable = 1... | null | null | null |
wemake-services/wemake-python-styleguide | train | 500 | 01d5d88d66258f9f0be6704a5fbfa8910cbbf76b | train | tests/test_visitors/test_ast/test_naming/test_variable_self_reassignment.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_variable_self_reassignment.py | 192 | 4 | assert_* | test_self_variable_reassignment_double | import pytest
from wemake_python_styleguide.violations.best_practices import (
ReassigningVariableToItselfViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
WrongVariableAssignmentVisitor,
)
# Correct:
right_fragment = """
test_variable = 5
test_variable = 10
"""
right_typed_fragment = ... | [ ReassigningVariableToItselfViolation, ReassigningVariableToItselfViolation, ]) | added | 398c2065478624d7e1d4945c6ca339d7af13fa77a8d197ced5e96cd9d2e68235 | assert_*|test_self_variable_reassignment_double|import pytest from wemake_python_styleguide.violations.best_practices import ( ReassigningVariableToItselfViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( WrongVariableAssignmentVisitor, ) # Correct: right_fragment = """ test_variable = 5 test_varia... | null | null | null |
wemake-services/wemake-python-styleguide | train | 500 | 01d5d88d66258f9f0be6704a5fbfa8910cbbf76b | train | tests/test_visitors/test_ast/test_naming/test_variable_self_reassignment.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_variable_self_reassignment.py | 214 | 4 | assert_* | test_self_variable_reassignment_triple | import pytest
from wemake_python_styleguide.violations.best_practices import (
ReassigningVariableToItselfViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
WrongVariableAssignmentVisitor,
)
# Correct:
right_fragment = """
test_variable = 5
test_variable = 10
"""
right_typed_fragment = ... | [ ReassigningVariableToItselfViolation, ReassigningVariableToItselfViolation, ReassigningVariableToItselfViolation, ]) | added | ac349df8abf8f5002840097a98df180b5252afd3300f897f81bd16c94e8163b5 | assert_*|test_self_variable_reassignment_triple|import pytest from wemake_python_styleguide.violations.best_practices import ( ReassigningVariableToItselfViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( WrongVariableAssignmentVisitor, ) # Correct: right_fragment = """ test_variable = 5 test_varia... | null | null | null |
wemake-services/wemake-python-styleguide | train | 501 | 03460c4ef429ae4e5a3646ae5379c9b3ee329262 | train | tests/test_visitors/test_ast/test_statements/test_pointless_starred.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_statements/test_pointless_starred.py | 35 | 4 | assert_* | test_pointless_starred_arg | import pytest
from wemake_python_styleguide.violations.refactoring import (
PointlessStarredViolation,
)
from wemake_python_styleguide.visitors.ast.statements import (
PointlessStarredVisitor,
)
@pytest.mark.parametrize('code', [
'print(*[])',
'print(*())',
'print(*{})', # noqa: P103
'print(... | [PointlessStarredViolation]) | modified | 28c8355aaa1913109d47c381c62fbaf4e96825b739bfa631dde0d8b005cdb607 | assert_*|test_pointless_starred_arg|import pytest from wemake_python_styleguide.violations.refactoring import ( PointlessStarredViolation, ) from wemake_python_styleguide.visitors.ast.statements import ( PointlessStarredVisitor, ) @pytest.mark.parametrize('code', [ 'print(*[])', 'print(*())', 'print(*{})', # noqa: P103... | [PointlessStarredViolation]) | 33 | 4 |
wemake-services/wemake-python-styleguide | train | 501 | 03460c4ef429ae4e5a3646ae5379c9b3ee329262 | train | tests/test_visitors/test_ast/test_statements/test_pointless_starred.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_statements/test_pointless_starred.py | 56 | 4 | assert_* | test_pointless_starred_arg_and_keyword | import pytest
from wemake_python_styleguide.violations.refactoring import (
PointlessStarredViolation,
)
from wemake_python_styleguide.visitors.ast.statements import (
PointlessStarredVisitor,
)
@pytest.mark.parametrize('code', [
'print(*[])',
'print(*())',
'print(*{})', # noqa: P103
'print(... | [PointlessStarredViolation, PointlessStarredViolation]) | modified | ce770c596c5f5691ac10125ece9f9f250ae45b38b816a8b998eca38e2117afe6 | assert_*|test_pointless_starred_arg_and_keyword|import pytest from wemake_python_styleguide.violations.refactoring import ( PointlessStarredViolation, ) from wemake_python_styleguide.visitors.ast.statements import ( PointlessStarredVisitor, ) @pytest.mark.parametrize('code', [ 'print(*[])', 'print(*())', 'print(*{})', ... | [PointlessStarredViolation, PointlessStarredViolation]) | 54 | 4 |
wemake-services/wemake-python-styleguide | train | 502 | 54e61643f952557855519800afb91363c49894c0 | train | tests/test_visitors/test_ast/test_complexity/test_overuses/test_overused_expressions.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_overuses/test_overused_expressions.py | 202 | 4 | assert_* | test_func_expression_overuse | import pytest
from wemake_python_styleguide.violations.complexity import (
OverusedExpressionViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.overuses import (
ExpressionOveruseVisitor,
)
module_context = """
{0}
{1}
"""
function_context1 = """
def function():
{0}
{1}
"""
function_... | [OverusedExpressionViolation]) | added | 381d6bea854e9299cf27b4d21b8f0358fa14caec2a86904705c1e7c8c35ca11e | assert_*|test_func_expression_overuse|import pytest from wemake_python_styleguide.violations.complexity import ( OverusedExpressionViolation, ) from wemake_python_styleguide.visitors.ast.complexity.overuses import ( ExpressionOveruseVisitor, ) module_context = """ {0} {1} """ function_context1 = """ def function(): {0}... | null | null | null |
wemake-services/wemake-python-styleguide | train | 502 | 54e61643f952557855519800afb91363c49894c0 | train | tests/test_visitors/test_ast/test_complexity/test_overuses/test_overused_expressions.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_overuses/test_overused_expressions.py | 223 | 4 | assert_* | test_module_expression_overuse | import pytest
from wemake_python_styleguide.violations.complexity import (
OverusedExpressionViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.overuses import (
ExpressionOveruseVisitor,
)
module_context = """
{0}
{1}
"""
function_context1 = """
def function():
{0}
{1}
"""
function_... | [OverusedExpressionViolation]) | added | 8b918b7f31cf7b31e5d30eece830ce4b03505b60e9cc8e0745089e00a3d59106 | assert_*|test_module_expression_overuse|import pytest from wemake_python_styleguide.violations.complexity import ( OverusedExpressionViolation, ) from wemake_python_styleguide.visitors.ast.complexity.overuses import ( ExpressionOveruseVisitor, ) module_context = """ {0} {1} """ function_context1 = """ def function(): {... | null | null | null |
wemake-services/wemake-python-styleguide | train | 503 | 7ad2e202921c58309bcc146faa0d8c66265c7bb3 | train | tests/test_visitors/test_ast/test_naming/test_variable_self_reassignment.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_variable_self_reassignment.py | 181 | 4 | assert_* | test_self_variable_reassignment | import pytest
from wemake_python_styleguide.violations.best_practices import (
ReassigningVariableToItselfViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
WrongVariableAssignmentVisitor,
)
# Correct:
right_fragment = """
test_variable = 5
test_variable = 10
"""
right_typed_fragment = ... | [ReassigningVariableToItselfViolation]) | added | 17725508cb712f6ee28dbf1e8e16167996871e9c0b215aaafbe7f8ceb43048b4 | assert_*|test_self_variable_reassignment|import pytest from wemake_python_styleguide.violations.best_practices import ( ReassigningVariableToItselfViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( WrongVariableAssignmentVisitor, ) # Correct: right_fragment = """ test_variable = 5 test_variable = 1... | null | null | null |
wemake-services/wemake-python-styleguide | train | 503 | 7ad2e202921c58309bcc146faa0d8c66265c7bb3 | train | tests/test_visitors/test_ast/test_naming/test_variable_self_reassignment.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_variable_self_reassignment.py | 200 | 4 | assert_* | test_self_variable_reassignment_double | import pytest
from wemake_python_styleguide.violations.best_practices import (
ReassigningVariableToItselfViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
WrongVariableAssignmentVisitor,
)
# Correct:
right_fragment = """
test_variable = 5
test_variable = 10
"""
right_typed_fragment = ... | [ ReassigningVariableToItselfViolation, ReassigningVariableToItselfViolation, ]) | added | e0bc5524b8398e018990dbf28d234d23e542ab9296531827bbaf5d9db023fbd1 | assert_*|test_self_variable_reassignment_double|import pytest from wemake_python_styleguide.violations.best_practices import ( ReassigningVariableToItselfViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( WrongVariableAssignmentVisitor, ) # Correct: right_fragment = """ test_variable = 5 test_varia... | null | null | null |
wemake-services/wemake-python-styleguide | train | 503 | 7ad2e202921c58309bcc146faa0d8c66265c7bb3 | train | tests/test_visitors/test_ast/test_naming/test_variable_self_reassignment.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_variable_self_reassignment.py | 222 | 4 | assert_* | test_self_variable_reassignment_triple | import pytest
from wemake_python_styleguide.violations.best_practices import (
ReassigningVariableToItselfViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
WrongVariableAssignmentVisitor,
)
# Correct:
right_fragment = """
test_variable = 5
test_variable = 10
"""
right_typed_fragment = ... | [ ReassigningVariableToItselfViolation, ReassigningVariableToItselfViolation, ReassigningVariableToItselfViolation, ]) | added | 36efbcadd2248cd9cd2aaaf4925b2154a511325ef1a6a692b99e6165236ba68f | assert_*|test_self_variable_reassignment_triple|import pytest from wemake_python_styleguide.violations.best_practices import ( ReassigningVariableToItselfViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( WrongVariableAssignmentVisitor, ) # Correct: right_fragment = """ test_variable = 5 test_varia... | null | null | null |
wemake-services/wemake-python-styleguide | train | 504 | dce62cb8369596f71c5d211bf91e8d0aca0924e2 | train | tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_rules.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_rules.py | 221 | 4 | assert_* | test_multiple_assignments | import pytest
from wemake_python_styleguide.violations.best_practices import (
SingleElementDestructuringViolation,
WrongUnpackingViolation,
)
from wemake_python_styleguide.violations.consistency import (
UnpackingIterableToListViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
W... | [WrongUnpackingViolation]) | added | 48ce3fad847af77b40b5e71224b81bd46ebc5f46c48916598e2dbcb73eb82abc | assert_*|test_multiple_assignments|import pytest from wemake_python_styleguide.violations.best_practices import ( SingleElementDestructuringViolation, WrongUnpackingViolation, ) from wemake_python_styleguide.violations.consistency import ( UnpackingIterableToListViolation, ) from wemake_python_styleguide.visitors.ast.b... | null | null | null |
wemake-services/wemake-python-styleguide | train | 504 | dce62cb8369596f71c5d211bf91e8d0aca0924e2 | train | tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_rules.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_rules.py | 269 | 4 | assert_* | test_single_element_destructing | import pytest
from wemake_python_styleguide.violations.best_practices import (
SingleElementDestructuringViolation,
WrongUnpackingViolation,
)
from wemake_python_styleguide.violations.consistency import (
UnpackingIterableToListViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
W... | [SingleElementDestructuringViolation]) | added | 2173d48c3a5db484e3bf6d9336e856acdcbf19d84175cc1abf70c7237b850564 | assert_*|test_single_element_destructing|import pytest from wemake_python_styleguide.violations.best_practices import ( SingleElementDestructuringViolation, WrongUnpackingViolation, ) from wemake_python_styleguide.violations.consistency import ( UnpackingIterableToListViolation, ) from wemake_python_styleguide.visitors... | null | null | null |
wemake-services/wemake-python-styleguide | train | 504 | dce62cb8369596f71c5d211bf91e8d0aca0924e2 | train | tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_to_list.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_to_list.py | 101 | 4 | assert_* | test_unpacking_to_list | import pytest
from wemake_python_styleguide.violations.best_practices import (
MultipleAssignmentsViolation,
WrongUnpackingViolation,
)
from wemake_python_styleguide.violations.consistency import (
UnpackingIterableToListViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
WrongAss... | [UnpackingIterableToListViolation]) | added | 8a31d2453bfa377d09794697796962bd759593cfc5033e84a88b444a680ed96f | assert_*|test_unpacking_to_list|import pytest from wemake_python_styleguide.violations.best_practices import ( MultipleAssignmentsViolation, WrongUnpackingViolation, ) from wemake_python_styleguide.violations.consistency import ( UnpackingIterableToListViolation, ) from wemake_python_styleguide.visitors.ast.builtins im... | null | null | null |
wemake-services/wemake-python-styleguide | train | 504 | dce62cb8369596f71c5d211bf91e8d0aca0924e2 | train | tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_to_list.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_to_list.py | 135 | 4 | assert_* | test_unpacking_to_nested_list | import pytest
from wemake_python_styleguide.violations.best_practices import (
MultipleAssignmentsViolation,
WrongUnpackingViolation,
)
from wemake_python_styleguide.violations.consistency import (
UnpackingIterableToListViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
WrongAss... | [UnpackingIterableToListViolation]) | added | 4852ab92a045f184c720a1ab2c6b66d818d782a65be126d71129457e6221b611 | assert_*|test_unpacking_to_nested_list|import pytest from wemake_python_styleguide.violations.best_practices import ( MultipleAssignmentsViolation, WrongUnpackingViolation, ) from wemake_python_styleguide.violations.consistency import ( UnpackingIterableToListViolation, ) from wemake_python_styleguide.visitors.ast.buil... | null | null | null |
wemake-services/wemake-python-styleguide | train | 504 | dce62cb8369596f71c5d211bf91e8d0aca0924e2 | train | tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_to_list.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_to_list.py | 166 | 4 | assert_* | test_unpacking_to_list_in_middle_target | import pytest
from wemake_python_styleguide.violations.best_practices import (
MultipleAssignmentsViolation,
WrongUnpackingViolation,
)
from wemake_python_styleguide.violations.consistency import (
UnpackingIterableToListViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
WrongAss... | [ MultipleAssignmentsViolation, UnpackingIterableToListViolation, ]) | added | 9559bf16cd8709a510b9be0836ff39244c43a55f286c3ff568642bd147eab6d2 | assert_*|test_unpacking_to_list_in_middle_target|import pytest from wemake_python_styleguide.violations.best_practices import ( MultipleAssignmentsViolation, WrongUnpackingViolation, ) from wemake_python_styleguide.violations.consistency import ( UnpackingIterableToListViolation, ) from wemake_python_styleguide.visitor... | null | null | null |
wemake-services/wemake-python-styleguide | train | 505 | d246fb5d7f8d2682005d45590dace26dbc58e171 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 317 | 12 | assert | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | errors | modified | 61c1f82330ca40cfaf75fda0ef1acfb37b07172e329925d29b1480d5cfb99baf | assert||""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contrib... | errors | 316 | 12 | |
wemake-services/wemake-python-styleguide | train | 505 | d246fb5d7f8d2682005d45590dace26dbc58e171 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 320 | 8 | assert | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | errors | modified | 4a214b397ff74a70aab41b51eb25ef3b0219e847da5290b3b38efdaeafbcf4c6 | assert||""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contrib... | errors | 319 | 8 | |
wemake-services/wemake-python-styleguide | train | 505 | d246fb5d7f8d2682005d45590dace26dbc58e171 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 330 | 4 | assert | test_codes | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | len(all_violations) | modified | 33f4b6ccd954746f2f824a1a37dad5ec9c85816b1067f440ed34d2bae122a1e5 | assert|test_codes|""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/a... | len(all_violations) | 329 | 4 |
wemake-services/wemake-python-styleguide | train | 505 | d246fb5d7f8d2682005d45590dace26dbc58e171 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 404 | 4 | assert | test_noqa_fixture_disabled_no_control | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | len(all_controlled_violations) | modified | a02c0fab7be2867c87a86dbd38dfc44cf449b45c379c654afe4ce457c8b3f0f4 | assert|test_noqa_fixture_disabled_no_control|""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-st... | len(all_controlled_violations) | 403 | 4 |
wemake-services/wemake-python-styleguide | train | 505 | d246fb5d7f8d2682005d45590dace26dbc58e171 | train | tests/test_visitors/test_ast/test_subscripts/test_slice_assignment.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_subscripts/test_slice_assignment.py | 35 | 4 | assert_* | test_slice_assignment | import pytest
from wemake_python_styleguide.violations.consistency import (
AssignToSliceViolation,
)
from wemake_python_styleguide.visitors.ast.subscripts import SubscriptVisitor
usage_template = 'constant[{0}] = [1, 2, 3]'
@pytest.mark.parametrize('expression', [
':7',
'1:7:2',
'3:',
'3::',
... | [AssignToSliceViolation]) | added | 8ee87b930ac428142b3905f920d94b27c91a27b11821eedf3b8ee7ba4888ef80 | assert_*|test_slice_assignment|import pytest from wemake_python_styleguide.violations.consistency import ( AssignToSliceViolation, ) from wemake_python_styleguide.visitors.ast.subscripts import SubscriptVisitor usage_template = 'constant[{0}] = [1, 2, 3]' @pytest.mark.parametrize('expression', [ ':7', '1:7:2', '3:', '3... | null | null | null |
wemake-services/wemake-python-styleguide | train | 506 | b1270d3f3ea29fba934b12e2821c4e13a87416ac | train | tests/test_visitors/conftest.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/conftest.py | 37 | 8 | assert | from typing import Optional, Sequence, Tuple, Type, Union
import pytest
from wemake_python_styleguide.violations.base import (
ASTViolation,
BaseViolation,
TokenizeViolation,
)
from wemake_python_styleguide.visitors.base import BaseVisitor
_IgnoredTypes = Union[
Type[BaseViolation],
Tuple[BaseVio... | len(real_errors) | added | d9d5d8c63f01b257071f05a432c3e820576cd55ced4dea0409349e1caf412d00 | assert||from typing import Optional, Sequence, Tuple, Type, Union import pytest from wemake_python_styleguide.violations.base import ( ASTViolation, BaseViolation, TokenizeViolation, ) from wemake_python_styleguide.visitors.base import BaseVisitor _IgnoredTypes = Union[ Type[BaseViolation], Tuple[BaseViolation, ...], N... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 506 | b1270d3f3ea29fba934b12e2821c4e13a87416ac | train | tests/test_visitors/test_ast/test_builtins/test_strings/test_modulo_formatting.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_strings/test_modulo_formatting.py | 99 | 4 | assert_* | test_modulo_formatting | import pytest
from wemake_python_styleguide.violations.complexity import (
TooComplexFormattedStringViolation,
)
from wemake_python_styleguide.violations.consistency import (
FormattedStringViolation,
ModuloStringFormatViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import WrongStringVisit... | [ModuloStringFormatViolation]) | modified | 7a4e70db38b5d2785cbdd2c075c2dc04f5f3b7d54849027e1391f6c4706d1478 | assert_*|test_modulo_formatting|import pytest from wemake_python_styleguide.violations.complexity import ( TooComplexFormattedStringViolation, ) from wemake_python_styleguide.violations.consistency import ( FormattedStringViolation, ModuloStringFormatViolation, ) from wemake_python_styleguide.visitors.ast.builtins impo... | ( FormattedStringViolation, )) | 99 | 4 |
wemake-services/wemake-python-styleguide | train | 506 | b1270d3f3ea29fba934b12e2821c4e13a87416ac | train | tests/test_visitors/test_ast/test_naming/test_class_attributes.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_class_attributes.py | 64 | 4 | assert_* | test_upper_case_class_attributes | import pytest
from wemake_python_styleguide.violations.naming import (
UpperCaseAttributeViolation,
)
from wemake_python_styleguide.visitors.ast.naming.validation import (
WrongNameVisitor,
)
static_attribute = """
class Test(object):
{0} = None
"""
static_typed_attribute = """
class Test(object):
{0... | non_snake_case_name) | modified | 5cc6273d77b5b76f4d2f9e9244c3c773595cf89bd43cb9237d2c8eb7d6f3fb0b | assert_*|test_upper_case_class_attributes|import pytest from wemake_python_styleguide.violations.naming import ( UpperCaseAttributeViolation, ) from wemake_python_styleguide.visitors.ast.naming.validation import ( WrongNameVisitor, ) static_attribute = """ class Test(object): {0} = None """ static_typed_attribute = """... | non_snake_case_name) | 62 | 4 |
wemake-services/wemake-python-styleguide | train | 506 | b1270d3f3ea29fba934b12e2821c4e13a87416ac | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_builtin_shadowing.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_builtin_shadowing.py | 35 | 4 | assert_* | test_builtin_shadowing | import pytest
from wemake_python_styleguide.constants import BUILTINS_WHITELIST
from wemake_python_styleguide.violations.naming import BuiltinShadowingViolation
from wemake_python_styleguide.visitors.ast.naming.validation import (
WrongNameVisitor,
)
real_builtins = frozenset((
'list',
'str',
'sum',
)... | wrong_name) | added | 39a0d55c99df7a287c610668c50084f284df171dd07e47dd1b23347cbba1ea47 | assert_*|test_builtin_shadowing|import pytest from wemake_python_styleguide.constants import BUILTINS_WHITELIST from wemake_python_styleguide.violations.naming import BuiltinShadowingViolation from wemake_python_styleguide.visitors.ast.naming.validation import ( WrongNameVisitor, ) real_builtins = frozenset(( 'list', '... | null | null | null |
wemake-services/wemake-python-styleguide | train | 506 | b1270d3f3ea29fba934b12e2821c4e13a87416ac | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_private.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_private.py | 22 | 4 | assert_* | test_private_variable_name | from wemake_python_styleguide.violations.naming import PrivateNameViolation
from wemake_python_styleguide.visitors.ast.naming.validation import (
WrongNameVisitor,
)
def test_private_variable_name(
assert_errors,
assert_error_text,
parse_ast_tree,
naming_template,
default_options,
mode,
):... | [PrivateNameViolation]) | modified | 86fb1b331a2b8f197135fe9bb64d6adee92623158c8030dd1ee454e93061235b | assert_*|test_private_variable_name|from wemake_python_styleguide.violations.naming import PrivateNameViolation from wemake_python_styleguide.visitors.ast.naming.validation import ( WrongNameVisitor, ) def test_private_variable_name( assert_errors, assert_error_text, parse_ast_tree, naming_template, default_options, mo... | [PrivateNameViolation]) | 20 | 4 |
wemake-services/wemake-python-styleguide | train | 506 | b1270d3f3ea29fba934b12e2821c4e13a87416ac | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_short.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_short.py | 88 | 4 | assert_* | test_naming_length_settings | import pytest
from wemake_python_styleguide.violations.naming import (
TooShortNameViolation,
TrailingUnderscoreViolation,
)
from wemake_python_styleguide.visitors.ast.naming.validation import (
WrongNameVisitor,
)
patterns = (
'y',
'_x',
'z_',
)
@pytest.mark.parametrize('short_name', patter... | option_values.min_name_length) | added | 410bdd53cd4acf23c9956982bb22706f785f5621d2015f34900d634ff08a7237 | assert_*|test_naming_length_settings|import pytest from wemake_python_styleguide.violations.naming import ( TooShortNameViolation, TrailingUnderscoreViolation, ) from wemake_python_styleguide.visitors.ast.naming.validation import ( WrongNameVisitor, ) patterns = ( 'y', '_x', 'z_', ) @pytest.mark.parametrize('short_name... | null | null | null |
wemake-services/wemake-python-styleguide | train | 506 | b1270d3f3ea29fba934b12e2821c4e13a87416ac | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_unicode.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_unicode.py | 31 | 4 | assert_* | test_wrong_unicode | import pytest
from wemake_python_styleguide.violations.naming import UnicodeNameViolation
from wemake_python_styleguide.visitors.ast.naming.validation import (
WrongNameVisitor,
)
@pytest.mark.parametrize('wrong_name', [
'тестовое_имя',
'test_имя2',
'сос', # written with identical to ASCII russian c... | wrong_name) | modified | ee2a2adeac8a98da0ffff57eb26e9a74d5086aaf9c38c7ae6e314da906f0d45d | assert_*|test_wrong_unicode|import pytest from wemake_python_styleguide.violations.naming import UnicodeNameViolation from wemake_python_styleguide.visitors.ast.naming.validation import ( WrongNameVisitor, ) @pytest.mark.parametrize('wrong_name', [ 'тестовое_имя', 'test_имя2', 'сос', # written with identical to ASCII r... | wrong_name) | 29 | 4 |
wemake-services/wemake-python-styleguide | train | 506 | b1270d3f3ea29fba934b12e2821c4e13a87416ac | train | tests/test_visitors/test_ast/test_naming/test_unused/test_variable_usages.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_unused/test_variable_usages.py | 148 | 4 | assert_* | test_wrong_variable_usage | import pytest
from wemake_python_styleguide.violations.naming import (
UnusedVariableIsUsedViolation,
)
from wemake_python_styleguide.visitors.ast.naming.validation import (
WrongNameVisitor,
)
from wemake_python_styleguide.visitors.ast.naming.variables import (
UnusedVariableUsageVisitor,
)
annotation = ... | [UnusedVariableIsUsedViolation]) | modified | 62e81828abe33bfd46f8e41e91ab8fe7eaae5062ae718c9fc97787bae4fd368a | assert_*|test_wrong_variable_usage|import pytest from wemake_python_styleguide.violations.naming import ( UnusedVariableIsUsedViolation, ) from wemake_python_styleguide.visitors.ast.naming.validation import ( WrongNameVisitor, ) from wemake_python_styleguide.visitors.ast.naming.variables import ( UnusedVariableUsageVis... | [UnusedVariableIsUsedViolation]) | 146 | 4 |
wemake-services/wemake-python-styleguide | train | 507 | 02f8d30c4689a69c84915aa51af50a918c381331 | train | tests/test_visitors/conftest.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/conftest.py | 37 | 8 | assert | from typing import Optional, Sequence, Tuple, Type, Union
import pytest
from wemake_python_styleguide.violations.base import (
ASTViolation,
BaseViolation,
TokenizeViolation,
)
from wemake_python_styleguide.visitors.base import BaseVisitor
_IgnoredTypes = Union[
Type[BaseViolation],
Tuple[Type[Ba... | len(real_errors) | modified | 00c80bcbb774da4e0094c353b07b2ebd9ece6fa7f463709ceaa707929be3b01a | assert||from typing import Optional, Sequence, Tuple, Type, Union import pytest from wemake_python_styleguide.violations.base import ( ASTViolation, BaseViolation, TokenizeViolation, ) from wemake_python_styleguide.visitors.base import BaseVisitor _IgnoredTypes = Union[ Type[BaseViolation], Tuple[Type[BaseViolation], .... | len(real_errors) | 37 | 8 | |
wemake-services/wemake-python-styleguide | train | 507 | 02f8d30c4689a69c84915aa51af50a918c381331 | train | tests/test_visitors/conftest.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/conftest.py | 40 | 12 | assert | from typing import Optional, Sequence, Tuple, Type, Union
import pytest
from wemake_python_styleguide.violations.base import (
ASTViolation,
BaseViolation,
TokenizeViolation,
)
from wemake_python_styleguide.visitors.base import BaseVisitor
_IgnoredTypes = Union[
Type[BaseViolation],
Tuple[Type[Ba... | errors[index].code | modified | bda1c4551c3956df423f6d29724bb1201fbc5ef9bd60fbf2a621cc6191ec05b6 | assert||from typing import Optional, Sequence, Tuple, Type, Union import pytest from wemake_python_styleguide.violations.base import ( ASTViolation, BaseViolation, TokenizeViolation, ) from wemake_python_styleguide.visitors.base import BaseVisitor _IgnoredTypes = Union[ Type[BaseViolation], Tuple[Type[BaseViolation], .... | errors[index].code | 40 | 12 | |
wemake-services/wemake-python-styleguide | train | 507 | 02f8d30c4689a69c84915aa51af50a918c381331 | train | tests/test_visitors/conftest.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/conftest.py | 74 | 8 | assert | from typing import Optional, Sequence, Tuple, Type, Union
import pytest
from wemake_python_styleguide.violations.base import (
ASTViolation,
BaseViolation,
TokenizeViolation,
)
from wemake_python_styleguide.visitors.base import BaseVisitor
_IgnoredTypes = Union[
Type[BaseViolation],
Tuple[Type[Ba... | violation.error_template | modified | 7ec92d99fcf586ea784d44452e71b50ecabd7f6cbfcc59f9c3c4fb84d5d1e815 | assert||from typing import Optional, Sequence, Tuple, Type, Union import pytest from wemake_python_styleguide.violations.base import ( ASTViolation, BaseViolation, TokenizeViolation, ) from wemake_python_styleguide.visitors.base import BaseVisitor _IgnoredTypes = Union[ Type[BaseViolation], Tuple[Type[BaseViolation], .... | violation.error_template | 74 | 8 | |
wemake-services/wemake-python-styleguide | train | 507 | 02f8d30c4689a69c84915aa51af50a918c381331 | train | tests/test_visitors/conftest.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/conftest.py | 75 | 8 | assert | from typing import Optional, Sequence, Tuple, Type, Union
import pytest
from wemake_python_styleguide.violations.base import (
ASTViolation,
BaseViolation,
TokenizeViolation,
)
from wemake_python_styleguide.visitors.base import BaseVisitor
_IgnoredTypes = Union[
Type[BaseViolation],
Tuple[Type[Ba... | violation.error_template.endswith(error_format) | modified | 635ec6e9c25b5018ea8eae58833bb925567ca1c2417053e4ba470029f24da3d0 | assert||from typing import Optional, Sequence, Tuple, Type, Union import pytest from wemake_python_styleguide.violations.base import ( ASTViolation, BaseViolation, TokenizeViolation, ) from wemake_python_styleguide.visitors.base import BaseVisitor _IgnoredTypes = Union[ Type[BaseViolation], Tuple[Type[BaseViolation], .... | violation.error_template.endswith(error_format) | 75 | 8 | |
wemake-services/wemake-python-styleguide | train | 507 | 02f8d30c4689a69c84915aa51af50a918c381331 | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_reserved_argument.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_reserved_argument.py | 50 | 8 | assert_* | test_reserved_argument_name | from contextlib import suppress
import pytest
from wemake_python_styleguide.constants import SPECIAL_ARGUMENT_NAMES_WHITELIST
from wemake_python_styleguide.violations.naming import (
ReservedArgumentNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming.validation import (
WrongNameVisitor,
)
# C... | [ReservedArgumentNameViolation]) | modified | 785b2c8f157c4916f2bb5563e6f7b812bd4559a6ec5e867f91cd88e9ed00b285 | assert_*|test_reserved_argument_name|from contextlib import suppress import pytest from wemake_python_styleguide.constants import SPECIAL_ARGUMENT_NAMES_WHITELIST from wemake_python_styleguide.violations.naming import ( ReservedArgumentNameViolation, ) from wemake_python_styleguide.visitors.ast.naming.validation import... | [ReservedArgumentNameViolation]) | 50 | 8 |
wemake-services/wemake-python-styleguide | train | 507 | 02f8d30c4689a69c84915aa51af50a918c381331 | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_reserved_argument.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_reserved_argument.py | 51 | 8 | assert_* | test_reserved_argument_name | from contextlib import suppress
import pytest
from wemake_python_styleguide.constants import SPECIAL_ARGUMENT_NAMES_WHITELIST
from wemake_python_styleguide.violations.naming import (
ReservedArgumentNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming.validation import (
WrongNameVisitor,
)
# C... | argument) | modified | 4c9eb9ea996cc92a0d84ced51c85e2d166812452fd5e5d185e71c326890384dd | assert_*|test_reserved_argument_name|from contextlib import suppress import pytest from wemake_python_styleguide.constants import SPECIAL_ARGUMENT_NAMES_WHITELIST from wemake_python_styleguide.violations.naming import ( ReservedArgumentNameViolation, ) from wemake_python_styleguide.visitors.ast.naming.validation import... | argument) | 51 | 8 |
wemake-services/wemake-python-styleguide | train | 508 | 76c1a16cd0b3340a37c9da1c46f19012a72d5667 | train | tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_rules.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_rules.py | 224 | 4 | assert_* | test_multiple_assignments | import pytest
from wemake_python_styleguide.violations.best_practices import (
SingleElementDestructuringViolation,
WrongUnpackingViolation,
)
from wemake_python_styleguide.violations.consistency import (
UnpackingIterableToListViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
W... | [WrongUnpackingViolation]) | modified | 8eedc22797cd539eba55efa23d100f85e9419fed1c0b833dc1d19693ef38b38b | assert_*|test_multiple_assignments|import pytest from wemake_python_styleguide.violations.best_practices import ( SingleElementDestructuringViolation, WrongUnpackingViolation, ) from wemake_python_styleguide.violations.consistency import ( UnpackingIterableToListViolation, ) from wemake_python_styleguide.visitors.ast.b... | [WrongUnpackingViolation]) | 221 | 4 |
wemake-services/wemake-python-styleguide | train | 508 | 76c1a16cd0b3340a37c9da1c46f19012a72d5667 | train | tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_rules.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_rules.py | 272 | 4 | assert_* | test_single_element_destructing | import pytest
from wemake_python_styleguide.violations.best_practices import (
SingleElementDestructuringViolation,
WrongUnpackingViolation,
)
from wemake_python_styleguide.violations.consistency import (
UnpackingIterableToListViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
W... | [SingleElementDestructuringViolation]) | modified | 97a18f975fa8b5ff1d2d46a355ba2e426854bec01f7127d056edac1241854ebb | assert_*|test_single_element_destructing|import pytest from wemake_python_styleguide.violations.best_practices import ( SingleElementDestructuringViolation, WrongUnpackingViolation, ) from wemake_python_styleguide.violations.consistency import ( UnpackingIterableToListViolation, ) from wemake_python_styleguide.visitors... | [SingleElementDestructuringViolation]) | 269 | 4 |
wemake-services/wemake-python-styleguide | train | 508 | 76c1a16cd0b3340a37c9da1c46f19012a72d5667 | train | tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_to_list.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_assign/test_unpacking_to_list.py | 166 | 4 | assert_* | test_unpacking_to_list_in_middle_target | import pytest
from wemake_python_styleguide.violations.best_practices import (
MultipleAssignmentsViolation,
WrongUnpackingViolation,
)
from wemake_python_styleguide.violations.consistency import (
UnpackingIterableToListViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
WrongAss... | [ MultipleAssignmentsViolation, UnpackingIterableToListViolation, ]) | modified | 00047e672d3ef14f43d1bbf86df9bc207bb658d2e25eadaa4633ed69ca4bd3c5 | assert_*|test_unpacking_to_list_in_middle_target|import pytest from wemake_python_styleguide.violations.best_practices import ( MultipleAssignmentsViolation, WrongUnpackingViolation, ) from wemake_python_styleguide.violations.consistency import ( UnpackingIterableToListViolation, ) from wemake_python_styleguide.visitor... | [ MultipleAssignmentsViolation, UnpackingIterableToListViolation, ]) | 166 | 4 |
wemake-services/wemake-python-styleguide | train | 509 | bf38484ab68ba813ba22ffb6b89686d5387df24d | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 324 | 12 | assert | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | errors | modified | f8f76ab21bc5210bdb9c25bf5d61e339026b15a62a9202cc0711b15e3f01c9a9 | assert||""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contrib... | errors.get(found_error) | 321 | 8 | |
wemake-services/wemake-python-styleguide | train | 509 | bf38484ab68ba813ba22ffb6b89686d5387df24d | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 327 | 8 | assert | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | errors | added | 2a05bbf4d7a86598e64808aee5f37c74142222786d4d15dc50d95d1d27049136 | assert||""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contrib... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 509 | bf38484ab68ba813ba22ffb6b89686d5387df24d | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 337 | 4 | assert | test_codes | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | len(all_violations) | added | 50d3f2161becb74278f5060260907ee67e6fcb231b3b27c7fc7af8de5eb94d64 | assert|test_codes|""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/a... | null | null | null |
wemake-services/wemake-python-styleguide | train | 509 | bf38484ab68ba813ba22ffb6b89686d5387df24d | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 422 | 4 | assert | test_noqa_fixture_disabled_no_control | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | len(all_controlled_violations) | added | 6256f4c0d88158e76c60f7bf2fa8d9335cd94fd6aab497589874048111f1eb6b | assert|test_noqa_fixture_disabled_no_control|""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-st... | null | null | null |
wemake-services/wemake-python-styleguide | train | 509 | bf38484ab68ba813ba22ffb6b89686d5387df24d | train | tests/test_visitors/test_ast/test_decorators/test_new_style_decorators.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_decorators/test_new_style_decorators.py | 59 | 4 | assert_* | test_invalid_decorators | import pytest
from wemake_python_styleguide.compat.constants import PY39
from wemake_python_styleguide.violations.best_practices import (
NewStyledDecoratorViolation,
)
from wemake_python_styleguide.visitors.ast.decorators import (
WrongDecoratorVisitor,
)
_reason = 'new-styled decorators appeared in 3.9'
_ma... | [NewStyledDecoratorViolation]) | added | e179da0cdb9e5559c1d579a5da06bfd60d13766ec56d5e89fa9877e59823ecc7 | assert_*|test_invalid_decorators|import pytest from wemake_python_styleguide.compat.constants import PY39 from wemake_python_styleguide.violations.best_practices import ( NewStyledDecoratorViolation, ) from wemake_python_styleguide.visitors.ast.decorators import ( WrongDecoratorVisitor, ) _reason = 'new-styled decorato... | null | null | null |
wemake-services/wemake-python-styleguide | train | 510 | 6fe3f95d51f0d7e61c906bf7f444ac181d5c2645 | train | tests/test_visitors/test_ast/test_exceptions/test_exception_order.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_exceptions/test_exception_order.py | 92 | 4 | assert_* | test_wrong_order_exception | import pytest
from wemake_python_styleguide.violations.best_practices import (
IncorrectExceptOrderViolation,
)
from wemake_python_styleguide.visitors.ast.exceptions import (
WrongTryExceptVisitor,
)
exception_template = """
try:
...
except {0}:
...
except {1}:
...
"""
custom_exception_template1 ... | [IncorrectExceptOrderViolation]) | modified | 665cabb5eec4e851fcd92ca8eb7225018ab3e1150856a2b1789e16c670b74c93 | assert_*|test_wrong_order_exception|import pytest from wemake_python_styleguide.violations.best_practices import ( IncorrectExceptOrderViolation, ) from wemake_python_styleguide.visitors.ast.exceptions import ( WrongTryExceptVisitor, ) exception_template = """ try: ... except {0}: ... except {1}: ... """ custom_excepti... | [IncorrectExceptOrderViolation]) | 92 | 4 |
wemake-services/wemake-python-styleguide | train | 511 | 56132c8bba5e752b2d9c41a6fd6a2b28f347bc0c | train | tests/test_visitors/test_tokenize/test_keywords/test_keywords_spaces.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_keywords/test_keywords_spaces.py | 72 | 4 | assert_* | test_missing_space | import sys
import pytest
from wemake_python_styleguide.violations.consistency import (
MissingSpaceBetweenKeywordAndParenViolation,
)
from wemake_python_styleguide.visitors.tokenize.syntax import (
WrongKeywordTokenVisitor,
)
multiline_error_function = """
def foo():
yield(1, 2, 3)
"""
multiline_error_s... | [MissingSpaceBetweenKeywordAndParenViolation]) | modified | 3e51717e062f40c12bd72cac88e2f6aee3d04454c5e0d0409d00aff75ab213dc | assert_*|test_missing_space|import sys import pytest from wemake_python_styleguide.violations.consistency import ( MissingSpaceBetweenKeywordAndParenViolation, ) from wemake_python_styleguide.visitors.tokenize.syntax import ( WrongKeywordTokenVisitor, ) multiline_error_function = """ def foo(): yield(1, 2, 3) """ multi... | [MissingSpaceBetweenKeywordAndParenViolation]) | 72 | 4 |
wemake-services/wemake-python-styleguide | train | 511 | 56132c8bba5e752b2d9c41a6fd6a2b28f347bc0c | train | tests/test_visitors/test_tokenize/test_primitives/test_string_tokens/test_implicit_string_concatenation.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_primitives/test_string_tokens/test_implicit_string_concatenation.py | 79 | 4 | assert_* | test_implicit_string_concatenation | import pytest
from wemake_python_styleguide.violations.consistency import (
ImplicitStringConcatenationViolation,
)
from wemake_python_styleguide.visitors.tokenize.primitives import (
WrongStringConcatenationVisitor,
)
# Correct:
correct_string_sum = 'some = "a" + "b"'
correct_tuple_with_strings = """
some ... | [ImplicitStringConcatenationViolation]) | modified | d3825b6a62e5a1161815a92804176b649e4d2251fe2b4e20d27d6e66b2f64183 | assert_*|test_implicit_string_concatenation|import pytest from wemake_python_styleguide.violations.consistency import ( ImplicitStringConcatenationViolation, ) from wemake_python_styleguide.visitors.tokenize.primitives import ( WrongStringConcatenationVisitor, ) # Correct: correct_string_sum = 'some = "a" + "b"' correc... | [ImplicitStringConcatenationViolation]) | 79 | 4 |
wemake-services/wemake-python-styleguide | train | 511 | 56132c8bba5e752b2d9c41a6fd6a2b28f347bc0c | train | tests/test_visitors/test_tokenize/test_primitives/test_string_tokens/test_unicode_escape.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_primitives/test_string_tokens/test_unicode_escape.py | 75 | 4 | assert_* | test_correct_unicode_string_escape | import pytest
from wemake_python_styleguide.violations.best_practices import (
WrongUnicodeEscapeViolation,
)
from wemake_python_styleguide.violations.consistency import (
UnicodeStringViolation,
UppercaseStringModifierViolation,
)
from wemake_python_styleguide.visitors.tokenize.primitives import (
Wro... | [UnicodeStringViolation]) | modified | 0654e50db41a22847ec525d049b47cc8d8a1061eb725836444f0c02a24ebe4ee | assert_*|test_correct_unicode_string_escape|import pytest from wemake_python_styleguide.violations.best_practices import ( WrongUnicodeEscapeViolation, ) from wemake_python_styleguide.violations.consistency import ( UnicodeStringViolation, UppercaseStringModifierViolation, ) from wemake_python_styleguide.visitors.token... | [UnicodeStringViolation]) | 75 | 4 |
wemake-services/wemake-python-styleguide | train | 511 | 56132c8bba5e752b2d9c41a6fd6a2b28f347bc0c | train | tests/test_visitors/test_tokenize/test_primitives/test_string_tokens/test_unicode_escape.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_primitives/test_string_tokens/test_unicode_escape.py | 96 | 4 | assert_* | test_correct_unicode_upper_string_escape | import pytest
from wemake_python_styleguide.violations.best_practices import (
WrongUnicodeEscapeViolation,
)
from wemake_python_styleguide.violations.consistency import (
UnicodeStringViolation,
UppercaseStringModifierViolation,
)
from wemake_python_styleguide.visitors.tokenize.primitives import (
Wro... | [ UnicodeStringViolation, UppercaseStringModifierViolation, ]) | modified | 5becb2b60c39733522d3ce419db4bf8c9865d75c579d0c272b79e6f836042769 | assert_*|test_correct_unicode_upper_string_escape|import pytest from wemake_python_styleguide.violations.best_practices import ( WrongUnicodeEscapeViolation, ) from wemake_python_styleguide.violations.consistency import ( UnicodeStringViolation, UppercaseStringModifierViolation, ) from wemake_python_styleguide.visitors... | [ UnicodeStringViolation, UppercaseStringModifierViolation, ]) | 96 | 4 |
wemake-services/wemake-python-styleguide | train | 511 | 56132c8bba5e752b2d9c41a6fd6a2b28f347bc0c | train | tests/test_visitors/test_tokenize/test_primitives/test_string_tokens/test_unicode_prefix.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_primitives/test_string_tokens/test_unicode_prefix.py | 78 | 4 | assert_* | test_unicode_regression | import pytest
from wemake_python_styleguide.violations.consistency import (
UnicodeStringViolation,
UppercaseStringModifierViolation,
)
from wemake_python_styleguide.visitors.tokenize.primitives import (
WrongStringTokenVisitor,
)
@pytest.mark.parametrize('primitive', [
'u"text"',
"u'unicode'",
... | [ UnicodeStringViolation, UppercaseStringModifierViolation, ]) | modified | e4c8486d6e39ba49edae0c01b00e013418456af57e63342aa47bdb555bf78056 | assert_*|test_unicode_regression|import pytest from wemake_python_styleguide.violations.consistency import ( UnicodeStringViolation, UppercaseStringModifierViolation, ) from wemake_python_styleguide.visitors.tokenize.primitives import ( WrongStringTokenVisitor, ) @pytest.mark.parametrize('primitive', [ 'u"text"', "u'un... | [ UnicodeStringViolation, UppercaseStringModifierViolation, ]) | 75 | 4 |
wemake-services/wemake-python-styleguide | train | 511 | 56132c8bba5e752b2d9c41a6fd6a2b28f347bc0c | train | tests/test_visitors/test_tokenize/test_statements/test_inconsistent_comprehension.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_statements/test_inconsistent_comprehension.py | 535 | 4 | assert_* | test_wrong_comprehension_consistency | import pytest
from wemake_python_styleguide.violations.consistency import (
InconsistentComprehensionViolation,
)
from wemake_python_styleguide.visitors.tokenize.statements import (
InconsistentComprehensionVisitor,
)
# Tests that should NOT be flagged
# List comprehension tests
correct_list_empty = '[]'
c... | [InconsistentComprehensionViolation]) | added | 1aacee5dfd621fbd1c7ae462172493358fc01cd7d31814093e719b8dbc420641 | assert_*|test_wrong_comprehension_consistency|import pytest from wemake_python_styleguide.violations.consistency import ( InconsistentComprehensionViolation, ) from wemake_python_styleguide.visitors.tokenize.statements import ( InconsistentComprehensionVisitor, ) # Tests that should NOT be flagged # List comprehension ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 511 | 56132c8bba5e752b2d9c41a6fd6a2b28f347bc0c | train | tests/test_visitors/test_tokenize/test_statements/test_inconsistent_comprehension.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_statements/test_inconsistent_comprehension.py | 614 | 4 | assert_* | test_wrong_async_keyword_placement | import pytest
from wemake_python_styleguide.violations.consistency import (
InconsistentComprehensionViolation,
)
from wemake_python_styleguide.visitors.tokenize.statements import (
InconsistentComprehensionVisitor,
)
# Tests that should NOT be flagged
# List comprehension tests
correct_list_empty = '[]'
c... | [InconsistentComprehensionViolation]) | added | 526ddfada004198cd139bec8350732735b74fe39af78c28711d50994c1728983 | assert_*|test_wrong_async_keyword_placement|import pytest from wemake_python_styleguide.violations.consistency import ( InconsistentComprehensionViolation, ) from wemake_python_styleguide.visitors.tokenize.statements import ( InconsistentComprehensionVisitor, ) # Tests that should NOT be flagged # List comprehension te... | null | null | null |
wemake-services/wemake-python-styleguide | train | 511 | 56132c8bba5e752b2d9c41a6fd6a2b28f347bc0c | train | tests/test_visitors/test_tokenize/test_statements/test_multiline_string.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_statements/test_multiline_string.py | 85 | 4 | assert_* | test_wrong_multiline_string_use | import pytest
from wemake_python_styleguide.violations.best_practices import (
WrongMultilineStringUseViolation,
)
from wemake_python_styleguide.visitors.tokenize.statements import (
MultilineStringVisitor,
)
correct_assignment = '''
a = """abc
abc
"""
'''
correct_docstring = '''
def test():
"""{0}"""
''... | [WrongMultilineStringUseViolation]) | modified | 299fbf912be87fb0c0c0f07d584a5172bc6442a34d0d3dddaa347aeb7cb4fea9 | assert_*|test_wrong_multiline_string_use|import pytest from wemake_python_styleguide.violations.best_practices import ( WrongMultilineStringUseViolation, ) from wemake_python_styleguide.visitors.tokenize.statements import ( MultilineStringVisitor, ) correct_assignment = ''' a = """abc abc """ ''' correct_docstring = ''... | [WrongMultilineStringUseViolation]) | 85 | 4 |
wemake-services/wemake-python-styleguide | train | 512 | 5671e97579175137c82dccb345dd220b74fb5dd1 | train | tests/test_visitors/test_ast/test_compares/test_conditionals.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_conditionals.py | 135 | 4 | assert_* | test_constant_condition | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.consistency import (
ConstantConditionViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
WrongConditionalVisitor,
)
create_variable = """
variable = 1
{0}
"""
if_statement ... | [ConstantConditionViolation]) | added | 2fa02002ec2d0d1d53dd36c357d9f620f7eabf925bf206f50ef67cb4ae1869b7 | assert_*|test_constant_condition|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.consistency import ( ConstantConditionViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( WrongConditionalVisitor, ) create_variable = """ variable = 1... | null | null | null |
wemake-services/wemake-python-styleguide | train | 512 | 5671e97579175137c82dccb345dd220b74fb5dd1 | train | tests/test_visitors/test_ast/test_compares/test_nested_ternary.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_nested_ternary.py | 183 | 4 | assert_* | test_nested_ternary | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.refactoring import (
NestedTernaryViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
WrongConditionalVisitor,
)
wrong_compare1 = 'x > (a if b else c)'
wrong_compare2 = '(a i... | [NestedTernaryViolation]) | added | 5de500b249161e86b6c10676a696853deacf57aa721c747c70d056c81a7bba23 | assert_*|test_nested_ternary|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.refactoring import ( NestedTernaryViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( WrongConditionalVisitor, ) wrong_compare1 = 'x > (a if b else c)' wro... | null | null | null |
wemake-services/wemake-python-styleguide | train | 512 | 5671e97579175137c82dccb345dd220b74fb5dd1 | train | tests/test_visitors/test_tokenize/test_statements/test_inconsistent_comprehension.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_statements/test_inconsistent_comprehension.py | 547 | 4 | assert_* | test_wrong_comprehension_consistency | import pytest
from wemake_python_styleguide.violations.consistency import (
InconsistentComprehensionViolation,
)
from wemake_python_styleguide.visitors.tokenize.statements import (
InconsistentComprehensionVisitor,
)
# Tests that should NOT be flagged
# List comprehension tests
correct_list_empty = '[]'
c... | [InconsistentComprehensionViolation]) | added | e639bd490c3ea00c7bc72dace32d477fe857929123c7d699a410e82630e8d17d | assert_*|test_wrong_comprehension_consistency|import pytest from wemake_python_styleguide.violations.consistency import ( InconsistentComprehensionViolation, ) from wemake_python_styleguide.visitors.tokenize.statements import ( InconsistentComprehensionVisitor, ) # Tests that should NOT be flagged # List comprehension ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 512 | 5671e97579175137c82dccb345dd220b74fb5dd1 | train | tests/test_visitors/test_tokenize/test_statements/test_inconsistent_comprehension.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_statements/test_inconsistent_comprehension.py | 626 | 4 | assert_* | test_wrong_async_keyword_placement | import pytest
from wemake_python_styleguide.violations.consistency import (
InconsistentComprehensionViolation,
)
from wemake_python_styleguide.visitors.tokenize.statements import (
InconsistentComprehensionVisitor,
)
# Tests that should NOT be flagged
# List comprehension tests
correct_list_empty = '[]'
c... | [InconsistentComprehensionViolation]) | added | 3687f4d557f3e8b83fc683fa784a6e8e17e8d60fba0a1d95535d2ec4c08017f3 | assert_*|test_wrong_async_keyword_placement|import pytest from wemake_python_styleguide.violations.consistency import ( InconsistentComprehensionViolation, ) from wemake_python_styleguide.visitors.tokenize.statements import ( InconsistentComprehensionVisitor, ) # Tests that should NOT be flagged # List comprehension te... | null | null | null |
wemake-services/wemake-python-styleguide | train | 513 | 1f94c390491374ef88a483de66e88228c3104bac | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 324 | 12 | assert | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | errors | modified | a70801f9abb8fb86037ac4dafee0b4c079980a672c55b6e885bb130ec3cb3b3e | assert||""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contrib... | errors | 324 | 12 | |
wemake-services/wemake-python-styleguide | train | 513 | 1f94c390491374ef88a483de66e88228c3104bac | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 422 | 4 | assert | test_noqa_fixture_disabled_no_control | """
Integration tests definition.
These are integration tests for several things:
1. that violation is active and enabled
2. that violation is raised for the bad code
3. that line number where violation is raised is correct
4. that `noqa` works
Docs: https://wemake-python-stylegui.de/en/latest/pages/api/contributing... | len(all_controlled_violations) | modified | afb3e6f460084c96de435a0fad6f6e07296b60f183fce0db1abf901ab5ae46de | assert|test_noqa_fixture_disabled_no_control|""" Integration tests definition. These are integration tests for several things: 1. that violation is active and enabled 2. that violation is raised for the bad code 3. that line number where violation is raised is correct 4. that `noqa` works Docs: https://wemake-python-st... | len(all_controlled_violations) | 422 | 4 |
wemake-services/wemake-python-styleguide | train | 513 | 1f94c390491374ef88a483de66e88228c3104bac | train | tests/test_visitors/test_ast/test_conditions/test_simplifiable_if_statements.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_conditions/test_simplifiable_if_statements.py | 142 | 4 | assert_* | test_simplifiable_early_returning_if | import pytest
from wemake_python_styleguide.violations.refactoring import (
SimplifiableReturningIfViolation,
)
from wemake_python_styleguide.visitors.ast.conditions import IfStatementVisitor
complex_else = """
def some_function():
if some_condition:
return {0}
else:
a = 1
return {... | [SimplifiableReturningIfViolation]) | added | 41d27960266a2e2848285d00b0641bae0d284a2f59d77795a1d24703fa9f92dd | assert_*|test_simplifiable_early_returning_if|import pytest from wemake_python_styleguide.violations.refactoring import ( SimplifiableReturningIfViolation, ) from wemake_python_styleguide.visitors.ast.conditions import IfStatementVisitor complex_else = """ def some_function(): if some_condition: return {0} else: a = 1 ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 513 | 1f94c390491374ef88a483de66e88228c3104bac | train | tests/test_visitors/test_ast/test_conditions/test_useless_else/test_useless_if_else.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_conditions/test_useless_else/test_useless_if_else.py | 252 | 4 | assert_* | test_else_that_can_be_removed_in_function | import pytest
from wemake_python_styleguide.violations.refactoring import (
UselessReturningElseViolation,
)
from wemake_python_styleguide.visitors.ast.conditions import UselessElseVisitor
# Correct:
correct_example1 = """
def function():
if some_condition:
return None
return None
"""
correct_ex... | [UselessReturningElseViolation]) | added | 51ce02262f2864b206e9afaa1b4a75950358284dce4994aada674b046e1a4c9b | assert_*|test_else_that_can_be_removed_in_function|import pytest from wemake_python_styleguide.violations.refactoring import ( UselessReturningElseViolation, ) from wemake_python_styleguide.visitors.ast.conditions import UselessElseVisitor # Correct: correct_example1 = """ def function(): if some_condition: return None... | null | null | null |
wemake-services/wemake-python-styleguide | train | 513 | 1f94c390491374ef88a483de66e88228c3104bac | train | tests/test_visitors/test_ast/test_conditions/test_useless_else/test_useless_if_else.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_conditions/test_useless_else/test_useless_if_else.py | 350 | 4 | assert_* | test_else_that_can_be_removed_in_module | import pytest
from wemake_python_styleguide.violations.refactoring import (
UselessReturningElseViolation,
)
from wemake_python_styleguide.visitors.ast.conditions import UselessElseVisitor
# Correct:
correct_example1 = """
def function():
if some_condition:
return None
return None
"""
correct_ex... | [UselessReturningElseViolation]) | added | 14d7c4fbb98bcbfef1b400da78003cdd367b35375f592eff672ca254bbca0320 | assert_*|test_else_that_can_be_removed_in_module|import pytest from wemake_python_styleguide.violations.refactoring import ( UselessReturningElseViolation, ) from wemake_python_styleguide.visitors.ast.conditions import UselessElseVisitor # Correct: correct_example1 = """ def function(): if some_condition: return None r... | null | null | null |
wemake-services/wemake-python-styleguide | train | 513 | 1f94c390491374ef88a483de66e88228c3104bac | train | tests/test_visitors/test_ast/test_conditions/test_useless_else/test_useless_loop_else.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_conditions/test_useless_else/test_useless_loop_else.py | 153 | 4 | assert_* | test_else_that_can_be_removed | import pytest
from wemake_python_styleguide.violations.refactoring import (
UselessReturningElseViolation,
)
from wemake_python_styleguide.visitors.ast.conditions import UselessElseVisitor
# Correct:
correct_example1 = """
def wrapper():
for x in ...:
raise ...
"""
correct_example2 = """
while ...:
... | [UselessReturningElseViolation]) | added | 7680d9673c50de049b981b59c4506c057ac66473ec82d907f088413540fbc76e | assert_*|test_else_that_can_be_removed|import pytest from wemake_python_styleguide.violations.refactoring import ( UselessReturningElseViolation, ) from wemake_python_styleguide.visitors.ast.conditions import UselessElseVisitor # Correct: correct_example1 = """ def wrapper(): for x in ...: raise ... """ correct_example... | null | null | null |
wemake-services/wemake-python-styleguide | train | 513 | 1f94c390491374ef88a483de66e88228c3104bac | train | tests/test_visitors/test_ast/test_conditions/test_useless_else/test_useless_try_else.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_conditions/test_useless_else/test_useless_try_else.py | 241 | 4 | assert_* | test_else_that_can_be_removed_in_loop | import pytest
from wemake_python_styleguide.violations.refactoring import (
UselessReturningElseViolation,
)
from wemake_python_styleguide.visitors.ast.conditions import UselessElseVisitor
# Correct:
correct_example1 = """
def function():
try:
...
except ...:
return None
return None
"... | [UselessReturningElseViolation]) | added | a7ab99f8fbc47d15cd11a0005c2fd8a2e55f3bcb0d751fb34917ce0bf8ed8529 | assert_*|test_else_that_can_be_removed_in_loop|import pytest from wemake_python_styleguide.violations.refactoring import ( UselessReturningElseViolation, ) from wemake_python_styleguide.visitors.ast.conditions import UselessElseVisitor # Correct: correct_example1 = """ def function(): try: ... except ...: return None r... | null | null | null |
wemake-services/wemake-python-styleguide | train | 513 | 1f94c390491374ef88a483de66e88228c3104bac | train | tests/test_visitors/test_ast/test_conditions/test_useless_else/test_useless_try_else.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_conditions/test_useless_else/test_useless_try_else.py | 263 | 4 | assert_* | test_else_that_can_be_removed_in_module | import pytest
from wemake_python_styleguide.violations.refactoring import (
UselessReturningElseViolation,
)
from wemake_python_styleguide.visitors.ast.conditions import UselessElseVisitor
# Correct:
correct_example1 = """
def function():
try:
...
except ...:
return None
return None
"... | [UselessReturningElseViolation]) | added | a193098f24f391dbbe34a74c54ba38d6eb983e08ff187c4e2553f0ba0f7a439f | assert_*|test_else_that_can_be_removed_in_module|import pytest from wemake_python_styleguide.violations.refactoring import ( UselessReturningElseViolation, ) from wemake_python_styleguide.visitors.ast.conditions import UselessElseVisitor # Correct: correct_example1 = """ def function(): try: ... except ...: return None... | null | null | null |
wemake-services/wemake-python-styleguide | train | 514 | b9e73c30bc132614e25b8af916865339caef1eae | train | tests/test_visitors/test_ast/test_keywords/test_keyword_condition.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_keyword_condition.py | 72 | 4 | assert_* | test_false_condition_keywords | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.best_practices import (
WrongKeywordConditionViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import (
ConstantKeywordVisitor,
)
while_template = """
while {0}:
...
"""
assert... | [WrongKeywordConditionViolation]) | added | d022cd32b21fcb10717e6c4f47db38a98f0a4a1839c1e423ecff74e0a2e58ffa | assert_*|test_false_condition_keywords|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.best_practices import ( WrongKeywordConditionViolation, ) from wemake_python_styleguide.visitors.ast.keywords import ( ConstantKeywordVisitor, ) while_template = """ w... | null | null | null |
wemake-services/wemake-python-styleguide | train | 514 | b9e73c30bc132614e25b8af916865339caef1eae | train | tests/test_visitors/test_ast/test_keywords/test_keyword_condition.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_keyword_condition.py | 95 | 4 | assert_* | test_false_assert_condition_keywords | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.best_practices import (
WrongKeywordConditionViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import (
ConstantKeywordVisitor,
)
while_template = """
while {0}:
...
"""
assert... | [WrongKeywordConditionViolation]) | added | c135d51d36e69d5cec22abbed5002227901622bdac9c58b144095ae1ba426cf7 | assert_*|test_false_assert_condition_keywords|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.best_practices import ( WrongKeywordConditionViolation, ) from wemake_python_styleguide.visitors.ast.keywords import ( ConstantKeywordVisitor, ) while_template ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 514 | b9e73c30bc132614e25b8af916865339caef1eae | train | tests/test_visitors/test_ast/test_loops/test_loops/test_infinite_while_loops.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_loops/test_loops/test_infinite_while_loops.py | 226 | 4 | assert_* | test_wrong_while_loops | import pytest
from wemake_python_styleguide.violations.best_practices import (
InfiniteWhileLoopViolation,
)
from wemake_python_styleguide.visitors.ast.loops import WrongLoopVisitor
template_simple = """
while True:
{0}
"""
template_nested_while1 = """
while True:
while other:
{0}
{0}
"""
te... | [InfiniteWhileLoopViolation]) | added | 5c4166a7d5c843290244a937d4f3f74fb8f2304f35eed52b374709f9472c19c9 | assert_*|test_wrong_while_loops|import pytest from wemake_python_styleguide.violations.best_practices import ( InfiniteWhileLoopViolation, ) from wemake_python_styleguide.visitors.ast.loops import WrongLoopVisitor template_simple = """ while True: {0} """ template_nested_while1 = """ while True: while other: {0} {0} ""... | null | null | null |
wemake-services/wemake-python-styleguide | train | 514 | b9e73c30bc132614e25b8af916865339caef1eae | train | tests/test_visitors/test_ast/test_loops/test_loops/test_infinite_while_loops.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_loops/test_loops/test_infinite_while_loops.py | 245 | 4 | assert_* | test_wrong_while_loops_with_try | import pytest
from wemake_python_styleguide.violations.best_practices import (
InfiniteWhileLoopViolation,
)
from wemake_python_styleguide.visitors.ast.loops import WrongLoopVisitor
template_simple = """
while True:
{0}
"""
template_nested_while1 = """
while True:
while other:
{0}
{0}
"""
te... | [InfiniteWhileLoopViolation]) | added | 14ec6ec9e146ee91819497d41afd97fa3f4d14791245ed4d322f8a2b275c50a2 | assert_*|test_wrong_while_loops_with_try|import pytest from wemake_python_styleguide.violations.best_practices import ( InfiniteWhileLoopViolation, ) from wemake_python_styleguide.visitors.ast.loops import WrongLoopVisitor template_simple = """ while True: {0} """ template_nested_while1 = """ while True: while other: {... | null | null | null |
wemake-services/wemake-python-styleguide | train | 514 | b9e73c30bc132614e25b8af916865339caef1eae | train | tests/test_visitors/test_ast/test_loops/test_loops/test_infinite_while_loops.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_loops/test_loops/test_infinite_while_loops.py | 292 | 4 | assert_* | test_double_while_wrong_loops | import pytest
from wemake_python_styleguide.violations.best_practices import (
InfiniteWhileLoopViolation,
)
from wemake_python_styleguide.visitors.ast.loops import WrongLoopVisitor
template_simple = """
while True:
{0}
"""
template_nested_while1 = """
while True:
while other:
{0}
{0}
"""
te... | [InfiniteWhileLoopViolation]) | added | cae9bdedbaeaeb1f2ea8f33fec6938b34686fbcd9fd9fd7b3f274a2021cf5efc | assert_*|test_double_while_wrong_loops|import pytest from wemake_python_styleguide.violations.best_practices import ( InfiniteWhileLoopViolation, ) from wemake_python_styleguide.visitors.ast.loops import WrongLoopVisitor template_simple = """ while True: {0} """ template_nested_while1 = """ while True: while other: {0}... | null | null | null |
wemake-services/wemake-python-styleguide | train | 516 | e73b49305c169dfd830439118cbd79cb94bc5992 | train | tests/test_visitors/test_ast/test_compares/test_multiple_in.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_multiple_in.py | 78 | 4 | assert_* | test_compare_with_multiple_in | import pytest
from wemake_python_styleguide.violations.consistency import (
MultipleInCompareViolation,
)
from wemake_python_styleguide.violations.refactoring import (
InCompareWithSingleItemContainerViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
InCompareSanityVisitor,
)
if_wit... | [MultipleInCompareViolation]) | modified | f5681e35131149e0ba015e3a6563fb359875e68aae2ac5f0e48405532b2981d1 | assert_*|test_compare_with_multiple_in|import pytest from wemake_python_styleguide.violations.consistency import ( MultipleInCompareViolation, ) from wemake_python_styleguide.violations.refactoring import ( InCompareWithSingleItemContainerViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( InCompa... | [MultipleInCompareViolation]) | 78 | 4 |
wemake-services/wemake-python-styleguide | train | 516 | e73b49305c169dfd830439118cbd79cb94bc5992 | train | tests/test_visitors/test_ast/test_compares/test_multiple_in.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_multiple_in.py | 96 | 4 | assert_* | test_compare_with_mixed_in | import pytest
from wemake_python_styleguide.violations.consistency import (
MultipleInCompareViolation,
)
from wemake_python_styleguide.violations.refactoring import (
InCompareWithSingleItemContainerViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
InCompareSanityVisitor,
)
if_wit... | [MultipleInCompareViolation]) | modified | 0df59bc50562a568c178696eee01da4160475b502c2508d8c70c5b086eb5abcb | assert_*|test_compare_with_mixed_in|import pytest from wemake_python_styleguide.violations.consistency import ( MultipleInCompareViolation, ) from wemake_python_styleguide.violations.refactoring import ( InCompareWithSingleItemContainerViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( InCompareS... | [MultipleInCompareViolation]) | 96 | 4 |
wemake-services/wemake-python-styleguide | train | 516 | e73b49305c169dfd830439118cbd79cb94bc5992 | train | tests/test_visitors/test_ast/test_complexity/test_function/test_cognitive/test_cognitive_average.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_cognitive/test_cognitive_average.py | 73 | 4 | assert_* | test_complex_cognitive_module | import pytest
from wemake_python_styleguide.violations.complexity import (
CognitiveComplexityViolation,
CognitiveModuleComplexityViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.function import (
CognitiveComplexityVisitor,
)
# Templates:
single_item = '{0}'
multiple_items = """
def ot... | [CognitiveModuleComplexityViolation]) | added | f20ceaf32d0b8648c56f1b0d728607426073fff39a15ff3cd014a8d5b02e52d6 | assert_*|test_complex_cognitive_module|import pytest from wemake_python_styleguide.violations.complexity import ( CognitiveComplexityViolation, CognitiveModuleComplexityViolation, ) from wemake_python_styleguide.visitors.ast.complexity.function import ( CognitiveComplexityVisitor, ) # Templates: single_item = '{0}' mul... | null | null | null |
wemake-services/wemake-python-styleguide | train | 516 | e73b49305c169dfd830439118cbd79cb94bc5992 | train | tests/test_visitors/test_ast/test_complexity/test_function/test_cognitive/test_cognitive_average.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_cognitive/test_cognitive_average.py | 104 | 4 | assert_* | test_complex_cognitive_options | import pytest
from wemake_python_styleguide.violations.complexity import (
CognitiveComplexityViolation,
CognitiveModuleComplexityViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.function import (
CognitiveComplexityVisitor,
)
# Templates:
single_item = '{0}'
multiple_items = """
def ot... | option_values.max_cognitive_average) | added | cf1af3f92c0c915d699a0ea0ccd1cd59c0902fc84f7a2c98235d3c564fd2bbad | assert_*|test_complex_cognitive_options|import pytest from wemake_python_styleguide.violations.complexity import ( CognitiveComplexityViolation, CognitiveModuleComplexityViolation, ) from wemake_python_styleguide.visitors.ast.complexity.function import ( CognitiveComplexityVisitor, ) # Templates: single_item = '{0}' mu... | null | null | null |
wemake-services/wemake-python-styleguide | train | 516 | e73b49305c169dfd830439118cbd79cb94bc5992 | train | tests/test_visitors/test_ast/test_complexity/test_function/test_cognitive/test_cognitive_score.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_cognitive/test_cognitive_score.py | 64 | 4 | assert_* | test_complex_cognitive_function | import pytest
from wemake_python_styleguide.violations.complexity import (
CognitiveComplexityViolation,
CognitiveModuleComplexityViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.function import (
CognitiveComplexityVisitor,
)
# Complex sample:
complex_function = """
def literal_eval(no... | [CognitiveComplexityViolation]) | modified | 8a3c5b2c3e96c5dc84b64e4df664d8cd89dc3240a3b3fd194a18c38b257c955c | assert_*|test_complex_cognitive_function|import pytest from wemake_python_styleguide.violations.complexity import ( CognitiveComplexityViolation, CognitiveModuleComplexityViolation, ) from wemake_python_styleguide.visitors.ast.complexity.function import ( CognitiveComplexityVisitor, ) # Complex sample: complex_function... | [CognitiveComplexityViolation]) | 62 | 4 |
wemake-services/wemake-python-styleguide | train | 516 | e73b49305c169dfd830439118cbd79cb94bc5992 | train | tests/test_visitors/test_ast/test_complexity/test_function/test_cognitive/test_cognitive_score.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_cognitive/test_cognitive_score.py | 96 | 4 | assert_* | test_complex_cognitive_options | import pytest
from wemake_python_styleguide.violations.complexity import (
CognitiveComplexityViolation,
CognitiveModuleComplexityViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.function import (
CognitiveComplexityVisitor,
)
# Complex sample:
complex_function = """
def literal_eval(no... | [CognitiveComplexityViolation]) | modified | e97971a240ee9403cd2def3e23ad1bf770fd9f57d45ab2f9962e9bf4992d87fc | assert_*|test_complex_cognitive_options|import pytest from wemake_python_styleguide.violations.complexity import ( CognitiveComplexityViolation, CognitiveModuleComplexityViolation, ) from wemake_python_styleguide.visitors.ast.complexity.function import ( CognitiveComplexityVisitor, ) # Complex sample: complex_function ... | option_values.max_cognitive_score) | 96 | 4 |
wemake-services/wemake-python-styleguide | train | 516 | e73b49305c169dfd830439118cbd79cb94bc5992 | train | tests/test_visitors/test_tokenize/test_primitives/test_string_tokens/test_string_modifier.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_primitives/test_string_tokens/test_string_modifier.py | 82 | 4 | assert_* | test_uppercase_prefix | import pytest
from wemake_python_styleguide.violations.consistency import (
RawStringNotNeededViolation,
UppercaseStringModifierViolation,
)
from wemake_python_styleguide.visitors.tokenize.primitives import (
WrongStringTokenVisitor,
)
@pytest.mark.parametrize('modifier', [
'r',
'rb',
'fr',
... | modifier) | modified | fd5591b8aec3ee600164c722c2d528c3f79ea7e60db656b0d09fc2309f0775e4 | assert_*|test_uppercase_prefix|import pytest from wemake_python_styleguide.violations.consistency import ( RawStringNotNeededViolation, UppercaseStringModifierViolation, ) from wemake_python_styleguide.visitors.tokenize.primitives import ( WrongStringTokenVisitor, ) @pytest.mark.parametrize('modifier', [ 'r', 'rb', 'fr... | modifier) | 82 | 4 |
wemake-services/wemake-python-styleguide | train | 516 | e73b49305c169dfd830439118cbd79cb94bc5992 | train | tests/test_visitors/test_tokenize/test_primitives/test_string_tokens/test_string_modifier.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_primitives/test_string_tokens/test_string_modifier.py | 113 | 4 | assert_* | test_uppercase_prefix_multiple | import pytest
from wemake_python_styleguide.violations.consistency import (
RawStringNotNeededViolation,
UppercaseStringModifierViolation,
)
from wemake_python_styleguide.visitors.tokenize.primitives import (
WrongStringTokenVisitor,
)
@pytest.mark.parametrize('modifier', [
'r',
'rb',
'fr',
... | [ UppercaseStringModifierViolation, UppercaseStringModifierViolation, RawStringNotNeededViolation, ]) | modified | c9a31f4c012e4a8869fdd1a84ca44ea3349c35646b89694ffa694f9199fc31a0 | assert_*|test_uppercase_prefix_multiple|import pytest from wemake_python_styleguide.violations.consistency import ( RawStringNotNeededViolation, UppercaseStringModifierViolation, ) from wemake_python_styleguide.visitors.tokenize.primitives import ( WrongStringTokenVisitor, ) @pytest.mark.parametrize('modifier', [ 'r', ... | [ UppercaseStringModifierViolation, UppercaseStringModifierViolation, RawStringNotNeededViolation, ]) | 113 | 4 |
wemake-services/wemake-python-styleguide | train | 517 | a605c95bd84367cd8643c5163361c286de51bb96 | train | tests/test_visitors/test_ast/test_compares/test_conditionals.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_compares/test_conditionals.py | 139 | 4 | assert_* | test_constant_condition | import pytest
from wemake_python_styleguide.compat.constants import PY38
from wemake_python_styleguide.violations.consistency import (
ConstantConditionViolation,
)
from wemake_python_styleguide.visitors.ast.compares import (
WrongConditionalVisitor,
)
create_variable = """
variable = 1
{0}
"""
if_statement ... | [ConstantConditionViolation]) | added | 9f69b3c00f029d519b23c6a0d243334c0a10db78ed699296fd867d3f219fc6d9 | assert_*|test_constant_condition|import pytest from wemake_python_styleguide.compat.constants import PY38 from wemake_python_styleguide.violations.consistency import ( ConstantConditionViolation, ) from wemake_python_styleguide.visitors.ast.compares import ( WrongConditionalVisitor, ) create_variable = """ variable = 1... | null | null | null |
wemake-services/wemake-python-styleguide | train | 518 | b554dd40217c0c5ce76ec4663be3c1e7894c4504 | train | tests/test_visitors/test_ast/test_complexity/test_classes/test_method_counts.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_classes/test_method_counts.py | 157 | 4 | assert_* | test_method_counts_violation | import pytest
from wemake_python_styleguide.visitors.ast.complexity.classes import (
MethodMembersVisitor,
TooManyMethodsViolation,
)
module_without_methods = """
def first(): ...
def second(): ...
"""
module_with_async_functions = """
async def first(): ...
async def second(): ...
"""
module_async_and_us... | [TooManyMethodsViolation]) | added | 817c3cd660d5f7764ccc1517c81568d12719ad8794b29f6267d22c3a8c278e59 | assert_*|test_method_counts_violation|import pytest from wemake_python_styleguide.visitors.ast.complexity.classes import ( MethodMembersVisitor, TooManyMethodsViolation, ) module_without_methods = """ def first(): ... def second(): ... """ module_with_async_functions = """ async def first(): ... async def second(): ...... | null | null | null |
wemake-services/wemake-python-styleguide | train | 518 | b554dd40217c0c5ce76ec4663be3c1e7894c4504 | train | tests/test_visitors/test_ast/test_complexity/test_classes/test_method_counts.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_classes/test_method_counts.py | 158 | 4 | assert_* | test_method_counts_violation | import pytest
from wemake_python_styleguide.visitors.ast.complexity.classes import (
MethodMembersVisitor,
TooManyMethodsViolation,
)
module_without_methods = """
def first(): ...
def second(): ...
"""
module_with_async_functions = """
async def first(): ...
async def second(): ...
"""
module_async_and_us... | option_values.max_methods) | added | 867c7dbf4fad3f7596b422ccfe6c6b83e7ffb3b205dc48e922100fd264f6b840 | assert_*|test_method_counts_violation|import pytest from wemake_python_styleguide.visitors.ast.complexity.classes import ( MethodMembersVisitor, TooManyMethodsViolation, ) module_without_methods = """ def first(): ... def second(): ... """ module_with_async_functions = """ async def first(): ... async def second(): ...... | null | null | null |
wemake-services/wemake-python-styleguide | train | 518 | b554dd40217c0c5ce76ec4663be3c1e7894c4504 | train | tests/test_visitors/test_ast/test_complexity/test_counts/test_module_counts.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_counts/test_module_counts.py | 173 | 4 | assert_* | test_module_counts_violation | import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyModuleMembersViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.counts import (
ModuleMembersVisitor,
)
# Multiple module members:
module_with_function_and_class = """
def first(): ...
class Second(object): ...... | [TooManyModuleMembersViolation]) | added | a5e3e2aad076de29b7c31dfdbdad223954343c1558ec301d48dec6cb2b338458 | assert_*|test_module_counts_violation|import pytest from wemake_python_styleguide.violations.complexity import ( TooManyModuleMembersViolation, ) from wemake_python_styleguide.visitors.ast.complexity.counts import ( ModuleMembersVisitor, ) # Multiple module members: module_with_function_and_class = """ def first(): ...... | null | null | null |
wemake-services/wemake-python-styleguide | train | 518 | b554dd40217c0c5ce76ec4663be3c1e7894c4504 | train | tests/test_visitors/test_ast/test_complexity/test_counts/test_module_counts.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_counts/test_module_counts.py | 174 | 4 | assert_* | test_module_counts_violation | import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyModuleMembersViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.counts import (
ModuleMembersVisitor,
)
# Multiple module members:
module_with_function_and_class = """
def first(): ...
class Second(object): ...... | option_values.max_module_members) | added | a21363c1f6375527f87e317001d308a3e69d5122c934daa63b5d66c9e172fb4c | assert_*|test_module_counts_violation|import pytest from wemake_python_styleguide.violations.complexity import ( TooManyModuleMembersViolation, ) from wemake_python_styleguide.visitors.ast.complexity.counts import ( ModuleMembersVisitor, ) # Multiple module members: module_with_function_and_class = """ def first(): ...... | null | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.