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 | 48 | b5e891713c582a140d9301e8284611a21c7ddd65 | train | tests/test_visitors/test_ast/test_general/test_wrong_class/test_staticmethod.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_wrong_class/test_staticmethod.py | 39 | 4 | assert_* | test_staticmethod_used | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
StaticMethodViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
decorated_method = """
class Example(object):
@{0}
def should_fail(): ...
"""
async_decorated_method... | [StaticMethodViolation]) | added | 3d20069457d5d9578a74836bc325fd7cfce880ca9c6d30629a62fb9d3f716701 | assert_*|test_staticmethod_used|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( StaticMethodViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor decorated_method = """ class Example(object): @{0} def should_fail(): ... """ async_... | null | null | null |
wemake-services/wemake-python-styleguide | train | 49 | 7ae09177e965710e42a58b9bcdeb82d78052ef54 | train | tests/test_visitors/test_ast/test_general/test_magic_numbers.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_magic_numbers.py | 169 | 4 | assert_* | test_magic_number_warning | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
MagicNumberViolation,
)
from wemake_python_styleguide.visitors.ast.numbers import (
MAGIC_NUMBERS_WHITELIST,
MagicNumberVisitor,
)
# Correct usages:
assignment = 'constant = {0}'
assignment_unary = 'co... | [MagicNumberViolation]) | added | eb705519a003937916914498e3034f408d38a184bedb647a515b8c4ead805c15 | assert_*|test_magic_number_warning|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( MagicNumberViolation, ) from wemake_python_styleguide.visitors.ast.numbers import ( MAGIC_NUMBERS_WHITELIST, MagicNumberVisitor, ) # Correct usages: assignment = 'constant = {0}' ass... | null | null | null |
wemake-services/wemake-python-styleguide | train | 50 | 13368e7770a6d5d1c055b4ef04df55923cd3add7 | train | tests/test_visitors/test_ast/test_general/test_wrong_class/test_base_class.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_wrong_class/test_base_class.py | 51 | 4 | assert_* | test_wrong_base_class | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
RequiredBaseClassViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
class_without_base = 'class WithoutBase: ...'
class_with_empty_base = 'class EmptyBase(): ...'
nested_clas... | [RequiredBaseClassViolation]) | added | a661eaf4ed5bf8b1ecc8a27482e97c8720735b03a9efcc5668cf8b593ae9ebc7 | assert_*|test_wrong_base_class|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( RequiredBaseClassViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor class_without_base = 'class WithoutBase: ...' class_with_empty_base = 'class EmptyB... | null | null | null |
wemake-services/wemake-python-styleguide | train | 51 | b0016b411196f08a5e937e60086b188fe06ed960 | train | tests/test_visitors/test_ast/test_general/test_wrong_class/test_magic_methods.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_wrong_class/test_magic_methods.py | 40 | 4 | assert_* | test_wrong_magic_used | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.constants import MAGIC_METHODS_BLACKLIST
from wemake_python_styleguide.violations.best_practices import (
BadMagicMethodViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
magic_method = """
class Example(obj... | [BadMagicMethodViolation]) | modified | 8cf43148a043040bc01e470b453f2570a070b7cabaf7b742030571db709431b1 | assert_*|test_wrong_magic_used|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.constants import MAGIC_METHODS_BLACKLIST from wemake_python_styleguide.violations.best_practices import ( BadMagicMethodViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor magic_method... | [BadMagicMethodViolation]) | 40 | 4 |
wemake-services/wemake-python-styleguide | train | 51 | b0016b411196f08a5e937e60086b188fe06ed960 | train | tests/test_visitors/test_ast/test_general/test_wrong_function_call/test_wrong_function_calls.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_wrong_function_call/test_wrong_function_calls.py | 49 | 4 | assert_* | test_wrong_decorator_used | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
WrongFunctionCallViolation,
)
from wemake_python_styleguide.visitors.ast.functions import (
FUNCTIONS_BLACKLIST,
WrongFunctionCallVisitor,
)
regular_call = '{0}(*args, **kwargs)'
assignment_call = 'test... | [WrongFunctionCallViolation]) | modified | 1366f7b67d81a05fba9ea7e89638f2cec6a1af1286526e98fc67930d135e7f2f | assert_*|test_wrong_decorator_used|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( WrongFunctionCallViolation, ) from wemake_python_styleguide.visitors.ast.functions import ( FUNCTIONS_BLACKLIST, WrongFunctionCallVisitor, ) regular_call = '{0}(*args, **kwargs)' ass... | [WrongFunctionCallViolation]) | 49 | 4 |
wemake-services/wemake-python-styleguide | train | 51 | b0016b411196f08a5e937e60086b188fe06ed960 | train | tests/test_visitors/test_ast/test_general/test_wrong_name/test_class_attributes.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_wrong_name/test_class_attributes.py | 43 | 4 | assert_* | test_wrong_attributes_names | # -*- coding: utf-8 -*-
import string
import pytest
from wemake_python_styleguide.violations.naming import (
PrivateNameViolation,
TooShortVariableNameViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
VARIABLE_NAMES_BLACKLIST,
WrongNameVisitor,
)
... | [WrongVariableNameViolation]) | modified | 4d20a146973b7f56eb633bb8a341f3f5618e9e3825ab1fe9864a38f96171b7fd | assert_*|test_wrong_attributes_names|# -*- coding: utf-8 -*- import string import pytest from wemake_python_styleguide.violations.naming import ( PrivateNameViolation, TooShortVariableNameViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( VARIABLE_NAMES_BLACKLIST, WrongN... | [WrongVariableNameViolation]) | 43 | 4 |
wemake-services/wemake-python-styleguide | train | 51 | b0016b411196f08a5e937e60086b188fe06ed960 | train | tests/test_visitors/test_ast/test_general/test_wrong_name/test_function_args_names.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_wrong_name/test_function_args_names.py | 123 | 4 | assert_* | test_private_function_arguments | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
PrivateNameViolation,
TooShortVariableNameViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
VARIABLE_NAMES_BLACKLIST,
WrongNameVisitor,
)
function_test ... | [ PrivateNameViolation, PrivateNameViolation, ]) | modified | f2d9b43f6e6ac2827c75403b4771c9a0296c28790eabdfd4fae3a035fb22e929 | assert_*|test_private_function_arguments|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( PrivateNameViolation, TooShortVariableNameViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( VARIABLE_NAMES_BLACKLIST, WrongNameVisitor... | [ PrivateNameViolation, PrivateNameViolation, ]) | 123 | 4 |
wemake-services/wemake-python-styleguide | train | 51 | b0016b411196f08a5e937e60086b188fe06ed960 | train | tests/test_visitors/test_ast/test_general/test_wrong_name/test_function_names.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_wrong_name/test_function_names.py | 81 | 4 | assert_* | test_private_function_names | # -*- coding: utf-8 -*-
import string
import pytest
from wemake_python_styleguide.violations.naming import (
PrivateNameViolation,
TooShortVariableNameViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
VARIABLE_NAMES_BLACKLIST,
WrongNameVisitor,
)
... | [PrivateNameViolation]) | modified | 9d38a00fc91fb900b34322616fd8184eb7d0b04db187db94c164e1911d982d3b | assert_*|test_private_function_names|# -*- coding: utf-8 -*- import string import pytest from wemake_python_styleguide.violations.naming import ( PrivateNameViolation, TooShortVariableNameViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( VARIABLE_NAMES_BLACKLIST, WrongN... | [PrivateNameViolation]) | 81 | 4 |
wemake-services/wemake-python-styleguide | train | 51 | b0016b411196f08a5e937e60086b188fe06ed960 | train | tests/test_visitors/test_ast/test_general/test_wrong_name/test_import_alias.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_wrong_name/test_import_alias.py | 57 | 4 | assert_* | test_too_short_import_alias_names | # -*- coding: utf-8 -*-
import string
import pytest
from wemake_python_styleguide.violations.naming import (
PrivateNameViolation,
TooShortVariableNameViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
VARIABLE_NAMES_BLACKLIST,
WrongNameVisitor,
)
... | [TooShortVariableNameViolation]) | modified | eb428dcbe87424b7bb4bc22e15de1d1d6d8d2dbb0f4c4a5a43baf6e7f11572bf | assert_*|test_too_short_import_alias_names|# -*- coding: utf-8 -*- import string import pytest from wemake_python_styleguide.violations.naming import ( PrivateNameViolation, TooShortVariableNameViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( VARIABLE_NAMES_BLACKLIST, ... | [TooShortVariableNameViolation]) | 57 | 4 |
wemake-services/wemake-python-styleguide | train | 51 | b0016b411196f08a5e937e60086b188fe06ed960 | train | tests/test_visitors/test_ast/test_general/test_wrong_name/test_module_metadata.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_wrong_name/test_module_metadata.py | 41 | 4 | assert_* | test_wrong_metadata | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
WrongModuleMetadataViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
MODULE_METADATA_VARIABLES_BLACKLIST,
WrongModuleMetadataVisitor,
)
module_metadata = """
{0} = 'Nikita'
"""
ne... | [WrongModuleMetadataViolation]) | modified | f0d94a1ed193f585877e75c6a7695e2c29f7b91ae47441cdaa348ec323d05063 | assert_*|test_wrong_metadata|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( WrongModuleMetadataViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( MODULE_METADATA_VARIABLES_BLACKLIST, WrongModuleMetadataVisitor, ) module_metadata = """ {0} = 'N... | [WrongModuleMetadataViolation]) | 41 | 4 |
wemake-services/wemake-python-styleguide | train | 51 | b0016b411196f08a5e937e60086b188fe06ed960 | train | tests/test_visitors/test_ast/test_general/test_wrong_name/test_variable_names.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_wrong_name/test_variable_names.py | 141 | 4 | assert_* | test_private_variable_names | # -*- coding: utf-8 -*-
import string
import pytest
from wemake_python_styleguide.violations.naming import (
PrivateNameViolation,
TooShortVariableNameViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
VARIABLE_NAMES_BLACKLIST,
WrongNameVisitor,
)
... | [PrivateNameViolation]) | modified | 824687aee19ce9769a3e8791cf6bccb164e6e3f91016e4b98de7edcc29501c48 | assert_*|test_private_variable_names|# -*- coding: utf-8 -*- import string import pytest from wemake_python_styleguide.violations.naming import ( PrivateNameViolation, TooShortVariableNameViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( VARIABLE_NAMES_BLACKLIST, WrongN... | [PrivateNameViolation]) | 141 | 4 |
wemake-services/wemake-python-styleguide | train | 52 | 927b67c174dc246f112aa2462958fb422037a648 | train | tests/test_visitors/test_ast/test_general/test_bad_comparison.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_bad_comparison.py | 51 | 4 | assert_* | test_wrong_string | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ConstantComparisonViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
ConstantComparisonVisitor,
)
@pytest.mark.parametrize('code', [
'foo < bar',
'0 < x < 1',
'("foo" + "... | [ConstantComparisonViolation]) | added | 4fd1fce4b06f505fbe9618424663feced5dbfcb19277c68432923ae23f4d0ab4 | assert_*|test_wrong_string|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ConstantComparisonViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( ConstantComparisonVisitor, ) @pytest.mark.parametrize('code', [ 'foo < bar', '0 < x < 1', '("foo" ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 53 | 56f9e7455a25c3a059ed3f8409cf10b08b3bc084 | train | tests/test_visitors/test_tokenize/test_wrong_primitives/test_number_suffixes.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_wrong_primitives/test_number_suffixes.py | 31 | 4 | assert_* | test_bad_number_suffixes | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
BadNumberSuffixViolation,
)
from wemake_python_styleguide.visitors.tokenize.primitives import (
WrongPrimitivesVisitor,
)
@pytest.mark.parametrize('code', [
'x = 0XFF',
'print(1.5E+10)',
'0O11 + 5... | [BadNumberSuffixViolation]) | added | 2c3ec032eaa0c43981a99a02524e38d4e3e21abed922bc43e4ad8e00b4546ed2 | assert_*|test_bad_number_suffixes|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( BadNumberSuffixViolation, ) from wemake_python_styleguide.visitors.tokenize.primitives import ( WrongPrimitivesVisitor, ) @pytest.mark.parametrize('code', [ 'x = 0XFF', 'print(1.5E+10)',... | null | null | null |
wemake-services/wemake-python-styleguide | train | 54 | e59d7a37fa26f6eba41495bd29ec7dead0b423b9 | train | tests/test_visitors/test_tokenize/test_wrong_primitives/test_number_suffixes.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_wrong_primitives/test_number_suffixes.py | 31 | 4 | assert_* | test_bad_number_suffixes | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
BadNumberSuffixViolation,
)
from wemake_python_styleguide.visitors.tokenize.primitives import (
WrongPrimitivesVisitor,
)
@pytest.mark.parametrize('code', [
'x = 0XFF',
'print(1.5E+10)',
'0O11 + 5... | [BadNumberSuffixViolation]) | modified | 847c554e3b58cfaf7ff88862200ddfae0dac00d95b5460fc27e803466cbc1145 | assert_*|test_bad_number_suffixes|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( BadNumberSuffixViolation, ) from wemake_python_styleguide.visitors.tokenize.primitives import ( WrongPrimitivesVisitor, ) @pytest.mark.parametrize('code', [ 'x = 0XFF', 'print(1.5E+10)',... | [BadNumberSuffixViolation]) | 31 | 4 |
wemake-services/wemake-python-styleguide | train | 55 | 9a2729ecdbadc97baabecaa331e6ec56b18e684e | train | tests/test_visitors/test_ast/test_general/test_comparison_order.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_comparison_order.py | 162 | 4 | assert_* | test_wrong_comparison | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ComparisonOrderViolation,
)
from wemake_python_styleguide.visitors.ast.order import WrongOrderVisitor
# Templates to be checked
if_with_is = """
if {0} is {1}:
return 1
"""
if_with_is_not = """
if {0} is not... | [ComparisonOrderViolation]) | added | 86610f99610c8aa449cedb01d7ebb14a018eef034150c9ff6e716d8f3ac8d48e | assert_*|test_wrong_comparison|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ComparisonOrderViolation, ) from wemake_python_styleguide.visitors.ast.order import WrongOrderVisitor # Templates to be checked if_with_is = """ if {0} is {1}: return 1 """ if_with_is_not =... | null | null | null |
wemake-services/wemake-python-styleguide | train | 55 | 9a2729ecdbadc97baabecaa331e6ec56b18e684e | train | tests/test_visitors/test_ast/test_general/test_comparison_order.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_comparison_order.py | 184 | 4 | assert_* | test_wrong_compound_comparison | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ComparisonOrderViolation,
)
from wemake_python_styleguide.visitors.ast.order import WrongOrderVisitor
# Templates to be checked
if_with_is = """
if {0} is {1}:
return 1
"""
if_with_is_not = """
if {0} is not... | [ComparisonOrderViolation, ComparisonOrderViolation]) | added | b5b9d1a09e3e390406fb9607f1e2ced43d84c0b85e9cf453cc06bfe5e3da5b53 | assert_*|test_wrong_compound_comparison|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ComparisonOrderViolation, ) from wemake_python_styleguide.visitors.ast.order import WrongOrderVisitor # Templates to be checked if_with_is = """ if {0} is {1}: return 1 """ if_with... | null | null | null |
wemake-services/wemake-python-styleguide | train | 55 | 9a2729ecdbadc97baabecaa331e6ec56b18e684e | train | tests/test_visitors/test_ast/test_general/test_comparison_order.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_comparison_order.py | 228 | 4 | assert_* | test_inconsistent_chained_comparison | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ComparisonOrderViolation,
)
from wemake_python_styleguide.visitors.ast.order import WrongOrderVisitor
# Templates to be checked
if_with_is = """
if {0} is {1}:
return 1
"""
if_with_is_not = """
if {0} is not... | [ComparisonOrderViolation]) | added | 735d43e118e272b84d6620cd49557290b2ae415f02ab62d22bd642a4e828c032 | assert_*|test_inconsistent_chained_comparison|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ComparisonOrderViolation, ) from wemake_python_styleguide.visitors.ast.order import WrongOrderVisitor # Templates to be checked if_with_is = """ if {0} is {1}: return 1 """ i... | null | null | null |
wemake-services/wemake-python-styleguide | train | 56 | 3f515c7b35f355533ae35fd0fbdf7d3c268e1f8e | train | tests/test_visitors/test_ast/test_general/test_wrong_name/test_variable_names.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_wrong_name/test_variable_names.py | 80 | 4 | assert_* | test_wrong_variable_names | # -*- coding: utf-8 -*-
import string
import pytest
from wemake_python_styleguide.violations.naming import (
PrivateNameViolation,
TooShortVariableNameViolation,
UnderScoredNumberNameViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
VARIABLE_NAMES... | [WrongVariableNameViolation]) | modified | 89d8ed82a1564642a01bbed43c8345c30b3f5c79493605b1f4697010f387b6b3 | assert_*|test_wrong_variable_names|# -*- coding: utf-8 -*- import string import pytest from wemake_python_styleguide.violations.naming import ( PrivateNameViolation, TooShortVariableNameViolation, UnderScoredNumberNameViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( VA... | [WrongVariableNameViolation]) | 79 | 4 |
wemake-services/wemake-python-styleguide | train | 56 | 3f515c7b35f355533ae35fd0fbdf7d3c268e1f8e | train | tests/test_visitors/test_ast/test_general/test_wrong_name/test_variable_names.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_wrong_name/test_variable_names.py | 122 | 4 | assert_* | test_too_short_variable_names_configured | # -*- coding: utf-8 -*-
import string
import pytest
from wemake_python_styleguide.violations.naming import (
PrivateNameViolation,
TooShortVariableNameViolation,
UnderScoredNumberNameViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
VARIABLE_NAMES... | [TooShortVariableNameViolation]) | modified | 5bed18ed4eec0fa746a680bfa54a11ec845ee71baaf402cbc773303ac728ffe2 | assert_*|test_too_short_variable_names_configured|# -*- coding: utf-8 -*- import string import pytest from wemake_python_styleguide.violations.naming import ( PrivateNameViolation, TooShortVariableNameViolation, UnderScoredNumberNameViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.nam... | [TooShortVariableNameViolation]) | 121 | 4 |
wemake-services/wemake-python-styleguide | train | 56 | 3f515c7b35f355533ae35fd0fbdf7d3c268e1f8e | train | tests/test_visitors/test_ast/test_general/test_wrong_name/test_variable_names.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_wrong_name/test_variable_names.py | 142 | 4 | assert_* | test_private_variable_names | # -*- coding: utf-8 -*-
import string
import pytest
from wemake_python_styleguide.violations.naming import (
PrivateNameViolation,
TooShortVariableNameViolation,
UnderScoredNumberNameViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
VARIABLE_NAMES... | [PrivateNameViolation]) | modified | 780334d70461c768d3237d312231cf79f99d99af8d11a87fd7969af9a47be472 | assert_*|test_private_variable_names|# -*- coding: utf-8 -*- import string import pytest from wemake_python_styleguide.violations.naming import ( PrivateNameViolation, TooShortVariableNameViolation, UnderScoredNumberNameViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( ... | [PrivateNameViolation]) | 141 | 4 |
wemake-services/wemake-python-styleguide | train | 56 | 3f515c7b35f355533ae35fd0fbdf7d3c268e1f8e | train | tests/test_visitors/test_ast/test_general/test_wrong_name/test_variable_names.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_general/test_wrong_name/test_variable_names.py | 185 | 4 | assert_* | test_underscored_number_in_variable_names | # -*- coding: utf-8 -*-
import string
import pytest
from wemake_python_styleguide.violations.naming import (
PrivateNameViolation,
TooShortVariableNameViolation,
UnderScoredNumberNameViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
VARIABLE_NAMES... | [UnderScoredNumberNameViolation]) | added | a9d0500da8441175fa3c6d454abf793f9b1f1a9dd83504fdcc1e30f6c0510caa | assert_*|test_underscored_number_in_variable_names|# -*- coding: utf-8 -*- import string import pytest from wemake_python_styleguide.violations.naming import ( PrivateNameViolation, TooShortVariableNameViolation, UnderScoredNumberNameViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.na... | null | null | null |
wemake-services/wemake-python-styleguide | train | 56 | 3f515c7b35f355533ae35fd0fbdf7d3c268e1f8e | train | tests/test_visitors/test_filenames/test_wrong_module_name/test_module_magic_name.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_wrong_module_name/test_module_magic_name.py | 34 | 4 | assert_* | test_simple_filename | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.constants import MAGIC_MODULE_NAMES_WHITELIST
from wemake_python_styleguide.violations.naming import (
UnderScoredNumberNameViolation,
WrongModuleMagicNameViolation,
)
from wemake_python_styleguide.visitors.filenames.wrong_module_name import ... | [WrongModuleMagicNameViolation]) | modified | 3724f5f93f82c97ffbb8279410598c628749752d06ea4d4ca917b190bf66c970 | assert_*|test_simple_filename|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.constants import MAGIC_MODULE_NAMES_WHITELIST from wemake_python_styleguide.violations.naming import ( UnderScoredNumberNameViolation, WrongModuleMagicNameViolation, ) from wemake_python_styleguide.visitors.filenames.wrong... | [WrongModuleMagicNameViolation]) | 33 | 4 |
wemake-services/wemake-python-styleguide | train | 56 | 3f515c7b35f355533ae35fd0fbdf7d3c268e1f8e | train | tests/test_visitors/test_filenames/test_wrong_module_name/test_module_magic_name.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_wrong_module_name/test_module_magic_name.py | 47 | 4 | assert_* | test_filename_with_underscored_number | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.constants import MAGIC_MODULE_NAMES_WHITELIST
from wemake_python_styleguide.violations.naming import (
UnderScoredNumberNameViolation,
WrongModuleMagicNameViolation,
)
from wemake_python_styleguide.visitors.filenames.wrong_module_name import ... | [UnderScoredNumberNameViolation]) | added | d24dab54c98db3d9b55b96c3a2d49dcc65cfacac1309e6acafdcbfd884839835 | assert_*|test_filename_with_underscored_number|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.constants import MAGIC_MODULE_NAMES_WHITELIST from wemake_python_styleguide.violations.naming import ( UnderScoredNumberNameViolation, WrongModuleMagicNameViolation, ) from wemake_python_styleguide.visitor... | null | null | null |
wemake-services/wemake-python-styleguide | train | 57 | c3a04a1f3d7123ecef41ba6d1991a7a722ef92c8 | train | tests/test_violations.py | train | wemake-services/wemake-python-styleguide:tests/test_violations.py | 52 | 8 | assert | test_all_violations_have_description_with_code | # -*- coding: utf-8 -*-
import ast
from wemake_python_styleguide.violations.base import ASTViolation, BaseViolation
def test_visitor_returns_location():
"""Ensures that `BaseNodeVisitor` return correct violation message."""
visitor = ASTViolation(node=ast.parse(''), text='violation')
visitor.error_templ... | violation.__doc__ | modified | c18296a06271097c3754caf5c2127a4e68775ccd5d175d99a1fe78d094fb5d60 | assert|test_all_violations_have_description_with_code|# -*- coding: utf-8 -*- import ast from wemake_python_styleguide.violations.base import ASTViolation, BaseViolation def test_visitor_returns_location(): """Ensures that `BaseNodeVisitor` return correct violation message.""" visitor = ASTViolation(node=ast.parse(''),... | violation.__doc__ | 55 | 8 |
wemake-services/wemake-python-styleguide | train | 57 | c3a04a1f3d7123ecef41ba6d1991a7a722ef92c8 | train | tests/test_visitors/conftest.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/conftest.py | 20 | 8 | assert | # -*- coding: utf-8 -*-
from collections import namedtuple
from typing import Sequence
import pytest
from wemake_python_styleguide.options.config import Configuration
from wemake_python_styleguide.visitors.base import BaseVisitor
def _to_dest_option(long_option_name: str) -> str:
return long_option_name[2:].re... | len(visitor.violations) | added | 828977c928a9376705f59eba54c5cffffe053a00cba146bbe69e3fa2cc55f112 | assert||# -*- coding: utf-8 -*- from collections import namedtuple from typing import Sequence import pytest from wemake_python_styleguide.options.config import Configuration from wemake_python_styleguide.visitors.base import BaseVisitor def _to_dest_option(long_option_name: str) -> str: return long_option_name[2:].rep... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 57 | c3a04a1f3d7123ecef41ba6d1991a7a722ef92c8 | train | tests/test_visitors/test_ast/test_comparisons/test_literal.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_literal.py | 104 | 4 | assert_* | test_literal | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ConstantComparisonViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
ConstantComparisonVisitor,
)
if_with_is = 'if {0} is {1}: ...'
if_with_is_not = 'if {0} is not {1}: ...'
if_with_... | [ConstantComparisonViolation]) | added | 175221a3c80889ae82002721a1a22729f3a65c59917c07db70d9f9fef0c75776 | assert_*|test_literal|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ConstantComparisonViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( ConstantComparisonVisitor, ) if_with_is = 'if {0} is {1}: ...' if_with_is_not = 'if {0} is not {1}: ...... | null | null | null |
wemake-services/wemake-python-styleguide | train | 57 | c3a04a1f3d7123ecef41ba6d1991a7a722ef92c8 | train | tests/test_visitors/test_ast/test_comparisons/test_order.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_order.py | 166 | 4 | assert_* | test_comparison_wrong_order_multiple | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ComparisonOrderViolation,
)
from wemake_python_styleguide.visitors.ast.order import WrongOrderVisitor
if_with_is = 'if {0} is {1}: ...'
if_with_is_not = 'if {0} is not {1}: ...'
if_with_eq = 'if {0} == {1}: ...'
... | [ ComparisonOrderViolation, ComparisonOrderViolation, ]) | added | b6e3ece42028a2e144073a673ec0aaa240adc325c2c78a3f4ea12bc54cb19a6b | assert_*|test_comparison_wrong_order_multiple|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ComparisonOrderViolation, ) from wemake_python_styleguide.visitors.ast.order import WrongOrderVisitor if_with_is = 'if {0} is {1}: ...' if_with_is_not = 'if {0} is not {1}: .... | null | null | null |
wemake-services/wemake-python-styleguide | train | 57 | c3a04a1f3d7123ecef41ba6d1991a7a722ef92c8 | train | tests/test_visitors/test_ast/test_modules/test_empty_init.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_modules/test_empty_init.py | 74 | 4 | assert_* | test_init_with_logic | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
InitModuleHasLogicViolation,
)
from wemake_python_styleguide.visitors.ast.modules import (
EmptyModuleContentsVisitor,
)
empty_module = ''
module_with_docstring = """
'''Hi, am a docstring inside a module.'... | [InitModuleHasLogicViolation]) | modified | a8abc8a3da7f283184b3b02a8de649dc2b8b3c3cc6291d476f68297352873e12 | assert_*|test_init_with_logic|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( InitModuleHasLogicViolation, ) from wemake_python_styleguide.visitors.ast.modules import ( EmptyModuleContentsVisitor, ) empty_module = '' module_with_docstring = """ '''Hi, am a docstrin... | [InitModuleHasLogicViolation]) | 72 | 4 |
wemake-services/wemake-python-styleguide | train | 57 | c3a04a1f3d7123ecef41ba6d1991a7a722ef92c8 | train | tests/test_visitors/test_ast/test_modules/test_empty_modules.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_modules/test_empty_modules.py | 30 | 4 | assert_* | test_simple_filename | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
EmptyModuleViolation,
)
from wemake_python_styleguide.visitors.ast.modules import (
EmptyModuleContentsVisitor,
)
@pytest.mark.parametrize('filename', [
'empty.py',
'/home/user/logics.py',
'par... | [EmptyModuleViolation]) | modified | 47455b448797ee1d3c8032a1ebf81fbe55fc0301738bcfbcb5e568ebbbb988ab | assert_*|test_simple_filename|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( EmptyModuleViolation, ) from wemake_python_styleguide.visitors.ast.modules import ( EmptyModuleContentsVisitor, ) @pytest.mark.parametrize('filename', [ 'empty.py', '/home/user/logics.py'... | [EmptyModuleViolation]) | 28 | 4 |
wemake-services/wemake-python-styleguide | train | 57 | c3a04a1f3d7123ecef41ba6d1991a7a722ef92c8 | train | tests/test_visitors/test_filenames/test_wrong_module_name/test_module_magic_name.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_wrong_module_name/test_module_magic_name.py | 33 | 4 | assert_* | test_simple_filename | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.constants import MAGIC_MODULE_NAMES_WHITELIST
from wemake_python_styleguide.violations.naming import (
WrongModuleMagicNameViolation,
)
from wemake_python_styleguide.visitors.filenames.wrong_module_name import (
WrongModuleNameVisitor,
)
@p... | [WrongModuleMagicNameViolation]) | modified | 8bb56ff8a73aa339a9dcaf869f688a139e03114fc69b29b2cda80fce40d4c81f | assert_*|test_simple_filename|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.constants import MAGIC_MODULE_NAMES_WHITELIST from wemake_python_styleguide.violations.naming import ( WrongModuleMagicNameViolation, ) from wemake_python_styleguide.visitors.filenames.wrong_module_name import ( WrongModul... | [WrongModuleMagicNameViolation]) | 34 | 4 |
wemake-services/wemake-python-styleguide | train | 57 | c3a04a1f3d7123ecef41ba6d1991a7a722ef92c8 | train | tests/test_visitors/test_filenames/test_wrong_module_name/test_module_underscore_number.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_wrong_module_name/test_module_underscore_number.py | 26 | 4 | assert_* | test_filename_with_underscored_number | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
UnderScoredNumberNameViolation,
)
from wemake_python_styleguide.visitors.filenames.wrong_module_name import (
WrongModuleNameVisitor,
)
@pytest.mark.parametrize('filename', [
'version_2.py',
'custom_2_vers... | [UnderScoredNumberNameViolation]) | added | f35298f96374a67183cc6de768c24648777884b634089551e12a906a6a89058d | assert_*|test_filename_with_underscored_number|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( UnderScoredNumberNameViolation, ) from wemake_python_styleguide.visitors.filenames.wrong_module_name import ( WrongModuleNameVisitor, ) @pytest.mark.parametrize('filename', [ 've... | null | null | null |
wemake-services/wemake-python-styleguide | train | 58 | d33fbc8cffbfe2ab42dc17372bbea1fd77b428a5 | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 61 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
"""
from __future__ import print_function # noqa: Z422
from .version import get_version # noqa: Z300
import sys as sys # noqa: Z113
full_name = u'Nikita Sobolev' # noqa: Z302
phone_number = 555_123_999 # noqa: Z303
partial_number = .05 #... | octal_number | added | b4a5a30bd98061a6de74a26178d7019e85b0dcadb6b39bb343b110f7120c7ec0 | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. """ from __future__ import print_function # noqa: Z422 from .version import get_version # noqa: Z300 import sys as sys # noqa: Z113 full_name = u'Nikita Sobolev' # noqa: Z302 phone_number = 555_123_999 # noqa: Z303 partial_number = .05 # no... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 58 | d33fbc8cffbfe2ab42dc17372bbea1fd77b428a5 | train | tests/test_checkers/test_module_names.py | train | wemake-services/wemake-python-styleguide:tests/test_checkers/test_module_names.py | 26 | 4 | assert | test_module_names | # -*- coding: utf-8 -*-
import ast
import pytest
from wemake_python_styleguide.checker import Checker
from wemake_python_styleguide.violations import naming
@pytest.mark.parametrize('filename, error', [
('__magic__.py', naming.WrongModuleMagicNameViolation),
('util.py', naming.WrongModuleNameViolation),
... | error.code | added | b75aaba6ebedc4b464acfb1756d7c67556e8764dbb682c9a1a97fc932d7992dc | assert|test_module_names|# -*- coding: utf-8 -*- import ast import pytest from wemake_python_styleguide.checker import Checker from wemake_python_styleguide.violations import naming @pytest.mark.parametrize('filename, error', [ ('__magic__.py', naming.WrongModuleMagicNameViolation), ('util.py', naming.WrongModuleNameVi... | null | null | null |
wemake-services/wemake-python-styleguide | train | 58 | d33fbc8cffbfe2ab42dc17372bbea1fd77b428a5 | train | tests/test_checkers/test_noqa.py | train | wemake-services/wemake-python-styleguide:tests/test_checkers/test_noqa.py | 55 | 8 | assert | test_noqa_fixture_disabled | # -*- coding: utf-8 -*-
import subprocess
def test_noqa_fixture_disabled(absolute_path):
"""End-to-End test to check that all violations are present."""
process = subprocess.Popen(
[
'flake8',
'--disable-noqa',
'--select',
'Z',
absolute_path... | counts[error] | added | 1e6c1e3944b103f435305ace960ff5f1a05186256fa8c5e91f1bcbc84f47a885 | assert|test_noqa_fixture_disabled|# -*- coding: utf-8 -*- import subprocess def test_noqa_fixture_disabled(absolute_path): """End-to-End test to check that all violations are present.""" process = subprocess.Popen( [ 'flake8', '--disable-noqa', '--select', 'Z', absolute_path('fixtures', 'noqa.py'), ], stdout=subprocess... | null | null | null |
wemake-services/wemake-python-styleguide | train | 58 | d33fbc8cffbfe2ab42dc17372bbea1fd77b428a5 | train | tests/test_visitors/test_ast/test_comparisons/test_order.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_order.py | 142 | 4 | assert_* | test_comparison_wrong_order | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ComparisonOrderViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import WrongOrderVisitor
if_with_is = 'if {0} is {1}: ...'
if_with_is_not = 'if {0} is not {1}: ...'
if_with_eq = 'if {0} == {1}:... | [ComparisonOrderViolation]) | modified | 3d6127784a489b38b168d1ac206720b7f63f0899a7fdde4dd949639bbadbf69d | assert_*|test_comparison_wrong_order|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ComparisonOrderViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import WrongOrderVisitor if_with_is = 'if {0} is {1}: ...' if_with_is_not = 'if {0} is not {1}: ...'... | [ComparisonOrderViolation]) | 141 | 4 |
wemake-services/wemake-python-styleguide | train | 58 | d33fbc8cffbfe2ab42dc17372bbea1fd77b428a5 | train | tests/test_visitors/test_ast/test_comparisons/test_order.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_order.py | 167 | 4 | assert_* | test_comparison_wrong_order_multiple | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ComparisonOrderViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import WrongOrderVisitor
if_with_is = 'if {0} is {1}: ...'
if_with_is_not = 'if {0} is not {1}: ...'
if_with_eq = 'if {0} == {1}:... | [ ComparisonOrderViolation, ComparisonOrderViolation, ]) | modified | b4d3d6e523dc24aea53f696a041a84c61f5cc2ce9055cb92c47bdea3388c52c7 | assert_*|test_comparison_wrong_order_multiple|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ComparisonOrderViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import WrongOrderVisitor if_with_is = 'if {0} is {1}: ...' if_with_is_not = 'if {0} is not ... | [ ComparisonOrderViolation, ComparisonOrderViolation, ]) | 166 | 4 |
wemake-services/wemake-python-styleguide | train | 59 | 7f54ac7df10b5e37a02b826556e86b0cd1430500 | train | tests/test_checkers/test_noqa.py | train | wemake-services/wemake-python-styleguide:tests/test_checkers/test_noqa.py | 57 | 8 | assert | test_noqa_fixture_disabled | # -*- coding: utf-8 -*-
import subprocess
def test_noqa_fixture_disabled(absolute_path):
"""End-to-End test to check that all violations are present."""
process = subprocess.Popen(
[
'flake8',
'--disable-noqa',
'--select',
'Z',
absolute_path... | counts[error] | modified | 95820a26098e1b84a609923a84a44e019fe25a29ad52a03da3fe932174896857 | assert|test_noqa_fixture_disabled|# -*- coding: utf-8 -*- import subprocess def test_noqa_fixture_disabled(absolute_path): """End-to-End test to check that all violations are present.""" process = subprocess.Popen( [ 'flake8', '--disable-noqa', '--select', 'Z', absolute_path('fixtures', 'noqa.py'), ], stdout=subprocess... | counts[error] | 55 | 8 |
wemake-services/wemake-python-styleguide | train | 60 | 0f039b60cc27daf2fbe7a5709110272693d21eef | train | tests/test_checkers/test_module_names.py | train | wemake-services/wemake-python-styleguide:tests/test_checkers/test_module_names.py | 27 | 4 | assert | test_module_names | # -*- coding: utf-8 -*-
import ast
import pytest
from wemake_python_styleguide.checker import Checker
from wemake_python_styleguide.violations import naming
@pytest.mark.parametrize('filename, error', [
('__magic__.py', naming.WrongModuleMagicNameViolation),
('util.py', naming.WrongModuleNameViolation),
... | error.code | modified | 69b2bb0296e1bf25bc2ecd1bc9053022304ea86fc7c833d33e35cd60ee8cd6a5 | assert|test_module_names|# -*- coding: utf-8 -*- import ast import pytest from wemake_python_styleguide.checker import Checker from wemake_python_styleguide.violations import naming @pytest.mark.parametrize('filename, error', [ ('__magic__.py', naming.WrongModuleMagicNameViolation), ('util.py', naming.WrongModuleNameVi... | error.code | 26 | 4 |
wemake-services/wemake-python-styleguide | train | 60 | 0f039b60cc27daf2fbe7a5709110272693d21eef | train | tests/test_checkers/test_noqa.py | train | wemake-services/wemake-python-styleguide:tests/test_checkers/test_noqa.py | 58 | 8 | assert | test_noqa_fixture_disabled | # -*- coding: utf-8 -*-
import subprocess
def test_noqa_fixture_disabled(absolute_path):
"""End-to-End test to check that all violations are present."""
process = subprocess.Popen(
[
'flake8',
'--disable-noqa',
'--select',
'Z',
absolute_path... | counts[error] | modified | 73027d573b988955140c68e277412bd93e337dd3e9c85529c65fc9517875e8ff | assert|test_noqa_fixture_disabled|# -*- coding: utf-8 -*- import subprocess def test_noqa_fixture_disabled(absolute_path): """End-to-End test to check that all violations are present.""" process = subprocess.Popen( [ 'flake8', '--disable-noqa', '--select', 'Z', absolute_path('fixtures', 'noqa.py'), ], stdout=subprocess... | counts[error] | 57 | 8 |
wemake-services/wemake-python-styleguide | train | 60 | 0f039b60cc27daf2fbe7a5709110272693d21eef | train | tests/test_visitors/conftest.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/conftest.py | 14 | 8 | assert | # -*- coding: utf-8 -*-
from typing import Sequence
import pytest
from wemake_python_styleguide.visitors.base import BaseVisitor
@pytest.fixture(scope='session')
def assert_errors():
"""Helper function to assert visitor violations."""
def factory(visitor: BaseVisitor, errors: Sequence[str]):
assert... | len(visitor.violations) | added | 504f71d68c0f2401fa13f73bc4182beb44b37aa31066f8850c6220cba21deedc | assert||# -*- coding: utf-8 -*- from typing import Sequence import pytest from wemake_python_styleguide.visitors.base import BaseVisitor @pytest.fixture(scope='session') def assert_errors(): """Helper function to assert visitor violations.""" def factory(visitor: BaseVisitor, errors: Sequence[str]): assert len(errors) ... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 60 | 0f039b60cc27daf2fbe7a5709110272693d21eef | train | tests/test_visitors/conftest.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/conftest.py | 17 | 12 | assert | # -*- coding: utf-8 -*-
from typing import Sequence
import pytest
from wemake_python_styleguide.visitors.base import BaseVisitor
@pytest.fixture(scope='session')
def assert_errors():
"""Helper function to assert visitor violations."""
def factory(visitor: BaseVisitor, errors: Sequence[str]):
assert... | errors[index].code | added | a71bc55c3cc6d8abf657d547291734196ad98672286501b9cb43c603e316a3b9 | assert||# -*- coding: utf-8 -*- from typing import Sequence import pytest from wemake_python_styleguide.visitors.base import BaseVisitor @pytest.fixture(scope='session') def assert_errors(): """Helper function to assert visitor violations.""" def factory(visitor: BaseVisitor, errors: Sequence[str]): assert len(errors) ... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 60 | 0f039b60cc27daf2fbe7a5709110272693d21eef | train | tests/test_visitors/test_ast/test_comparisons/test_multiple_in.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_multiple_in.py | 70 | 4 | assert_* | test_comparison_with_multiple_in | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
MultipleInComparisonViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import MultipleInVisitor
if_with_multiple_in_comaprisons = 'if {0} in {1} in {2}: ...'
if_without_multiple_in_comparisons = '... | [MultipleInComparisonViolation]) | added | f63a8ca88d22a4b2d85c3ab908b196fb8ce7af8ad7b86f04cf508a92d2be9938 | assert_*|test_comparison_with_multiple_in|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( MultipleInComparisonViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import MultipleInVisitor if_with_multiple_in_comaprisons = 'if {0} in {1} in {2}: ...' if_... | null | null | null |
wemake-services/wemake-python-styleguide | train | 60 | 0f039b60cc27daf2fbe7a5709110272693d21eef | train | tests/test_visitors/test_ast/test_comparisons/test_redundant.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_redundant.py | 108 | 4 | assert_* | test_redundant | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
RedundantComparisonViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
RedundantComparisonVisitor,
)
create_variables = """
variable = 1
another_variable = 2
{0}
"""
if_with_is = 'if ... | [RedundantComparisonViolation]) | added | 9ce1f41ca1cf006fd8b132aa41cc5853b8686b72e7b7ddbc285a78cf0c8e4c3a | assert_*|test_redundant|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( RedundantComparisonViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( RedundantComparisonVisitor, ) create_variables = """ variable = 1 another_variable = 2 {0} """ if_wi... | null | null | null |
wemake-services/wemake-python-styleguide | train | 60 | 0f039b60cc27daf2fbe7a5709110272693d21eef | train | tests/test_visitors/test_ast/test_keywords/test_loops.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_loops.py | 45 | 4 | assert_* | test_wrong_else_in_for_loop | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
RedundantForElseViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import WrongForElseVisitor
right_else_in_for_loop = """
for x in '123':
...
else:
...
"""
wrong_else_in_for_loop = """
f... | [RedundantForElseViolation]) | added | cd29098fd4c342cbffae6a519411ad24188f2fe7c1fc9583743123bb341ad439 | assert_*|test_wrong_else_in_for_loop|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( RedundantForElseViolation, ) from wemake_python_styleguide.visitors.ast.keywords import WrongForElseVisitor right_else_in_for_loop = """ for x in '123': ... else: ... """ wrong_els... | null | null | null |
wemake-services/wemake-python-styleguide | train | 61 | 9ea55485dbdf03086a8f0536dd3fe0088fa9d1c0 | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 63 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
"""
from __future__ import print_function # noqa: Z422
from .version import get_version # noqa: Z300
import sys as sys # noqa: Z113
full_name = u'Nikita Sobolev' # noqa: Z302
phone_number = 555_123_999 # noqa: Z303
partial_number = .05 #... | hex_number | added | 22dc500bc7ad9cf235d801ade2cfe912e68b02cb8eaef78e9301e5ad78fe5c4d | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. """ from __future__ import print_function # noqa: Z422 from .version import get_version # noqa: Z300 import sys as sys # noqa: Z113 full_name = u'Nikita Sobolev' # noqa: Z302 phone_number = 555_123_999 # noqa: Z303 partial_number = .05 # no... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 61 | 9ea55485dbdf03086a8f0536dd3fe0088fa9d1c0 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 17 | 8 | assert | # -*- coding: utf-8 -*-
import re
import subprocess
from collections import Counter
ERROR_PATTERN = re.compile(r'(Z\d{3})')
def _assert_errors_count_in_output(output, errors):
found_errors = Counter((
match.group(0) for match in ERROR_PATTERN.finditer(output)
))
for found_error, found_count in ... | errors.pop(found_error) | added | 0d3630234c454e461358590e665f8db765c034ad083b6e0b5d9eff84f88b7340 | assert||# -*- coding: utf-8 -*- import re import subprocess from collections import Counter ERROR_PATTERN = re.compile(r'(Z\d{3})') def _assert_errors_count_in_output(output, errors): found_errors = Counter(( match.group(0) for match in ERROR_PATTERN.finditer(output) )) for found_error, found_count in found_errors.item... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 61 | 9ea55485dbdf03086a8f0536dd3fe0088fa9d1c0 | train | tests/test_checker/test_presets.py | train | wemake-services/wemake-python-styleguide:tests/test_checker/test_presets.py | 62 | 8 | assert | test_all_visitors_contained_in_checker | # -*- coding: utf-8 -*-
import glob
import importlib
import inspect
from importlib.machinery import SourceFileLoader
from operator import itemgetter
import pytest
from wemake_python_styleguide.checker import Checker
from wemake_python_styleguide.visitors.base import (
BaseFilenameVisitor,
BaseNodeVisitor,
... | checker_visitors | added | ab62f09539021b4cc4a115605065b7e959e49056943e17d566b495d152eb2f29 | assert|test_all_visitors_contained_in_checker|# -*- coding: utf-8 -*- import glob import importlib import inspect from importlib.machinery import SourceFileLoader from operator import itemgetter import pytest from wemake_python_styleguide.checker import Checker from wemake_python_styleguide.visitors.base import ( BaseF... | null | null | null |
wemake-services/wemake-python-styleguide | train | 61 | 9ea55485dbdf03086a8f0536dd3fe0088fa9d1c0 | train | tests/test_checker/test_presets.py | train | wemake-services/wemake-python-styleguide:tests/test_checker/test_presets.py | 64 | 4 | assert | test_all_visitors_contained_in_checker | # -*- coding: utf-8 -*-
import glob
import importlib
import inspect
from importlib.machinery import SourceFileLoader
from operator import itemgetter
import pytest
from wemake_python_styleguide.checker import Checker
from wemake_python_styleguide.visitors.base import (
BaseFilenameVisitor,
BaseNodeVisitor,
... | len(checker_visitors) | added | ba36adf8c16ddb3a14c06c196f9e87e41364533409f9c03e176dc5839ed71c96 | assert|test_all_visitors_contained_in_checker|# -*- coding: utf-8 -*- import glob import importlib import inspect from importlib.machinery import SourceFileLoader from operator import itemgetter import pytest from wemake_python_styleguide.checker import Checker from wemake_python_styleguide.visitors.base import ( BaseF... | null | null | null |
wemake-services/wemake-python-styleguide | train | 61 | 9ea55485dbdf03086a8f0536dd3fe0088fa9d1c0 | train | tests/test_visitors/test_ast/test_comparisons/test_literal.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_literal.py | 155 | 4 | assert_* | test_literal_special2 | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ConstantComparisonViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
ConstantComparisonVisitor,
)
if_with_is = 'if {0} is {1}: ...'
if_with_is_not = 'if {0} is not {1}: ...'
if_with_... | [ConstantComparisonViolation]) | modified | 1be5420051c4cd2447cacf9d60bcb13f02b2e0d22af404c497e888ba426e2755 | assert_*|test_literal_special2|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ConstantComparisonViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( ConstantComparisonVisitor, ) if_with_is = 'if {0} is {1}: ...' if_with_is_not = 'if {0} is not... | [ConstantComparisonViolation]) | 152 | 4 |
wemake-services/wemake-python-styleguide | train | 61 | 9ea55485dbdf03086a8f0536dd3fe0088fa9d1c0 | train | tests/test_visitors/test_ast/test_comparisons/test_order.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_order.py | 145 | 4 | assert_* | test_comparison_wrong_order | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ComparisonOrderViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import WrongOrderVisitor
if_with_is = 'if {0} is {1}: ...'
if_with_is_not = 'if {0} is not {1}: ...'
if_with_eq = 'if {0} == {1}:... | [ComparisonOrderViolation]) | modified | 7a35a787963f3a6193f482369f1ad5f212cb89bbc1d9a8246012523ab28e5047 | assert_*|test_comparison_wrong_order|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ComparisonOrderViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import WrongOrderVisitor if_with_is = 'if {0} is {1}: ...' if_with_is_not = 'if {0} is not {1}: ...'... | [ComparisonOrderViolation]) | 142 | 4 |
wemake-services/wemake-python-styleguide | train | 61 | 9ea55485dbdf03086a8f0536dd3fe0088fa9d1c0 | train | tests/test_visitors/test_ast/test_comparisons/test_order.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_order.py | 170 | 4 | assert_* | test_comparison_wrong_order_multiple | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ComparisonOrderViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import WrongOrderVisitor
if_with_is = 'if {0} is {1}: ...'
if_with_is_not = 'if {0} is not {1}: ...'
if_with_eq = 'if {0} == {1}:... | [ ComparisonOrderViolation, ComparisonOrderViolation, ]) | modified | 209ef45ff92a74a15ab1da21dce8fbd91d349f620c5fed871168a12d8e1da1b0 | assert_*|test_comparison_wrong_order_multiple|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ComparisonOrderViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import WrongOrderVisitor if_with_is = 'if {0} is {1}: ...' if_with_is_not = 'if {0} is not ... | [ ComparisonOrderViolation, ComparisonOrderViolation, ]) | 167 | 4 |
wemake-services/wemake-python-styleguide | train | 61 | 9ea55485dbdf03086a8f0536dd3fe0088fa9d1c0 | train | tests/test_visitors/test_ast/test_comparisons/test_redundant.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_redundant.py | 111 | 4 | assert_* | test_redundant | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
RedundantComparisonViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
RedundantComparisonVisitor,
)
create_variables = """
variable = 1
another_variable = 2
{0}
"""
if_with_is = 'if ... | [RedundantComparisonViolation]) | modified | 7e0f16c0acf00d244f467000a52c1c27233ead798bbe8e1ff89400da699adc3f | assert_*|test_redundant|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( RedundantComparisonViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( RedundantComparisonVisitor, ) create_variables = """ variable = 1 another_variable = 2 {0} """ if_wi... | [RedundantComparisonViolation]) | 108 | 4 |
wemake-services/wemake-python-styleguide | train | 62 | 703b405e1b41ca059c65b0db68b64b737d832963 | train | tests/test_visitors/test_ast/test_comparisons/test_literal.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_literal.py | 107 | 4 | assert_* | test_literal | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ConstantComparisonViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
ComparisonSanityVisitor,
)
if_with_is = 'if {0} is {1}: ...'
if_with_is_not = 'if {0} is not {1}: ...'
if_with_eq... | [ConstantComparisonViolation]) | modified | 4a6ac054de9333c38c69f58e5375f4fa22ea5db707a5d5df05b922381e49b661 | assert_*|test_literal|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ConstantComparisonViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( ComparisonSanityVisitor, ) if_with_is = 'if {0} is {1}: ...' if_with_is_not = 'if {0} is not {1}: ...' ... | [ConstantComparisonViolation]) | 107 | 4 |
wemake-services/wemake-python-styleguide | train | 62 | 703b405e1b41ca059c65b0db68b64b737d832963 | train | tests/test_visitors/test_ast/test_comparisons/test_literal.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_literal.py | 131 | 4 | assert_* | test_literal_special1 | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ConstantComparisonViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
ComparisonSanityVisitor,
)
if_with_is = 'if {0} is {1}: ...'
if_with_is_not = 'if {0} is not {1}: ...'
if_with_eq... | [ConstantComparisonViolation]) | modified | 60a590dfdd9728964a16bc267736292d36610e0802609f9e72eb83fadf0d41eb | assert_*|test_literal_special1|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ConstantComparisonViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( ComparisonSanityVisitor, ) if_with_is = 'if {0} is {1}: ...' if_with_is_not = 'if {0} is not {... | [ConstantComparisonViolation]) | 131 | 4 |
wemake-services/wemake-python-styleguide | train | 62 | 703b405e1b41ca059c65b0db68b64b737d832963 | train | tests/test_visitors/test_ast/test_comparisons/test_literal.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_literal.py | 155 | 4 | assert_* | test_literal_special2 | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ConstantComparisonViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
ComparisonSanityVisitor,
)
if_with_is = 'if {0} is {1}: ...'
if_with_is_not = 'if {0} is not {1}: ...'
if_with_eq... | [ConstantComparisonViolation]) | modified | f477c4d3add0d755a5d574aad2dc5cbe7caa41738c9e567e26112be302e08db9 | assert_*|test_literal_special2|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ConstantComparisonViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( ComparisonSanityVisitor, ) if_with_is = 'if {0} is {1}: ...' if_with_is_not = 'if {0} is not {... | [ConstantComparisonViolation]) | 155 | 4 |
wemake-services/wemake-python-styleguide | train | 62 | 703b405e1b41ca059c65b0db68b64b737d832963 | train | tests/test_visitors/test_ast/test_comparisons/test_multiple_in.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_multiple_in.py | 71 | 4 | assert_* | test_comparison_with_multiple_in | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
MultipleInComparisonViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
ComparisonSanityVisitor,
)
if_with_multiple_in_comparisons = 'if {0} in {1} in {2}: ...'
if_without_multiple_in_... | [MultipleInComparisonViolation]) | modified | 57206b129c057ae429b2e4e53c70af18606c48db3d04a9254636d8048cbd68e4 | assert_*|test_comparison_with_multiple_in|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( MultipleInComparisonViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( ComparisonSanityVisitor, ) if_with_multiple_in_comparisons = 'if {0} in {1} in {2... | [MultipleInComparisonViolation]) | 70 | 4 |
wemake-services/wemake-python-styleguide | train | 62 | 703b405e1b41ca059c65b0db68b64b737d832963 | train | tests/test_visitors/test_ast/test_comparisons/test_order.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_order.py | 147 | 4 | assert_* | test_comparison_wrong_order | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ComparisonOrderViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
WrongComparisionOrderVisitor,
)
if_with_is = 'if {0} is {1}: ...'
if_with_is_not = 'if {0} is not {1}: ...'
if_with_... | [ComparisonOrderViolation]) | modified | c971f48286848d15a01e25f0357c4cc04ad4931f4b7953454f36a9d2e0c2d2ce | assert_*|test_comparison_wrong_order|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ComparisonOrderViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( WrongComparisionOrderVisitor, ) if_with_is = 'if {0} is {1}: ...' if_with_is_not = 'if {0} ... | [ComparisonOrderViolation]) | 145 | 4 |
wemake-services/wemake-python-styleguide | train | 62 | 703b405e1b41ca059c65b0db68b64b737d832963 | train | tests/test_visitors/test_ast/test_comparisons/test_order.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_order.py | 172 | 4 | assert_* | test_comparison_wrong_order_multiple | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ComparisonOrderViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
WrongComparisionOrderVisitor,
)
if_with_is = 'if {0} is {1}: ...'
if_with_is_not = 'if {0} is not {1}: ...'
if_with_... | [ ComparisonOrderViolation, ComparisonOrderViolation, ]) | modified | 062a41b49ad05c4eaf85263a2a4697290a48fa5bc2cd997a43b21f5dc37048cf | assert_*|test_comparison_wrong_order_multiple|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ComparisonOrderViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( WrongComparisionOrderVisitor, ) if_with_is = 'if {0} is {1}: ...' if_with_is_not =... | [ ComparisonOrderViolation, ComparisonOrderViolation, ]) | 170 | 4 |
wemake-services/wemake-python-styleguide | train | 62 | 703b405e1b41ca059c65b0db68b64b737d832963 | train | tests/test_visitors/test_ast/test_comparisons/test_redundant.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_redundant.py | 113 | 4 | assert_* | test_redundant | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
RedundantComparisonViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
ComparisonSanityVisitor,
)
create_variables = """
variable = 1
another_variable = 2
{0}
"""
if_with_is = 'if {0}... | [RedundantComparisonViolation]) | modified | d0f03b0fc66d269c1fda6af45ffa302d005ca3f0abacc7d874213a53f1241a7e | assert_*|test_redundant|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( RedundantComparisonViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( ComparisonSanityVisitor, ) create_variables = """ variable = 1 another_variable = 2 {0} """ if_with_... | [RedundantComparisonViolation]) | 111 | 4 |
wemake-services/wemake-python-styleguide | train | 62 | 703b405e1b41ca059c65b0db68b64b737d832963 | train | tests/test_visitors/test_ast/test_comparisons/test_redundant.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_redundant.py | 127 | 4 | assert_* | test_multiple_compare | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
RedundantComparisonViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
ComparisonSanityVisitor,
)
create_variables = """
variable = 1
another_variable = 2
{0}
"""
if_with_is = 'if {0}... | [RedundantComparisonViolation]) | added | a257acac19cf1dd4deb334c84742dbff1cee847907ea0895e69c4558389b799a | assert_*|test_multiple_compare|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( RedundantComparisonViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( ComparisonSanityVisitor, ) create_variables = """ variable = 1 another_variable = 2 {0} """ i... | null | null | null |
wemake-services/wemake-python-styleguide | train | 63 | 4b223e796ce5908aace71af9a1bf817ac361201f | train | tests/test_visitors/test_ast/test_keywords/test_try.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_try.py | 48 | 4 | assert_* | test_wrong_finally | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
RedundantFinallyViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import (
WrongTryFinallyVisitor,
)
right_try_example = """
try:
...
except:
...
"""
wrong_try_example = """
try:
... | [RedundantFinallyViolation]) | added | c5142a08dc9e607ee9c7ab4452fe9e80903fffa805dc7efee750cb1e1a91159b | assert_*|test_wrong_finally|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( RedundantFinallyViolation, ) from wemake_python_styleguide.visitors.ast.keywords import ( WrongTryFinallyVisitor, ) right_try_example = """ try: ... except: ... """ wrong_try_example = """ ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 64 | 36d022e9892ac5e1c02c74065f6a55c68c0e5764 | 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 | 44 | 4 | assert_* | test_wrong_attributes_names | # -*- coding: utf-8 -*-
import string
import pytest
from wemake_python_styleguide.violations.naming import (
PrivateNameViolation,
TooShortVariableNameViolation,
UpperCaseAttributeViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
VARIABLE_NAMES_BL... | [WrongVariableNameViolation]) | modified | 10013085d1c5de0f4fe844234356f2ff3b9f6fb65a8f873fa81fe9363ee2de4d | assert_*|test_wrong_attributes_names|# -*- coding: utf-8 -*- import string import pytest from wemake_python_styleguide.violations.naming import ( PrivateNameViolation, TooShortVariableNameViolation, UpperCaseAttributeViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( VAR... | [WrongVariableNameViolation]) | 43 | 4 |
wemake-services/wemake-python-styleguide | train | 64 | 36d022e9892ac5e1c02c74065f6a55c68c0e5764 | 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 | 61 | 4 | assert_* | test_too_short_attribute_names | # -*- coding: utf-8 -*-
import string
import pytest
from wemake_python_styleguide.violations.naming import (
PrivateNameViolation,
TooShortVariableNameViolation,
UpperCaseAttributeViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
VARIABLE_NAMES_BL... | [TooShortVariableNameViolation]) | modified | 364c4573eacae4f18b83ae610f1b5093dd0f953fb5464cd1aece6b7fd6db4ef9 | assert_*|test_too_short_attribute_names|# -*- coding: utf-8 -*- import string import pytest from wemake_python_styleguide.violations.naming import ( PrivateNameViolation, TooShortVariableNameViolation, UpperCaseAttributeViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( ... | [TooShortVariableNameViolation]) | 60 | 4 |
wemake-services/wemake-python-styleguide | train | 64 | 36d022e9892ac5e1c02c74065f6a55c68c0e5764 | 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 | 77 | 4 | assert_* | test_private_attribute_names | # -*- coding: utf-8 -*-
import string
import pytest
from wemake_python_styleguide.violations.naming import (
PrivateNameViolation,
TooShortVariableNameViolation,
UpperCaseAttributeViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
VARIABLE_NAMES_BL... | [PrivateNameViolation]) | modified | 8edf927b23c6b90d98a0c3d1bef78e49924200634e448e014d511a9aedd34d3c | assert_*|test_private_attribute_names|# -*- coding: utf-8 -*- import string import pytest from wemake_python_styleguide.violations.naming import ( PrivateNameViolation, TooShortVariableNameViolation, UpperCaseAttributeViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( VA... | [PrivateNameViolation]) | 76 | 4 |
wemake-services/wemake-python-styleguide | train | 64 | 36d022e9892ac5e1c02c74065f6a55c68c0e5764 | 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 | 120 | 4 | assert_* | test_upper_case_class_attributes | # -*- coding: utf-8 -*-
import string
import pytest
from wemake_python_styleguide.violations.naming import (
PrivateNameViolation,
TooShortVariableNameViolation,
UpperCaseAttributeViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
VARIABLE_NAMES_BL... | [UpperCaseAttributeViolation]) | added | 10efda11a7eca127940d0af53f687bbddc003ce94e3eacd16e19cfa7f2634c68 | assert_*|test_upper_case_class_attributes|# -*- coding: utf-8 -*- import string import pytest from wemake_python_styleguide.violations.naming import ( PrivateNameViolation, TooShortVariableNameViolation, UpperCaseAttributeViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 66 | 1fc7b3eb3bffce09ce5b647b290bcf4209707c65 | 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 | 147 | 4 | assert_* | test_module_counts_violation | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.complexity.counts import (
ModuleMembersVisitor,
TooManyModuleMembersViolation,
)
# Multiple module members:
module_with_function_and_class = """
def first(): ...
class Second(object): ...
"""
module_with_function_and_class_a... | [TooManyModuleMembersViolation]) | added | 84549f86d6c316e93bb8e613171221a5ac3ee1ad173d922d5b9b711d289619c4 | assert_*|test_module_counts_violation|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.complexity.counts import ( ModuleMembersVisitor, TooManyModuleMembersViolation, ) # Multiple module members: module_with_function_and_class = """ def first(): ... class Second(object): ... """ module_w... | null | null | null |
wemake-services/wemake-python-styleguide | train | 66 | 1fc7b3eb3bffce09ce5b647b290bcf4209707c65 | train | tests/test_visitors/test_ast/test_complexity/test_function/test_arguments.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_arguments.py | 194 | 4 | assert_* | test_single_argument_count_valid | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
TooManyArgumentsViolation,
)
function_without_arguments = 'def function(): ...'
function_with_single_argument = 'def function(arg1): ...'
function_with_single_args = 'def f... | [TooManyArgumentsViolation]) | added | e132d317c61ccd1a86ecd3d801045a5cbe666b953ae22902b693ed53532374bf | assert_*|test_single_argument_count_valid|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, TooManyArgumentsViolation, ) function_without_arguments = 'def function(): ...' function_with_single_argument = 'def function(arg1): ...' fun... | null | null | null |
wemake-services/wemake-python-styleguide | train | 66 | 1fc7b3eb3bffce09ce5b647b290bcf4209707c65 | train | tests/test_visitors/test_ast/test_complexity/test_function/test_arguments_lambda.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_arguments_lambda.py | 81 | 4 | assert_* | test_no_arguments_error | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
TooManyArgumentsViolation,
)
lambda_without_arguments = 'lambda: ...'
lambda_with_single_argument = 'lambda arg1: ...'
lambda_with_single_args = 'lambda *args: ...'
lambda_... | [TooManyArgumentsViolation]) | added | fd760cbf90197e5acb10e125dacbd7f6d3629572ce1aafeb21c38a7f8cf48ba1 | assert_*|test_no_arguments_error|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, TooManyArgumentsViolation, ) lambda_without_arguments = 'lambda: ...' lambda_with_single_argument = 'lambda arg1: ...' lambda_with_single_args = 'lamb... | null | null | null |
wemake-services/wemake-python-styleguide | train | 66 | 1fc7b3eb3bffce09ce5b647b290bcf4209707c65 | train | tests/test_visitors/test_ast/test_naming/test_function_args_names.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_function_args_names.py | 120 | 4 | assert_* | test_wrong_function_arguments | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
PrivateNameViolation,
TooShortVariableNameViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
VARIABLE_NAMES_BLACKLIST,
WrongNameVisitor,
)
function_test ... | [ TooShortVariableNameViolation, WrongVariableNameViolation, ]) | added | 09c538e5b5b90dcb81890d72ce286fa2ba7a3ebabee9f8a9bc57aef16079650e | assert_*|test_wrong_function_arguments|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( PrivateNameViolation, TooShortVariableNameViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( VARIABLE_NAMES_BLACKLIST, WrongNameVisitor, ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 66 | 1fc7b3eb3bffce09ce5b647b290bcf4209707c65 | train | tests/test_visitors/test_ast/test_naming/test_function_args_names.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_function_args_names.py | 156 | 4 | assert_* | test_private_function_arguments | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
PrivateNameViolation,
TooShortVariableNameViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
VARIABLE_NAMES_BLACKLIST,
WrongNameVisitor,
)
function_test ... | [ PrivateNameViolation, PrivateNameViolation, ]) | added | 2b04e940900d6419e0f511df5b5023f348ae78be3c53f922ed224c733a94f838 | assert_*|test_private_function_arguments|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( PrivateNameViolation, TooShortVariableNameViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( VARIABLE_NAMES_BLACKLIST, WrongNameVisitor... | null | null | null |
wemake-services/wemake-python-styleguide | train | 67 | 21da040f2ef46b2bb01598f3f7161056df304d0c | train | tests/test_visitors/test_ast/test_complexity/test_function/test_local_variables.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_local_variables.py | 103 | 4 | assert_* | test_locals_wrong_count | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
TooManyLocalsViolation,
)
function_with_locals = """
{0}def function():
local_variable1 = 1
local_variable2 = 2
_ = None # `_` is not counted
"""
function_wit... | [TooManyLocalsViolation]) | added | cc0a6def7f54650710a4bf70abb28fe8d6217f73c3885e523f3ebd614c3ba2fb | assert_*|test_locals_wrong_count|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, TooManyLocalsViolation, ) function_with_locals = """ {0}def function(): local_variable1 = 1 local_variable2 = 2 _ = None # `_` is not counted """ func... | null | null | null |
wemake-services/wemake-python-styleguide | train | 68 | 5b437e751fb6bf2bcbad5bf576f364e272e1dfc8 | train | tests/test_checker/test_presets.py | train | wemake-services/wemake-python-styleguide:tests/test_checker/test_presets.py | 72 | 8 | assert | test_all_visitors_contained_in_checker | # -*- coding: utf-8 -*-
import importlib
import inspect
from importlib.machinery import SourceFileLoader
from operator import itemgetter
from pathlib import Path
import pytest
from wemake_python_styleguide.checker import Checker
from wemake_python_styleguide.visitors.base import (
BaseFilenameVisitor,
BaseNo... | checker_visitors | added | 499aac84196625e8cab6e30e437f21c1105c53884be16ba1f400c5ff8d960617 | assert|test_all_visitors_contained_in_checker|# -*- coding: utf-8 -*- import importlib import inspect from importlib.machinery import SourceFileLoader from operator import itemgetter from pathlib import Path import pytest from wemake_python_styleguide.checker import Checker from wemake_python_styleguide.visitors.base i... | null | null | null |
wemake-services/wemake-python-styleguide | train | 68 | 5b437e751fb6bf2bcbad5bf576f364e272e1dfc8 | train | tests/test_checker/test_presets.py | train | wemake-services/wemake-python-styleguide:tests/test_checker/test_presets.py | 74 | 4 | assert | test_all_visitors_contained_in_checker | # -*- coding: utf-8 -*-
import importlib
import inspect
from importlib.machinery import SourceFileLoader
from operator import itemgetter
from pathlib import Path
import pytest
from wemake_python_styleguide.checker import Checker
from wemake_python_styleguide.visitors.base import (
BaseFilenameVisitor,
BaseNo... | len(checker_visitors) | added | 2a707ce13fd219a49a99d2443eabb80d6c075446d744065c14a4504a580be01b | assert|test_all_visitors_contained_in_checker|# -*- coding: utf-8 -*- import importlib import inspect from importlib.machinery import SourceFileLoader from operator import itemgetter from pathlib import Path import pytest from wemake_python_styleguide.checker import Checker from wemake_python_styleguide.visitors.base i... | null | null | null |
wemake-services/wemake-python-styleguide | train | 69 | 6feb7844f541bebeaa61bb21953697d9dd6c7b3f | train | tests/test_visitors/test_tokenize/test_wrong_keywords/test_keywords_spaces.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_wrong_keywords/test_keywords_spaces.py | 60 | 4 | assert_* | test_missing_space | # -*- coding: utf-8 -*-
import sys
import pytest
from wemake_python_styleguide.violations.consistency import (
MissingSpaceBetweenKeywordAndParenViolation,
)
from wemake_python_styleguide.visitors.tokenize.keywords import (
WrongKeywordTokenVisitor,
)
_multiline_error_function = """
def foo():
yield(1, ... | [MissingSpaceBetweenKeywordAndParenViolation]) | added | dffafb7dc82696de80d7ae8537e7154e4e007d613a81a78bcbe84ed8b9a50c36 | assert_*|test_missing_space|# -*- coding: utf-8 -*- import sys import pytest from wemake_python_styleguide.violations.consistency import ( MissingSpaceBetweenKeywordAndParenViolation, ) from wemake_python_styleguide.visitors.tokenize.keywords import ( WrongKeywordTokenVisitor, ) _multiline_error_function = """ def foo(... | null | null | null |
wemake-services/wemake-python-styleguide | train | 70 | 5b5ab6e1b3eaa88b0df2a3b9352a292547d009f0 | train | tests/test_visitors/test_ast/test_comparisons/test_conditionals.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_conditionals.py | 79 | 4 | assert_* | test_redundant | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
WrongConditionalViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
WrongConditionalVisitor,
)
create_variable = """
variable = 1
{0}
"""
if_statement = 'if {0}: ...'
ternary = 'terna... | [WrongConditionalViolation]) | added | 84429f21829cd93d93921f562875bf6f0deb312808fc5b1c34ec58aede53a0bf | assert_*|test_redundant|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( WrongConditionalViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( WrongConditionalVisitor, ) create_variable = """ variable = 1 {0} """ if_statement = 'if {0}: ...' tern... | null | null | null |
wemake-services/wemake-python-styleguide | train | 71 | 2544373a9dda6cb0a287a542f9e5d0fdcc5c878c | train | tests/test_visitors/test_ast/test_keywords/test_comprehensions.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_comprehensions.py | 141 | 4 | assert_* | test_multiple_if_keywords_in_comprehension | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyForsInComprehensionViolation,
)
from wemake_python_styleguide.violations.consistency import (
MultipleIfsInComprehensionViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import (
WrongL... | [MultipleIfsInComprehensionViolation]) | added | af72e3bf74de81aa8b0ca772ebfd54019af81d84651f2229d00a70aaa45452e0 | assert_*|test_multiple_if_keywords_in_comprehension|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( TooManyForsInComprehensionViolation, ) from wemake_python_styleguide.violations.consistency import ( MultipleIfsInComprehensionViolation, ) from wemake_python_styleguide... | null | null | null |
wemake-services/wemake-python-styleguide | train | 71 | 2544373a9dda6cb0a287a542f9e5d0fdcc5c878c | train | tests/test_visitors/test_ast/test_keywords/test_comprehensions.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_comprehensions.py | 158 | 4 | assert_* | test_multiple_for_keywords_in_comprehension | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyForsInComprehensionViolation,
)
from wemake_python_styleguide.violations.consistency import (
MultipleIfsInComprehensionViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import (
WrongL... | [TooManyForsInComprehensionViolation]) | added | 44747d9a699edb66fc3296433f85ea39771945ee84402ad8fccbfb4f14582523 | assert_*|test_multiple_for_keywords_in_comprehension|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( TooManyForsInComprehensionViolation, ) from wemake_python_styleguide.violations.consistency import ( MultipleIfsInComprehensionViolation, ) from wemake_python_styleguid... | null | null | null |
wemake-services/wemake-python-styleguide | train | 72 | ed3562d2e4437c3a6e4e1f2b6bde9b0295a35d4e | 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 | 58 | 4 | assert_* | test_self_variable_reassignment | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
ReassigningVariableToItselfViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
WrongVariableAssignmentVisitor,
)
wrong_fragment = """
test_variable = 5
test_variable = test_variable
"""
... | [ReassigningVariableToItselfViolation]) | added | ad75f00e3c4091d52ef09fc908bb3659f33994c2fab7f10aecc4dfa0c3421276 | assert_*|test_self_variable_reassignment|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( ReassigningVariableToItselfViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( WrongVariableAssignmentVisitor, ) wrong_fragment = """ test_variable = 5 test... | null | null | null |
wemake-services/wemake-python-styleguide | train | 73 | ffea1f3aac64b3046a38660f6b3553767d179398 | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 61 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
"""
from __future__ import print_function # noqa: Z422
from .version import get_version # noqa: Z300
import sys as sys # noqa: Z113
full_name = u'Nikita Sobolev' # noqa: Z302
phone_number = 555_123_999 # noqa: Z303
partial_number = .05 #... | octal_number | added | 49a499ad4ce86463f70af4918f94ba9906ef39b58f1ff202790b3da9fb534e7a | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. """ from __future__ import print_function # noqa: Z422 from .version import get_version # noqa: Z300 import sys as sys # noqa: Z113 full_name = u'Nikita Sobolev' # noqa: Z302 phone_number = 555_123_999 # noqa: Z303 partial_number = .05 # no... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 73 | ffea1f3aac64b3046a38660f6b3553767d179398 | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 63 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
"""
from __future__ import print_function # noqa: Z422
from .version import get_version # noqa: Z300
import sys as sys # noqa: Z113
full_name = u'Nikita Sobolev' # noqa: Z302
phone_number = 555_123_999 # noqa: Z303
partial_number = .05 #... | hex_number | added | 06c4c63c3d951714c9013e607740509ac66df5f0bc279276735b73d8f3f11d60 | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. """ from __future__ import print_function # noqa: Z422 from .version import get_version # noqa: Z300 import sys as sys # noqa: Z113 full_name = u'Nikita Sobolev' # noqa: Z302 phone_number = 555_123_999 # noqa: Z303 partial_number = .05 # no... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 74 | a38c947543259fc05e06ace383e3650e2945561e | train | tests/test_visitors/test_ast/test_classes/test_parent_class_visitor.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_parent_class_visitor.py | 28 | 4 | assert_* | test_wrong_class_definition_multiple_parent | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
WrongParentClassListDef,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
extra_object = 'class TestClassName(FirstName, SecondName, object): ...'
@pytest.mark.parametrize('code', [
... | [WrongParentClassListDef]) | added | 133e4b9bc6bd8be13030e306db64513ad834d9b96202bfc5738b23f1a88c8adc | assert_*|test_wrong_class_definition_multiple_parent|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( WrongParentClassListDef, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor extra_object = 'class TestClassName(FirstName, SecondName, objec... | null | null | null |
wemake-services/wemake-python-styleguide | train | 75 | 58cfab4a23d54d0c61d2879c161a4d2dc9985096 | train | tests/test_visitors/test_ast/test_keywords/test_base_exception.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_base_exception.py | 46 | 4 | assert_* | test_use_base_exception | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
BaseExceptionViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import (
WrongExceptionTypeVisitor,
)
use_base_exception = """
try:
execute()
except BaseException:
raise
"""
use_excep... | [BaseExceptionViolation]) | added | 0b32e2274ffc0989c0310bf40175acb4ea1b3d471c1e7cafafb652dbc8a5ea30 | assert_*|test_use_base_exception|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( BaseExceptionViolation, ) from wemake_python_styleguide.visitors.ast.keywords import ( WrongExceptionTypeVisitor, ) use_base_exception = """ try: execute() except BaseException: raise ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 76 | 6e22cfd275b9e31948031e25bc84aa4c4cdd3b11 | train | tests/test_visitors/test_ast/test_complexity/test_counts/test_bases_classes_counts.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_counts/test_bases_classes_counts.py | 57 | 4 | assert_* | test_bad_number_default_option | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyBaseClassesViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
correct_count = """
class CorrectClassName(
FirstParentClass,
SecondParentClass,
ThirdParentCla... | [TooManyBaseClassesViolation]) | added | 8ed9a04fc7790c5eb10d3a2bff39f741495a0a971d65d3ddf9e7e499e30e1325 | assert_*|test_bad_number_default_option|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( TooManyBaseClassesViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor correct_count = """ class CorrectClassName( FirstParentClass, SecondParent... | null | null | null |
wemake-services/wemake-python-styleguide | train | 78 | 00d24b4003240717924005df4ae16d4a133c50b1 | train | tests/test_options.py | train | wemake-services/wemake-python-styleguide:tests/test_options.py | 10 | 8 | assert | test_option_docs | # -*- coding: utf-8 -*-
from wemake_python_styleguide.options.config import Configuration
def test_option_docs():
"""Ensures that all options are documented."""
for option in Configuration.options:
option_name = '``' + option.long_option_name[2:] + '``'
assert option_name in | Configuration.__doc__ | added | 2a7be4a0363afc1482ae0c55f5c0f43b66d2b22e6c914e98819b56c3d4a9b550 | assert|test_option_docs|# -*- coding: utf-8 -*- from wemake_python_styleguide.options.config import Configuration def test_option_docs(): """Ensures that all options are documented.""" for option in Configuration.options: option_name = '``' + option.long_option_name[2:] + '``' assert option_name in | null | null | null |
wemake-services/wemake-python-styleguide | train | 78 | 00d24b4003240717924005df4ae16d4a133c50b1 | train | tests/test_violations.py | train | wemake-services/wemake-python-styleguide:tests/test_violations.py | 58 | 8 | assert | test_all_violations_have_versionadded | # -*- coding: utf-8 -*-
import ast
from wemake_python_styleguide.violations.base import ASTViolation, BaseViolation
def test_visitor_returns_location():
"""Ensures that `BaseNodeVisitor` return correct violation message."""
visitor = ASTViolation(node=ast.parse(''), text='violation')
visitor.error_templ... | violation.__doc__ | added | 21a9a7ee48b502fc65bf78b27c213b0be97103d5c3dc7c4f5ea340995e1e515a | assert|test_all_violations_have_versionadded|# -*- coding: utf-8 -*- import ast from wemake_python_styleguide.violations.base import ASTViolation, BaseViolation def test_visitor_returns_location(): """Ensures that `BaseNodeVisitor` return correct violation message.""" visitor = ASTViolation(node=ast.parse(''), text='vi... | null | null | null |
wemake-services/wemake-python-styleguide | train | 79 | d3963f716ffe879efe47871acc51a994e4ebd3c0 | train | tests/test_visitors/test_ast/test_imports/test_protected_import.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_imports/test_protected_import.py | 40 | 4 | assert_* | test_incorrect_import | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import ProtectedModuleViolation
from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor
import_public = 'import public'
import_protected = 'import _protected'
import_from_protected = 'from _protected import som... | [ProtectedModuleViolation]) | added | 1e4ed590afbeb7cfa6e19d89f067d169417809c6362e2fcd19bf497aecc4838d | assert_*|test_incorrect_import|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ProtectedModuleViolation from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor import_public = 'import public' import_protected = 'import _protected' import_from_protected =... | null | null | null |
wemake-services/wemake-python-styleguide | train | 80 | 72958ed1a85173d9d8430c4fa91328a00aec23d8 | train | tests/test_visitors/test_ast/test_naming/test_consecutive_underscore_in_variable_name.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_consecutive_underscore_in_variable_name.py | 72 | 4 | assert_* | test_consecutive_underscores_in_variable_name | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
ConsecutiveUnderscoresInNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
variable_test = """
{0} = 'test'
"""
underscore_variable_test1 = """
_{0} = 'test'
"""
underscore_var... | [ConsecutiveUnderscoresInNameViolation]) | added | b417ad1a0941a24d34660c99a4f6c15e12127263dec8ffc21bab028ec0f245fe | assert_*|test_consecutive_underscores_in_variable_name|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( ConsecutiveUnderscoresInNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor variable_test = """ {0} = 'test' """ underscore_variabl... | null | null | null |
wemake-services/wemake-python-styleguide | train | 81 | 3da9bf1bf1c55653d953053d12a41549ebad6b69 | train | tests/test_violations/test_codes.py | train | wemake-services/wemake-python-styleguide:tests/test_violations/test_codes.py | 10 | 4 | assert | test_all_unique_violation_codes | # -*- coding: utf-8 -*-
def test_all_unique_violation_codes(all_violations):
"""Ensures that all violations have unique violation codes."""
codes = []
for violation in all_violations:
codes.append(int(violation.code))
assert len(set(codes)) == | len(all_violations) | added | 981c52e4cf513597772826348e12377312561220ca93c311fd08badca9e9b5d9 | assert|test_all_unique_violation_codes|# -*- coding: utf-8 -*- def test_all_unique_violation_codes(all_violations): """Ensures that all violations have unique violation codes.""" codes = [] for violation in all_violations: codes.append(int(violation.code)) assert len(set(codes)) == | null | null | null |
wemake-services/wemake-python-styleguide | train | 81 | 3da9bf1bf1c55653d953053d12a41549ebad6b69 | train | tests/test_violations/test_codes.py | train | wemake-services/wemake-python-styleguide:tests/test_violations/test_codes.py | 21 | 12 | assert | test_all_violations_correct_numbers | # -*- coding: utf-8 -*-
def test_all_unique_violation_codes(all_violations):
"""Ensures that all violations have unique violation codes."""
codes = []
for violation in all_violations:
codes.append(int(violation.code))
assert len(set(codes)) == len(all_violations)
def test_all_violations_cor... | violation_class.code | added | 5f8ab6e9d284cfe3923e3774b21c7bc317f51a824c0b44e70834e6d0bdee70fc | assert|test_all_violations_correct_numbers|# -*- coding: utf-8 -*- def test_all_unique_violation_codes(all_violations): """Ensures that all violations have unique violation codes.""" codes = [] for violation in all_violations: codes.append(int(violation.code)) assert len(set(codes)) == len(all_violations) def test_all_... | null | null | null |
wemake-services/wemake-python-styleguide | train | 81 | 3da9bf1bf1c55653d953053d12a41549ebad6b69 | train | tests/test_violations/test_docs.py | train | wemake-services/wemake-python-styleguide:tests/test_violations/test_docs.py | 15 | 8 | assert | test_all_violations_have_description_with_code | # -*- coding: utf-8 -*-
def test_all_violations_are_documented(all_module_violations):
"""Ensures that all violations are documented."""
for module, classes in all_module_violations.items():
for violation_class in classes:
# Once per `summary` and once per `autoclass`:
assert m... | violation.__doc__ | added | e97be0a4180f91629ae0034de5518457318b0c879f832f1895ec58d1e3122462 | assert|test_all_violations_have_description_with_code|# -*- coding: utf-8 -*- def test_all_violations_are_documented(all_module_violations): """Ensures that all violations are documented.""" for module, classes in all_module_violations.items(): for violation_class in classes: # Once per `summary` and once per `autoclas... | null | null | null |
wemake-services/wemake-python-styleguide | train | 81 | 3da9bf1bf1c55653d953053d12a41549ebad6b69 | train | tests/test_violations/test_docs.py | train | wemake-services/wemake-python-styleguide:tests/test_violations/test_docs.py | 21 | 8 | assert | test_all_violations_have_versionadded | # -*- coding: utf-8 -*-
def test_all_violations_are_documented(all_module_violations):
"""Ensures that all violations are documented."""
for module, classes in all_module_violations.items():
for violation_class in classes:
# Once per `summary` and once per `autoclass`:
assert m... | violation.__doc__ | added | 48ec7cbfe25a71719ddb3381548d81e0b42f41e804bc885928e2cf43a1b36c61 | assert|test_all_violations_have_versionadded|# -*- coding: utf-8 -*- def test_all_violations_are_documented(all_module_violations): """Ensures that all violations are documented.""" for module, classes in all_module_violations.items(): for violation_class in classes: # Once per `summary` and once per `autoclass`: asser... | null | null | null |
wemake-services/wemake-python-styleguide | train | 81 | 3da9bf1bf1c55653d953053d12a41549ebad6b69 | train | tests/test_violations/test_docs.py | train | wemake-services/wemake-python-styleguide:tests/test_violations/test_docs.py | 28 | 8 | assert | test_violation_name | # -*- coding: utf-8 -*-
def test_all_violations_are_documented(all_module_violations):
"""Ensures that all violations are documented."""
for module, classes in all_module_violations.items():
for violation_class in classes:
# Once per `summary` and once per `autoclass`:
assert m... | class_name.endswith('Violation') | added | 466fb1d4681b5ecee930e372e916cbcc59db47d7a921e03c3fbb9bf622ab2c21 | assert|test_violation_name|# -*- coding: utf-8 -*- def test_all_violations_are_documented(all_module_violations): """Ensures that all violations are documented.""" for module, classes in all_module_violations.items(): for violation_class in classes: # Once per `summary` and once per `autoclass`: assert module.__doc__.c... | null | null | null |
wemake-services/wemake-python-styleguide | train | 81 | 3da9bf1bf1c55653d953053d12a41549ebad6b69 | train | tests/test_violations/test_implementation.py | train | wemake-services/wemake-python-styleguide:tests/test_violations/test_implementation.py | 13 | 4 | assert | test_visitor_returns_location | # -*- coding: utf-8 -*-
import ast
from wemake_python_styleguide.violations.base import ASTViolation, BaseViolation
def test_visitor_returns_location():
"""Ensures that `BaseNodeVisitor` return correct violation message."""
visitor = ASTViolation(node=ast.parse(''), text='violation')
visitor.error_templ... | (0, 0, 'Z001 violation') | added | d56805444f78921fad2e254fc2e229cdc8a56e77c1e765aef89807d1a8881f5c | assert|test_visitor_returns_location|# -*- coding: utf-8 -*- import ast from wemake_python_styleguide.violations.base import ASTViolation, BaseViolation def test_visitor_returns_location(): """Ensures that `BaseNodeVisitor` return correct violation message.""" visitor = ASTViolation(node=ast.parse(''), text='violation'... | null | null | null |
wemake-services/wemake-python-styleguide | train | 81 | 3da9bf1bf1c55653d953053d12a41549ebad6b69 | train | tests/test_visitors/test_ast/test_classes/test_parent_class_visitor.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_parent_class_visitor.py | 28 | 4 | assert_* | test_wrong_class_definition_multiple_parent | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ObjectInBaseClassesListViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
extra_object = 'class TestClassName(FirstName, SecondName, object): ...'
@pytest.mark.parametrize('... | [ObjectInBaseClassesListViolation]) | modified | 5ef5f64825c6ddfc5ddb8cc95d51d9881e72e81e25d3c37f5761310923421706 | assert_*|test_wrong_class_definition_multiple_parent|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ObjectInBaseClassesListViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor extra_object = 'class TestClassName(FirstName, SecondNa... | [WrongParentClassListDef]) | 28 | 4 |
wemake-services/wemake-python-styleguide | train | 81 | 3da9bf1bf1c55653d953053d12a41549ebad6b69 | train | tests/test_visitors/test_ast/test_classes/test_yield_inside_init.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_yield_inside_init.py | 51 | 4 | assert_* | test_init_generator | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
YieldInsideInitViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
init_without_yield = """
class ModuleMembersVisitor(object):
def __init__(self, *args, **kwargs):
... | [YieldInsideInitViolation]) | added | 044cd748950c797569de20e935157399dae9d972f5ec0599e03a96881c603f8e | assert_*|test_init_generator|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( YieldInsideInitViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor init_without_yield = """ class ModuleMembersVisitor(object): def __init__(self, *arg... | null | null | null |
wemake-services/wemake-python-styleguide | train | 82 | 46a7fc8143df9208490bdef54a156f8a64d307a4 | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 64 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
"""
from __future__ import print_function # noqa: Z422
from .version import get_version # noqa: Z300
import sys as sys # noqa: Z113
from some import _protected # noqa: Z440
full_name = u'Nikita Sobolev' # noqa: Z302
phone_number = 555_123_... | octal_number | modified | d49264f1f8fd704209f5a90aff209e731f34dd991d7b663e02e4104c4631f848 | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. """ from __future__ import print_function # noqa: Z422 from .version import get_version # noqa: Z300 import sys as sys # noqa: Z113 from some import _protected # noqa: Z440 full_name = u'Nikita Sobolev' # noqa: Z302 phone_number = 555_123_9... | octal_number | 61 | 0 | |
wemake-services/wemake-python-styleguide | train | 82 | 46a7fc8143df9208490bdef54a156f8a64d307a4 | train | tests/test_visitors/test_ast/test_attributes/test_protected_attributes.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_attributes/test_protected_attributes.py | 86 | 4 | assert_* | test_protected_attribute_is_restricted | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.attributes import (
ProtectedAttributeViolation,
WrongAttributeVisitor,
)
# Incorrect:
protected_attribute_assigned = 'some._protected = 1'
protected_attribute_accessed = 'print(some._protected)'
protected_method_called = 'some... | [ProtectedAttributeViolation]) | added | 11820396ffe3d1c06328bdb6a757e7c38ed857fe73b56b7121400cf12a075640 | assert_*|test_protected_attribute_is_restricted|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.attributes import ( ProtectedAttributeViolation, WrongAttributeVisitor, ) # Incorrect: protected_attribute_assigned = 'some._protected = 1' protected_attribute_accessed = 'print(some._protect... | null | null | null |
wemake-services/wemake-python-styleguide | train | 82 | 46a7fc8143df9208490bdef54a156f8a64d307a4 | train | tests/test_visitors/test_ast/test_builtins/test_formatted_string.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_formatted_string.py | 59 | 4 | assert_* | test_wrong_string | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
FormattedStringViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import WrongStringVisitor
regular_string = "'some value'"
binary_string = "b'binary'"
unicode_string = "u'unicode'"
string_variable =... | [FormattedStringViolation]) | added | 5d136d58ec671efaf7f4a6293b1706daf4f75aaafac18c21d61706033aeb0555 | assert_*|test_wrong_string|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( FormattedStringViolation, ) from wemake_python_styleguide.visitors.ast.builtins import WrongStringVisitor regular_string = "'some value'" binary_string = "b'binary'" unicode_string = "u'unicode... | null | null | null |
wemake-services/wemake-python-styleguide | train | 82 | 46a7fc8143df9208490bdef54a156f8a64d307a4 | train | tests/test_visitors/test_ast/test_builtins/test_magic_numbers.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_magic_numbers.py | 167 | 4 | assert_* | test_magic_number_warning | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.constants import MAGIC_NUMBERS_WHITELIST
from wemake_python_styleguide.violations.best_practices import (
MagicNumberViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import MagicNumberVisitor
# Correct usages:
assignment = 'cons... | [MagicNumberViolation]) | modified | f33c74c37c3e858b6d2e1ce68c74da6f2b739bff0a29766e01a4015a8d9b48f9 | assert_*|test_magic_number_warning|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.constants import MAGIC_NUMBERS_WHITELIST from wemake_python_styleguide.violations.best_practices import ( MagicNumberViolation, ) from wemake_python_styleguide.visitors.ast.builtins import MagicNumberVisitor # Correct... | [MagicNumberViolation]) | 169 | 4 |
wemake-services/wemake-python-styleguide | train | 82 | 46a7fc8143df9208490bdef54a156f8a64d307a4 | train | tests/test_visitors/test_ast/test_classes/test_yield_inside_init.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_yield_inside_init.py | 63 | 4 | assert_* | test_init_generator | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
YieldInsideInitViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
init_without_yield = """
class ModuleMembersVisitor(object):
def __init__(self, *args, **kwargs):
... | [YieldInsideInitViolation]) | added | 5aa07da948256278afa70de6d9f28674841f28a49c14d4d445452a320dbb23b5 | assert_*|test_init_generator|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( YieldInsideInitViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor init_without_yield = """ class ModuleMembersVisitor(object): def __init__(self, *arg... | null | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.