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 | 124 | a28cdbbddbbe7890d9eda32c1f6fd6e3172ea1ac | train | tests/test_visitors/conftest.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/conftest.py | 45 | 8 | assert | # -*- coding: utf-8 -*-
from typing import Sequence
import pytest
from wemake_python_styleguide.violations.base import (
ASTViolation,
TokenizeViolation,
)
from wemake_python_styleguide.visitors.base import BaseVisitor
@pytest.fixture(scope='session')
def assert_errors():
"""Helper function to assert v... | violation.message() | modified | 363e8b01283b7141ab917912546e0ec58a1586887b3cdd0bcf10ca23b18104c3 | assert||# -*- coding: utf-8 -*- from typing import Sequence import pytest from wemake_python_styleguide.violations.base import ( ASTViolation, TokenizeViolation, ) from wemake_python_styleguide.visitors.base import BaseVisitor @pytest.fixture(scope='session') def assert_errors(): """Helper function to assert visitor vi... | violation.message() | 44 | 8 | |
wemake-services/wemake-python-styleguide | train | 124 | a28cdbbddbbe7890d9eda32c1f6fd6e3172ea1ac | train | tests/test_visitors/test_ast/test_builtins/test_multiple_assign.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_multiple_assign.py | 60 | 4 | assert_* | test_multiple_assignments | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
MultipleAssignmentsViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
WrongAssignmentVisitor,
)
# Correct usages:
single_assignment = 'constant = 1'
tuple_assignment = 'first, second... | [MultipleAssignmentsViolation]) | added | 1e69055c3839246e1aa7a1b2ba290a9de97e710686030e1ed6fb8b08b627fc9f | assert_*|test_multiple_assignments|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( MultipleAssignmentsViolation, ) from wemake_python_styleguide.visitors.ast.builtins import ( WrongAssignmentVisitor, ) # Correct usages: single_assignment = 'constant = 1' tuple_assi... | null | null | null |
wemake-services/wemake-python-styleguide | train | 124 | a28cdbbddbbe7890d9eda32c1f6fd6e3172ea1ac | train | tests/test_visitors/test_tokenize/test_primitives/test_string_modifier.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_primitives/test_string_modifier.py | 74 | 4 | assert_* | test_uppercase_prefix | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
UppercaseStringModifierViolation,
)
from wemake_python_styleguide.visitors.tokenize.primitives import (
WrongPrimitivesVisitor,
)
@pytest.mark.parametrize('modifier', [
'r',
'b',
'rb',
'f',
... | [UppercaseStringModifierViolation]) | added | 45b8a3e40dbcd376ffac18b224ceb230cbd05348595aa35ec9e1d4fb1a1bb165 | assert_*|test_uppercase_prefix|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( UppercaseStringModifierViolation, ) from wemake_python_styleguide.visitors.tokenize.primitives import ( WrongPrimitivesVisitor, ) @pytest.mark.parametrize('modifier', [ 'r', 'b', 'rb', 'f',... | null | null | null |
wemake-services/wemake-python-styleguide | train | 124 | a28cdbbddbbe7890d9eda32c1f6fd6e3172ea1ac | train | tests/test_visitors/test_tokenize/test_primitives/test_string_modifier.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_primitives/test_string_modifier.py | 75 | 4 | assert_* | test_uppercase_prefix | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
UppercaseStringModifierViolation,
)
from wemake_python_styleguide.visitors.tokenize.primitives import (
WrongPrimitivesVisitor,
)
@pytest.mark.parametrize('modifier', [
'r',
'b',
'rb',
'f',
... | modifier) | added | f4ee7f42eb0897192b20a27ca8dc39e9d60b0a4825d43448f98fc8f981b9aeaa | assert_*|test_uppercase_prefix|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( UppercaseStringModifierViolation, ) from wemake_python_styleguide.visitors.tokenize.primitives import ( WrongPrimitivesVisitor, ) @pytest.mark.parametrize('modifier', [ 'r', 'b', 'rb', 'f',... | null | null | null |
wemake-services/wemake-python-styleguide | train | 124 | a28cdbbddbbe7890d9eda32c1f6fd6e3172ea1ac | train | tests/test_visitors/test_tokenize/test_primitives/test_string_modifier.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_primitives/test_string_modifier.py | 106 | 4 | assert_* | test_uppercase_prefix_multiple | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
UppercaseStringModifierViolation,
)
from wemake_python_styleguide.visitors.tokenize.primitives import (
WrongPrimitivesVisitor,
)
@pytest.mark.parametrize('modifier', [
'r',
'b',
'rb',
'f',
... | [ UppercaseStringModifierViolation, UppercaseStringModifierViolation, ]) | added | cf427a22b94e3981bba543651e826c8b375ab127dc544282a82a7c8d04959aed | assert_*|test_uppercase_prefix_multiple|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( UppercaseStringModifierViolation, ) from wemake_python_styleguide.visitors.tokenize.primitives import ( WrongPrimitivesVisitor, ) @pytest.mark.parametrize('modifier', [ 'r', 'b', '... | null | null | null |
wemake-services/wemake-python-styleguide | train | 125 | b20eb1a555194b1d19cffcd78821b99d73bb8f69 | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 158 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
It is used for e2e tests.
"""
from __future__ import print_function # noqa: Z422
import os.path # noqa: Z301
import sys as sys # noqa: Z113
from some import _protected # noqa: Z440
from .version import get_version # noqa: Z300
full_name... | octal_number | modified | 2e07a278e35f90614467241b0dcaf8f03b366896985f5d6d59878e29d56ad141 | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. It is used for e2e tests. """ from __future__ import print_function # noqa: Z422 import os.path # noqa: Z301 import sys as sys # noqa: Z113 from some import _protected # noqa: Z440 from .version import get_version # noqa: Z300 full_name = u... | octal_number | 156 | 0 | |
wemake-services/wemake-python-styleguide | train | 125 | b20eb1a555194b1d19cffcd78821b99d73bb8f69 | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 168 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
It is used for e2e tests.
"""
from __future__ import print_function # noqa: Z422
import os.path # noqa: Z301
import sys as sys # noqa: Z113
from some import _protected # noqa: Z440
from .version import get_version # noqa: Z300
full_name... | hex_number | modified | 21fa731715ea9cc377528b6fc170a0e8e5a5eac544b4b1bde4dece2403c251d9 | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. It is used for e2e tests. """ from __future__ import print_function # noqa: Z422 import os.path # noqa: Z301 import sys as sys # noqa: Z113 from some import _protected # noqa: Z440 from .version import get_version # noqa: Z300 full_name = u... | hex_number | 166 | 0 | |
wemake-services/wemake-python-styleguide | train | 125 | b20eb1a555194b1d19cffcd78821b99d73bb8f69 | train | tests/test_violations/test_implementation.py | train | wemake-services/wemake-python-styleguide:tests/test_violations/test_implementation.py | 16 | 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')
visito... | (0, 0, 'Z001 violation') | modified | 5205d1febb6fd0b42bc615b12a64224783f2999b50da2886823507e33f5d3fe4 | 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='viola... | (0, 0, 'Z001 violation') | 13 | 4 |
wemake-services/wemake-python-styleguide | train | 125 | b20eb1a555194b1d19cffcd78821b99d73bb8f69 | train | tests/test_visitors/test_ast/test_keywords/test_try_except/test_base_exception.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_try_except/test_base_exception.py | 49 | 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 (
WrongTryExceptVisitor,
)
use_base_exception = """
try:
execute()
except BaseException:
raise
"""
use_except_ex... | [BaseExceptionViolation]) | added | b1f74cc2a33d00f112c8891bf0b690f86e14088d8abf01ee3d3bca7f93d16982 | 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 ( WrongTryExceptVisitor, ) use_base_exception = """ try: execute() except BaseException: raise """ ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 125 | b20eb1a555194b1d19cffcd78821b99d73bb8f69 | train | tests/test_visitors/test_ast/test_keywords/test_try_except/test_duplicate_exceptions.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_try_except/test_duplicate_exceptions.py | 147 | 4 | assert_* | test_duplicate_exceptions | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
DuplicateExceptionViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import (
WrongTryExceptVisitor,
)
# Correct:
correct_bare_except = """
try:
...
except:
...
"""
correct_simple_ex... | [DuplicateExceptionViolation]) | added | a4272af457fa62d84eefdd775f6fbfefe2f36ee3086efc8d176237c24191e8b9 | assert_*|test_duplicate_exceptions|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( DuplicateExceptionViolation, ) from wemake_python_styleguide.visitors.ast.keywords import ( WrongTryExceptVisitor, ) # Correct: correct_bare_except = """ try: ... except: ... """ cor... | null | null | null |
wemake-services/wemake-python-styleguide | train | 125 | b20eb1a555194b1d19cffcd78821b99d73bb8f69 | train | tests/test_visitors/test_ast/test_keywords/test_try_except/test_try_finally.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_try_except/test_try_finally.py | 51 | 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 (
WrongTryExceptVisitor,
)
right_try_example = """
try:
...
except:
...
"""
wrong_try_example = """
try:
... | [RedundantFinallyViolation]) | added | 4a964d5e25d38f72423020d54aa05e514f2645516be77eae799631f0f08d2f80 | 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 ( WrongTryExceptVisitor, ) right_try_example = """ try: ... except: ... """ wrong_try_example = """ t... | null | null | null |
wemake-services/wemake-python-styleguide | train | 126 | 2f57cc769f9c3ae10491925afe4933e3e5333d6a | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_consecutive_underscore.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_consecutive_underscore.py | 32 | 4 | assert_* | test_underscored_variable_name | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
ConsecutiveUnderscoresInNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
@pytest.mark.parametrize('underscored_name', [
'with__underscore',
'mutliple__under__score',
... | [ConsecutiveUnderscoresInNameViolation]) | modified | 84c316db72c8c7ff278589ff7778c63320bf6d01d30dbb05338dff340ccf969d | assert_*|test_underscored_variable_name|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( ConsecutiveUnderscoresInNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor @pytest.mark.parametrize('underscored_name', [ 'with__underscore', 'mu... | [ConsecutiveUnderscoresInNameViolation]) | 31 | 4 |
wemake-services/wemake-python-styleguide | train | 126 | 2f57cc769f9c3ae10491925afe4933e3e5333d6a | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_consecutive_underscore.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_consecutive_underscore.py | 33 | 4 | assert_* | test_underscored_variable_name | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
ConsecutiveUnderscoresInNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
@pytest.mark.parametrize('underscored_name', [
'with__underscore',
'mutliple__under__score',
... | underscored_name) | modified | ec2a3ad1a979f6fee3d310cc38f02fe47fa5329383510b5df0e63fe117be5814 | assert_*|test_underscored_variable_name|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( ConsecutiveUnderscoresInNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor @pytest.mark.parametrize('underscored_name', [ 'with__underscore', 'mu... | underscored_name) | 32 | 4 |
wemake-services/wemake-python-styleguide | train | 126 | 2f57cc769f9c3ae10491925afe4933e3e5333d6a | train | tests/test_visitors/test_tokenize/test_statements/test_bracket_lines.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_statements/test_bracket_lines.py | 169 | 4 | assert_* | test_wrong_brackets | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
WrongBracketPositionViolation,
)
from wemake_python_styleguide.visitors.tokenize.statements import (
BracketLocationVisitor,
)
# Correct:
correct_simple_variable = 'xy = [[], [], ()]'
correct_simple_function_... | [WrongBracketPositionViolation]) | added | e36dd46dd214aa8604676337b02dc6883f367b2762b40b5b70b79d34f811e3e9 | assert_*|test_wrong_brackets|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( WrongBracketPositionViolation, ) from wemake_python_styleguide.visitors.tokenize.statements import ( BracketLocationVisitor, ) # Correct: correct_simple_variable = 'xy = [[], [], ()]' correct... | null | null | null |
wemake-services/wemake-python-styleguide | train | 127 | cb3df775c2b7937a2c15dcd608963c8ae71fb00c | train | tests/test_visitors/test_ast/test_builtins/test_assing/test_unpacking_rules.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_assing/test_unpacking_rules.py | 127 | 4 | assert_* | test_multiple_assignments | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
IncorrectUnpackingViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
WrongAssignmentVisitor,
)
single_assignment = '{0} = 1'
tuple_assignment1 = 'first, {0} = (1, 2)'
tuple_assignmen... | [IncorrectUnpackingViolation]) | added | f18cc9b0f86071664aabf4b84688b2e5f000137683eff652f84b7d7e9df9509c | assert_*|test_multiple_assignments|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( IncorrectUnpackingViolation, ) from wemake_python_styleguide.visitors.ast.builtins import ( WrongAssignmentVisitor, ) single_assignment = '{0} = 1' tuple_assignment1 = 'first, {0} = ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 128 | 9a753dab86770674ad07173d042860fff0a5a3f6 | train | tests/test_regressions/test_regression_112.py | train | wemake-services/wemake-python-styleguide:tests/test_regressions/test_regression_112.py | 52 | 4 | assert | test_regression112 | # -*- coding: utf-8 -*-
import ast
from pyflakes.checker import Checker as PyFlakesChecker
from wemake_python_styleguide.checker import Checker
code_that_brakes = '''
def current_session(
telegram_id: int,
for_update: bool = True,
) -> TelegramSession:
"""
Was triggering `AttributeError`.
See:... | flakes.root | added | 2aceb8f4e6801f3b775d8f65b13acdbdf7ef21cdeb992d24c1f83462cef41e4e | assert|test_regression112|# -*- coding: utf-8 -*- import ast from pyflakes.checker import Checker as PyFlakesChecker from wemake_python_styleguide.checker import Checker code_that_brakes = ''' def current_session( telegram_id: int, for_update: bool = True, ) -> TelegramSession: """ Was triggering `AttributeError`. See:... | null | null | null |
wemake-services/wemake-python-styleguide | train | 129 | c98c385127492f4542fda45945246449b851ec15 | train | tests/test_visitors/test_ast/test_keywords/test_comprehensions/test_yield_inside_comprehension.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_comprehensions/test_yield_inside_comprehension.py | 46 | 4 | assert_* | test_yield_keyword_in_comprehension | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
YieldInComprehensionViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import (
WrongComprehensionVisitor,
)
list_comprehension = """
def container():
nodes = [{0} for xy in "abc"]
"""
ge... | [YieldInComprehensionViolation]) | added | d16d1e5fdbad0b1369820e64a4e13177dba2462a773a269b6db2bbd42643c9bf | assert_*|test_yield_keyword_in_comprehension|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( YieldInComprehensionViolation, ) from wemake_python_styleguide.visitors.ast.keywords import ( WrongComprehensionVisitor, ) list_comprehension = """ def container(): nodes =... | null | null | null |
wemake-services/wemake-python-styleguide | train | 130 | 842c041198a9d7935d0d089a3b7c6a38593eb236 | train | tests/test_visitors/test_tokenize/test_primitives/test_string_multiline.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_primitives/test_string_multiline.py | 79 | 4 | assert_* | test_incorrect_multiline_strings | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
IncorrectMultilineStringViolation,
)
from wemake_python_styleguide.visitors.tokenize.primitives import (
MultilineStringVisitor,
)
multiline_single = """'''
abc
'''"""
multiline_double = '''"""
abc
"""'''
# ... | [IncorrectMultilineStringViolation]) | added | f47d1a99f839553973fbf36b09aff6070a09e38091a08748c01012267f5ff4c4 | assert_*|test_incorrect_multiline_strings|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( IncorrectMultilineStringViolation, ) from wemake_python_styleguide.visitors.tokenize.primitives import ( MultilineStringVisitor, ) multiline_single = """''' abc '''""" multiline_... | null | null | null |
wemake-services/wemake-python-styleguide | train | 130 | 842c041198a9d7935d0d089a3b7c6a38593eb236 | train | tests/test_visitors/test_tokenize/test_statements/test_bracket_lines.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_statements/test_bracket_lines.py | 176 | 4 | assert_* | test_wrong_brackets | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
WrongBracketPositionViolation,
)
from wemake_python_styleguide.visitors.tokenize.statements import (
BracketLocationVisitor,
)
# Correct:
correct_simple_variable = 'xy = [[], [], ()]'
correct_simple_function_... | [WrongBracketPositionViolation]) | added | c29cfe8eafba88351fe81d3f4d60434ab9a32c406233c0c3ffeff4a5beb312ab | assert_*|test_wrong_brackets|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( WrongBracketPositionViolation, ) from wemake_python_styleguide.visitors.tokenize.statements import ( BracketLocationVisitor, ) # Correct: correct_simple_variable = 'xy = [[], [], ()]' correct... | null | null | null |
wemake-services/wemake-python-styleguide | train | 131 | c29eb9b59e13a92087d617f0cf5a642ebcbb2a3e | train | tests/test_visitors/test_ast/test_builtins/test_set_elements.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_set_elements.py | 95 | 4 | assert_* | test_set_with_pure_duplicate | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
NonUniqueItemsInSetViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
WrongCollectionVisitor,
)
set_literal_template = '{{{0}, {1}}}'
@pytest.mark.parametrize('code', [
set_lite... | [NonUniqueItemsInSetViolation]) | added | e407f71345018d9b51ef979c073e8df2312ed9d5ecb549c46be64c398333ba2c | assert_*|test_set_with_pure_duplicate|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( NonUniqueItemsInSetViolation, ) from wemake_python_styleguide.visitors.ast.builtins import ( WrongCollectionVisitor, ) set_literal_template = '{{{0}, {1}}}' @pytest.mark.parametri... | null | null | null |
wemake-services/wemake-python-styleguide | train | 131 | c29eb9b59e13a92087d617f0cf5a642ebcbb2a3e | train | tests/test_visitors/test_ast/test_builtins/test_set_elements.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_set_elements.py | 96 | 4 | assert_* | test_set_with_pure_duplicate | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
NonUniqueItemsInSetViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
WrongCollectionVisitor,
)
set_literal_template = '{{{0}, {1}}}'
@pytest.mark.parametrize('code', [
set_lite... | element) | added | 126eab813d8e5463d9919f4d28b791516d18c3033f87eda8c7aa1f474ea68c1c | assert_*|test_set_with_pure_duplicate|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( NonUniqueItemsInSetViolation, ) from wemake_python_styleguide.visitors.ast.builtins import ( WrongCollectionVisitor, ) set_literal_template = '{{{0}, {1}}}' @pytest.mark.parametri... | null | null | null |
wemake-services/wemake-python-styleguide | train | 131 | c29eb9b59e13a92087d617f0cf5a642ebcbb2a3e | train | tests/test_visitors/test_ast/test_functions/test_boolean_args.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_functions/test_boolean_args.py | 82 | 4 | assert_* | test_wrong_boolean_argument | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
BooleanPositionalArgumentViolation,
)
from wemake_python_styleguide.visitors.ast.functions import (
WrongFunctionCallVisitor,
)
correct_argument = 'some(0, 1, keyword={0}, other={0})'
wrong_argument = 'some... | [ BooleanPositionalArgumentViolation, BooleanPositionalArgumentViolation, ]) | modified | 98d8a7da79fa5b7b6fc7464fb129ec8302ecaff74db75625fbd51d9fe4bc5181 | assert_*|test_wrong_boolean_argument|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( BooleanPositionalArgumentViolation, ) from wemake_python_styleguide.visitors.ast.functions import ( WrongFunctionCallVisitor, ) correct_argument = 'some(0, 1, keyword={0}, other={0... | [BooleanPositionalArgumentViolation]) | 82 | 4 |
wemake-services/wemake-python-styleguide | train | 132 | 76241125f43e16562c76a12dfd5a0f0449f60e98 | train | tests/test_visitors/test_ast/test_classes/test_base_classes/test_base_exception_base_class.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_base_classes/test_base_exception_base_class.py | 28 | 4 | assert_* | test_base_exception_subclass | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
BaseExceptionSubclassViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
class_with_base = 'class Meta({0}): ...'
@pytest.mark.parametrize('code', [
class_with_base,
]... | [BaseExceptionSubclassViolation]) | added | 5b9c88dde97060b5e4f3a57944ceac4a86d9044d92a21bd227ffefb1c1075d56 | assert_*|test_base_exception_subclass|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( BaseExceptionSubclassViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor class_with_base = 'class Meta({0}): ...' @pytest.mark.parametrize('co... | null | null | null |
wemake-services/wemake-python-styleguide | train | 133 | 9c59a5db55059220bf295abe400a6397c427e692 | 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 | 64 | 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}
"""
@pytest.mark.parame... | [RedundantComparisonViolation]) | modified | 2206abe30290eafd64f4c9b35235c483c8472372db6cee8e9fc14855af0d7b5d | 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} """ @pytest.... | [RedundantComparisonViolation]) | 63 | 4 |
wemake-services/wemake-python-styleguide | train | 133 | 9c59a5db55059220bf295abe400a6397c427e692 | 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 | 86 | 4 | assert_* | test_redundant_with_in | # -*- 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}
"""
@pytest.mark.parame... | [RedundantComparisonViolation]) | modified | d06596128e3da01c923cfabc40276f8d52e9a818584d08f0cc910888a796e9f9 | assert_*|test_redundant_with_in|# -*- 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} """ ... | [RedundantComparisonViolation]) | 85 | 4 |
wemake-services/wemake-python-styleguide | train | 133 | 9c59a5db55059220bf295abe400a6397c427e692 | 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 | 100 | 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}
"""
@pytest.mark.parame... | [RedundantComparisonViolation]) | modified | b2e0e8898dfaa16f4b7add9291e99f70399c54f21ea22c15d486264dfc46941f | 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} """ @... | [RedundantComparisonViolation]) | 99 | 4 |
wemake-services/wemake-python-styleguide | train | 133 | 9c59a5db55059220bf295abe400a6397c427e692 | train | tests/test_visitors/test_ast/test_comparisons/test_simplifiable_ifs.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_simplifiable_ifs.py | 54 | 4 | assert_* | test_simplifiable_exp | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
SimplifiableIfViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
WrongConditionalVisitor,
)
if_expression = '{0} if some() else {1}'
@pytest.mark.parametrize('comparators', [
... | [SimplifiableIfViolation]) | added | ba9d3f2a8021f7729cd7c799a696a6a1457806b59ff1ea23ceeb750dbd273e3d | assert_*|test_simplifiable_exp|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( SimplifiableIfViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( WrongConditionalVisitor, ) if_expression = '{0} if some() else {1}' @pytest.mark.parametrize('c... | null | null | null |
wemake-services/wemake-python-styleguide | train | 133 | 9c59a5db55059220bf295abe400a6397c427e692 | 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 | 73 | 4 | assert_* | test_single_argument_count_invalid | # -*- coding: utf-8 -*-
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
TooManyArgumentsViolation,
)
def test_correct_arguments_count(
assert_errors,
parse_ast_tree,
single_argument,
default_options,
mode,
):
"""Ensures that functions... | [TooManyArgumentsViolation]) | added | 399114ad369a517e9dfcdbb5f6f55423b77769239bc46fe5dbad77514eb9d45a | assert_*|test_single_argument_count_invalid|# -*- coding: utf-8 -*- from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, TooManyArgumentsViolation, ) def test_correct_arguments_count( assert_errors, parse_ast_tree, single_argument, default_options, mode, ): """Ensures that ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 133 | 9c59a5db55059220bf295abe400a6397c427e692 | 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 | 92 | 4 | assert_* | test_two_arguments_count_invalid | # -*- coding: utf-8 -*-
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
TooManyArgumentsViolation,
)
def test_correct_arguments_count(
assert_errors,
parse_ast_tree,
single_argument,
default_options,
mode,
):
"""Ensures that functions... | [TooManyArgumentsViolation]) | added | 51b13a5d6996d7471c2d1901dc9b55a2285cc8f773c8f03cc248ced035efba42 | assert_*|test_two_arguments_count_invalid|# -*- coding: utf-8 -*- from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, TooManyArgumentsViolation, ) def test_correct_arguments_count( assert_errors, parse_ast_tree, single_argument, default_options, mode, ): """Ensures that fu... | null | null | null |
wemake-services/wemake-python-styleguide | train | 134 | 4fcd3bd02a4375cede075732b8eab34b2dcf162d | 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 | 165 | 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 | 2d38f07c8d8811bf850418e2286c06442d135ff3c2ab2cae94949ecc2458bac4 | 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]) | 165 | 4 |
wemake-services/wemake-python-styleguide | train | 134 | 4fcd3bd02a4375cede075732b8eab34b2dcf162d | 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 | 166 | 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... | number.replace('-', '')) | modified | 7dda0d951e27dc8e22313b373c76f08d9c536a1dc74dce3c49ba963231d23a6a | 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... | str(abs(number))) | 166 | 4 |
wemake-services/wemake-python-styleguide | train | 134 | 4fcd3bd02a4375cede075732b8eab34b2dcf162d | train | tests/test_visitors/test_ast/test_builtins/test_set_elements.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_set_elements.py | 100 | 4 | assert_* | test_set_with_pure_duplicate | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
NonUniqueItemsInSetViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
WrongCollectionVisitor,
)
set_literal_template = '{{{0}, {1}}}'
@pytest.mark.parametrize('code', [
set_lite... | [NonUniqueItemsInSetViolation]) | added | 077d741a5775990f40c0e804cc75b2a4213fc9c06e1f373db122e517d13b4522 | assert_*|test_set_with_pure_duplicate|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( NonUniqueItemsInSetViolation, ) from wemake_python_styleguide.visitors.ast.builtins import ( WrongCollectionVisitor, ) set_literal_template = '{{{0}, {1}}}' @pytest.mark.parametri... | null | null | null |
wemake-services/wemake-python-styleguide | train | 134 | 4fcd3bd02a4375cede075732b8eab34b2dcf162d | train | tests/test_visitors/test_ast/test_builtins/test_set_elements.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_set_elements.py | 101 | 4 | assert_* | test_set_with_pure_duplicate | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
NonUniqueItemsInSetViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
WrongCollectionVisitor,
)
set_literal_template = '{{{0}, {1}}}'
@pytest.mark.parametrize('code', [
set_lite... | element) | added | faa356955ee294e9261102551db1e73f48333fa5318f55f62d2ea31a7c521d79 | assert_*|test_set_with_pure_duplicate|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( NonUniqueItemsInSetViolation, ) from wemake_python_styleguide.visitors.ast.builtins import ( WrongCollectionVisitor, ) set_literal_template = '{{{0}, {1}}}' @pytest.mark.parametri... | null | null | null |
wemake-services/wemake-python-styleguide | train | 134 | 4fcd3bd02a4375cede075732b8eab34b2dcf162d | 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 | 89 | 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 | 3fe62a51e06e3d4458f97eeac622d64ff0bc399e86ee3e1c2fc9aa5e0682ca4d | 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 | 134 | 4fcd3bd02a4375cede075732b8eab34b2dcf162d | train | tests/test_visitors/test_ast/test_comparisons/test_simplifiable_ifs/test_simplifiable_if_node.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_simplifiable_ifs/test_simplifiable_if_node.py | 112 | 4 | assert_* | test_simplifiable_node | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
SimplifiableIfViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
WrongConditionalVisitor,
)
# Correct:
simple_if_template = """
if some_value:
{0} = {1}
else:
{2} = {3}
""... | [SimplifiableIfViolation]) | added | 6f5c7d0104a7bfb075846bdd7ad94d63ac571eb11075f67d974c98592ace1e03 | assert_*|test_simplifiable_node|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( SimplifiableIfViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( WrongConditionalVisitor, ) # Correct: simple_if_template = """ if some_value: {0} = {1} else: ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 135 | 8c13ed824e13d1da33474fb77e4b9247f5574346 | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 158 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
It is used for e2e tests.
"""
from __future__ import print_function # noqa: Z422
import os.path # noqa: Z301
import sys as sys # noqa: Z113
from some import _protected # noqa: Z440
from .version import get_version # noqa: Z300
full_name... | octal_number | modified | a72d6f90ea71f75bcc8a34e9a54a0e8a021ecdddad04bdd89547753ca3a0dbe4 | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. It is used for e2e tests. """ from __future__ import print_function # noqa: Z422 import os.path # noqa: Z301 import sys as sys # noqa: Z113 from some import _protected # noqa: Z440 from .version import get_version # noqa: Z300 full_name = u... | octal_number | 158 | 0 | |
wemake-services/wemake-python-styleguide | train | 135 | 8c13ed824e13d1da33474fb77e4b9247f5574346 | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 168 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
It is used for e2e tests.
"""
from __future__ import print_function # noqa: Z422
import os.path # noqa: Z301
import sys as sys # noqa: Z113
from some import _protected # noqa: Z440
from .version import get_version # noqa: Z300
full_name... | hex_number | modified | 3a0db7b555d4074928bf8e9bc98c9b65200d9842ccfdd1736a81714aaab0577c | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. It is used for e2e tests. """ from __future__ import print_function # noqa: Z422 import os.path # noqa: Z301 import sys as sys # noqa: Z113 from some import _protected # noqa: Z440 from .version import get_version # noqa: Z300 full_name = u... | hex_number | 168 | 0 | |
wemake-services/wemake-python-styleguide | train | 135 | 8c13ed824e13d1da33474fb77e4b9247f5574346 | train | tests/test_visitors/test_ast/test_classes/test_base_classes/test_base_exception_base_class.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_base_classes/test_base_exception_base_class.py | 31 | 4 | assert_* | test_base_exception_subclass | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
BaseExceptionSubclassViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
class_with_base = """
class Meta({0}):
'''Docs.'''
"""
@pytest.mark.parametrize('code', [
... | [BaseExceptionSubclassViolation]) | modified | 4709b4400ce127c741e8cdc0a98513ffa6f81737949418f83f6f5b6fe2112206 | assert_*|test_base_exception_subclass|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( BaseExceptionSubclassViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor class_with_base = """ class Meta({0}): '''Docs.''' """ @pytest.mark.p... | [BaseExceptionSubclassViolation]) | 28 | 4 |
wemake-services/wemake-python-styleguide | train | 135 | 8c13ed824e13d1da33474fb77e4b9247f5574346 | train | tests/test_visitors/test_ast/test_classes/test_base_classes/test_object_base_class.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_base_classes/test_object_base_class.py | 65 | 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 Meta:
'''Docs.'''
"""
class_with_empty_base = """
class Meta():
... | [RequiredBaseClassViolation]) | added | 0b00747e3b199b1810cdd660c0a639c47c80b1347c39c8b8582f530d961c441e | 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 Meta: '''Docs.''' """ class_with_empty_base = """ cl... | null | null | null |
wemake-services/wemake-python-styleguide | train | 135 | 8c13ed824e13d1da33474fb77e4b9247f5574346 | train | tests/test_visitors/test_ast/test_classes/test_base_classes/test_object_base_class.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_base_classes/test_object_base_class.py | 66 | 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 Meta:
'''Docs.'''
"""
class_with_empty_base = """
class Meta():
... | 'Meta') | added | f16400022213b98a55d40199cb018342b3324e8d02841c3785323b8a90823341 | 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 Meta: '''Docs.''' """ class_with_empty_base = """ cl... | null | null | null |
wemake-services/wemake-python-styleguide | train | 135 | 8c13ed824e13d1da33474fb77e4b9247f5574346 | train | tests/test_visitors/test_ast/test_classes/test_object_as_parent.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_object_as_parent.py | 41 | 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):
'''Docs.'''
"""
single_ex... | [ObjectInBaseClassesListViolation]) | added | 3f225b54d731291343c45131c14145e85172f8cdc31cced19b387d90a202c2a8 | 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, Secon... | null | null | null |
wemake-services/wemake-python-styleguide | train | 135 | 8c13ed824e13d1da33474fb77e4b9247f5574346 | train | tests/test_visitors/test_ast/test_classes/test_wrong_class_body.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_wrong_class_body.py | 38 | 4 | assert_* | test_incorrect_body_items | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
IncorrectClassBodyContentViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
class_body_template = """
class ClassWithBody(object):
{0}
"""
@pytest.mark.parametrize('c... | [IncorrectClassBodyContentViolation]) | added | 1e37deed83e064715eb75f91d01e931cd6a74ee33e89ad55176f4f5aa72f47d9 | assert_*|test_incorrect_body_items|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( IncorrectClassBodyContentViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor class_body_template = """ class ClassWithBody(object): {0} """ @pyte... | null | null | null |
wemake-services/wemake-python-styleguide | train | 136 | 2acd895066b6f17666c29074668658e4166d6925 | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 158 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
It is used for e2e tests.
"""
from __future__ import print_function # noqa: Z422
import os.path # noqa: Z301
import sys as sys # noqa: Z113
from some import _protected # noqa: Z440
from .version import get_version # noqa: Z300
full_name... | octal_number | modified | fc815f1a6b09f7e74ae506f636dd7a327a0ecdfbdc6805929e8035f631955d3b | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. It is used for e2e tests. """ from __future__ import print_function # noqa: Z422 import os.path # noqa: Z301 import sys as sys # noqa: Z113 from some import _protected # noqa: Z440 from .version import get_version # noqa: Z300 full_name = u... | octal_number | 158 | 0 | |
wemake-services/wemake-python-styleguide | train | 136 | 2acd895066b6f17666c29074668658e4166d6925 | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 168 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
It is used for e2e tests.
"""
from __future__ import print_function # noqa: Z422
import os.path # noqa: Z301
import sys as sys # noqa: Z113
from some import _protected # noqa: Z440
from .version import get_version # noqa: Z300
full_name... | hex_number | modified | 3d86aec358505d256a9c7f6be5e8334b29514404f6a6f7139e3363701ba304ba | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. It is used for e2e tests. """ from __future__ import print_function # noqa: Z422 import os.path # noqa: Z301 import sys as sys # noqa: Z113 from some import _protected # noqa: Z440 from .version import get_version # noqa: Z300 full_name = u... | hex_number | 168 | 0 | |
wemake-services/wemake-python-styleguide | train | 136 | 2acd895066b6f17666c29074668658e4166d6925 | train | tests/test_visitors/test_ast/test_builtins/test_set_elements.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_builtins/test_set_elements.py | 105 | 4 | assert_* | test_set_with_pure_duplicate | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
NonUniqueItemsInSetViolation,
)
from wemake_python_styleguide.visitors.ast.builtins import (
WrongCollectionVisitor,
)
set_literal_template = '{{{0}, {1}}}'
@pytest.mark.parametrize('code', [
set_lite... | [NonUniqueItemsInSetViolation]) | added | b3b3381f18ae4ecc96943ed22be159ce5da0f9357ff123bd33566c31280ab65d | assert_*|test_set_with_pure_duplicate|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( NonUniqueItemsInSetViolation, ) from wemake_python_styleguide.visitors.ast.builtins import ( WrongCollectionVisitor, ) set_literal_template = '{{{0}, {1}}}' @pytest.mark.parametri... | null | null | null |
wemake-services/wemake-python-styleguide | train | 136 | 2acd895066b6f17666c29074668658e4166d6925 | train | tests/test_visitors/test_ast/test_classes/test_magic_methods.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_magic_methods.py | 35 | 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... | method) | modified | cdd2f5cd5a416345f5f8ffa5a70f5b22058fb51f13e78cd1e6efb6463ad78970 | 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... | method) | 33 | 4 |
wemake-services/wemake-python-styleguide | train | 136 | 2acd895066b6f17666c29074668658e4166d6925 | train | tests/test_visitors/test_ast/test_classes/test_method_without_arguments.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_method_without_arguments.py | 31 | 4 | assert_* | test_method_without_arguments | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
MethodWithoutArgumentsViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
method_inside_class = """
class Example(object):
def some_name({0}): ...
"""
regular_function ... | [MethodWithoutArgumentsViolation]) | added | 5bd79fd6338fe2e6d21061090ed9bcd83376e0d6415c73d823b9b09a965527a6 | assert_*|test_method_without_arguments|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( MethodWithoutArgumentsViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor method_inside_class = """ class Example(object): def some_name({0})... | null | null | null |
wemake-services/wemake-python-styleguide | train | 136 | 2acd895066b6f17666c29074668658e4166d6925 | train | tests/test_visitors/test_ast/test_classes/test_method_without_arguments.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_method_without_arguments.py | 32 | 4 | assert_* | test_method_without_arguments | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
MethodWithoutArgumentsViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
method_inside_class = """
class Example(object):
def some_name({0}): ...
"""
regular_function ... | 'some_name') | added | f27b61d255f7994c30e9465957b6bf589962595e82ea6ca4817b4023afb74274 | assert_*|test_method_without_arguments|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( MethodWithoutArgumentsViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor method_inside_class = """ class Example(object): def some_name({0})... | null | null | null |
wemake-services/wemake-python-styleguide | train | 136 | 2acd895066b6f17666c29074668658e4166d6925 | train | tests/test_visitors/test_ast/test_classes/test_staticmethod.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_staticmethod.py | 29 | 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(arg1): ...
"""
def test_staticme... | [StaticMethodViolation]) | modified | edb81122db202f2153615a217f161fc5621bcbcda4f7a50243729d847f112313 | 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(arg1): ... """ de... | [StaticMethodViolation]) | 29 | 4 |
wemake-services/wemake-python-styleguide | train | 136 | 2acd895066b6f17666c29074668658e4166d6925 | 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 | 91 | 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]) | modified | ba8d3e12f3f8c07a567c199372affadbc3e01442cb25d047e3da1193c739c1cb | 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... | [WrongConditionalViolation]) | 89 | 4 |
wemake-services/wemake-python-styleguide | train | 137 | 3a43cdcf4b6d15c2361b081fefca7802580f64da | train | tests/test_visitors/test_ast/test_classes/test_base_classes/test_expression_base_class.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_base_classes/test_expression_base_class.py | 39 | 4 | assert_* | test_base_class_expression | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
IncorrectBaseClassViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
class_with_base = """
class Meta({0}):
'''Docs.'''
"""
@pytest.mark.parametrize('code', [
cla... | [IncorrectBaseClassViolation]) | added | 9c2b0d35b23e4cc71804a17922edcf01ab72f8048e506e73b8da66942bded406 | assert_*|test_base_class_expression|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( IncorrectBaseClassViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor class_with_base = """ class Meta({0}): '''Docs.''' """ @pytest.mark.parame... | null | null | null |
wemake-services/wemake-python-styleguide | train | 138 | 1ca9f21cc2a37f048e4f4172d4b373431ed199b3 | train | tests/test_visitors/test_ast/test_classes/test_class_attributes/test_slots_syntax.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_class_attributes/test_slots_syntax.py | 36 | 4 | assert_* | test_incorrect_slots | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
IncorrectSlotsViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongSlotsVisitor
class_body_template = """
class ClassWithSlots(object):
__slots__ = {0}
"""
@pytest.mark.parametrize(... | [IncorrectSlotsViolation]) | added | 61166754dee5491c571ddd9892fd67968583834b24c907aa37ca7cd089b7158b | assert_*|test_incorrect_slots|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( IncorrectSlotsViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongSlotsVisitor class_body_template = """ class ClassWithSlots(object): __slots__ = {0} """ @pytest.... | null | null | null |
wemake-services/wemake-python-styleguide | train | 138 | 1ca9f21cc2a37f048e4f4172d4b373431ed199b3 | train | tests/test_visitors/test_ast/test_classes/test_methods/test_magic_methods.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_methods/test_magic_methods.py | 34 | 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 WrongMethodVisitor
magic_method = """
class Example(ob... | [BadMagicMethodViolation]) | modified | 8f5e2eb108f4a765c8258457bf96f3407498f070dbdf2436372accf882da1c8d | 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 WrongMethodVisitor magic_metho... | [BadMagicMethodViolation]) | 34 | 4 |
wemake-services/wemake-python-styleguide | train | 138 | 1ca9f21cc2a37f048e4f4172d4b373431ed199b3 | train | tests/test_visitors/test_ast/test_classes/test_methods/test_magic_methods.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_methods/test_magic_methods.py | 35 | 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 WrongMethodVisitor
magic_method = """
class Example(ob... | method) | modified | fc03f4388e93173f1690f6b52271f62863ff422f150d77e01e6770837fd9eca0 | 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 WrongMethodVisitor magic_metho... | method) | 35 | 4 |
wemake-services/wemake-python-styleguide | train | 138 | 1ca9f21cc2a37f048e4f4172d4b373431ed199b3 | train | tests/test_visitors/test_ast/test_classes/test_methods/test_method_without_arguments.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_methods/test_method_without_arguments.py | 31 | 4 | assert_* | test_method_without_arguments | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
MethodWithoutArgumentsViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongMethodVisitor
method_inside_class = """
class Example(object):
def some_name({0}): ...
"""
regular_function... | [MethodWithoutArgumentsViolation]) | modified | 2429b015a5a105b9ea7dd30ce7f8a4e7087a048ee8e8e6e8f70593dc43f41a8b | assert_*|test_method_without_arguments|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( MethodWithoutArgumentsViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongMethodVisitor method_inside_class = """ class Example(object): def some_name({0}... | [MethodWithoutArgumentsViolation]) | 31 | 4 |
wemake-services/wemake-python-styleguide | train | 138 | 1ca9f21cc2a37f048e4f4172d4b373431ed199b3 | train | tests/test_visitors/test_ast/test_classes/test_methods/test_method_without_arguments.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_methods/test_method_without_arguments.py | 32 | 4 | assert_* | test_method_without_arguments | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
MethodWithoutArgumentsViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongMethodVisitor
method_inside_class = """
class Example(object):
def some_name({0}): ...
"""
regular_function... | 'some_name') | modified | c870e8f2cd14054c54ca11bcda256b884dcf21352abe1ae08e2b4ed2bdf1c287 | assert_*|test_method_without_arguments|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( MethodWithoutArgumentsViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongMethodVisitor method_inside_class = """ class Example(object): def some_name({0}... | 'some_name') | 32 | 4 |
wemake-services/wemake-python-styleguide | train | 138 | 1ca9f21cc2a37f048e4f4172d4b373431ed199b3 | train | tests/test_visitors/test_ast/test_classes/test_methods/test_staticmethod.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_methods/test_staticmethod.py | 29 | 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 WrongMethodVisitor
decorated_method = """
class Example(object):
@{0}
def should_fail(arg1): ...
"""
def test_staticm... | [StaticMethodViolation]) | modified | 29866ed22763986fd679ee7d3f4b58c0c6aae1409b2a7170b992ceffb858d1aa | 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 WrongMethodVisitor decorated_method = """ class Example(object): @{0} def should_fail(arg1): ... """ d... | [StaticMethodViolation]) | 29 | 4 |
wemake-services/wemake-python-styleguide | train | 138 | 1ca9f21cc2a37f048e4f4172d4b373431ed199b3 | train | tests/test_visitors/test_ast/test_classes/test_methods/test_yield_inside_init.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_methods/test_yield_inside_init.py | 47 | 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 WrongMethodVisitor
init_without_yield = """
class ModuleMembersVisitor(object):
def __init__(self, *args, **kwargs):
... | [YieldInsideInitViolation]) | modified | b160620ae373f5e8bde5b33eb6312f9cc2c06720088ec2f784eedb44af57d0b3 | 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 WrongMethodVisitor init_without_yield = """ class ModuleMembersVisitor(object): def __init__(self, *ar... | [YieldInsideInitViolation]) | 47 | 4 |
wemake-services/wemake-python-styleguide | train | 139 | 2f5aba21bdb6258c84304586f3e4c25e3f8de278 | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 159 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
It is used for e2e tests.
"""
from __future__ import print_function # noqa: Z422
import os.path # noqa: Z301
import sys as sys # noqa: Z113
from some import _protected # noqa: Z440
from .version import get_version # noqa: Z300
full_name... | octal_number | modified | 6f7295c777edc49200b6745465feda155287439fc037c55daacd1f8de4120bb3 | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. It is used for e2e tests. """ from __future__ import print_function # noqa: Z422 import os.path # noqa: Z301 import sys as sys # noqa: Z113 from some import _protected # noqa: Z440 from .version import get_version # noqa: Z300 full_name = u... | octal_number | 158 | 0 | |
wemake-services/wemake-python-styleguide | train | 139 | 2f5aba21bdb6258c84304586f3e4c25e3f8de278 | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 169 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
It is used for e2e tests.
"""
from __future__ import print_function # noqa: Z422
import os.path # noqa: Z301
import sys as sys # noqa: Z113
from some import _protected # noqa: Z440
from .version import get_version # noqa: Z300
full_name... | hex_number | modified | 2a39920189ec7df448d00b71a456a2836c3461254e33d554cc7234b61b2858d3 | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. It is used for e2e tests. """ from __future__ import print_function # noqa: Z422 import os.path # noqa: Z301 import sys as sys # noqa: Z113 from some import _protected # noqa: Z440 from .version import get_version # noqa: Z300 full_name = u... | hex_number | 168 | 0 | |
wemake-services/wemake-python-styleguide | train | 139 | 2f5aba21bdb6258c84304586f3e4c25e3f8de278 | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_trailing_underscore.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_trailing_underscore.py | 26 | 4 | assert_* | test_wrong_trailing_underscore | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
TrailingUnderscoreViolation,
)
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
def test_wrong_trailing_underscore(
assert_errors,
assert_error_text,
parse_ast_tree,
naming_tem... | [TrailingUnderscoreViolation]) | added | 5436a9cbb8c2e8fd1b1db8b3639ab51f4900a892b7bc37b3366213e9709b1c88 | assert_*|test_wrong_trailing_underscore|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( TrailingUnderscoreViolation, ) from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor def test_wrong_trailing_underscore( assert_errors, assert_error_text, parse_ast_... | null | null | null |
wemake-services/wemake-python-styleguide | train | 139 | 2f5aba21bdb6258c84304586f3e4c25e3f8de278 | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_trailing_underscore.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_trailing_underscore.py | 27 | 4 | assert_* | test_wrong_trailing_underscore | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
TrailingUnderscoreViolation,
)
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
def test_wrong_trailing_underscore(
assert_errors,
assert_error_text,
parse_ast_tree,
naming_tem... | wrong_name) | added | 7ce95fb092f7819a71958369d6123e574bca060c6d1a4c41e93940c13e9a9dc0 | assert_*|test_wrong_trailing_underscore|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( TrailingUnderscoreViolation, ) from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor def test_wrong_trailing_underscore( assert_errors, assert_error_text, parse_ast_... | null | null | null |
wemake-services/wemake-python-styleguide | train | 140 | 5005d6fc8e6dcddde245e0a14800278fd2acc8f8 | 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 | 166 | 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 | f5cec744d81af27097ae706bf014cf3ac027d5d9872581f41292ff5ad4ec5ac2 | 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]) | 165 | 4 |
wemake-services/wemake-python-styleguide | train | 140 | 5005d6fc8e6dcddde245e0a14800278fd2acc8f8 | 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... | number.replace('-', '')) | modified | 0000b7988338e05c4535350abe700435e3499c6cfd51351fd5bc24fc93339d05 | 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... | number.replace('-', '')) | 166 | 4 |
wemake-services/wemake-python-styleguide | train | 141 | 2cb76c24c9cff4748cf11ca339106492e6746383 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 20 | 8 | assert | # -*- coding: utf-8 -*-
import re
import subprocess
from collections import Counter
ERROR_PATTERN = re.compile(r'(Z\d{3})')
IGNORED_VIOLATIONS = [
'Z202', # since our test case is complex, that's fine
]
def _assert_errors_count_in_output(output, errors, all_violations):
found_errors = Counter((
mat... | errors | modified | 44e4b309be0de24f7a4776b47b9e50283abe275fe48e2d30c52e4b9dfd01d1fb | assert||# -*- coding: utf-8 -*- import re import subprocess from collections import Counter ERROR_PATTERN = re.compile(r'(Z\d{3})') IGNORED_VIOLATIONS = [ 'Z202', # since our test case is complex, that's fine ] def _assert_errors_count_in_output(output, errors, all_violations): found_errors = Counter(( match.group(0) f... | errors | 17 | 8 | |
wemake-services/wemake-python-styleguide | train | 141 | 2cb76c24c9cff4748cf11ca339106492e6746383 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 23 | 8 | assert | # -*- coding: utf-8 -*-
import re
import subprocess
from collections import Counter
ERROR_PATTERN = re.compile(r'(Z\d{3})')
IGNORED_VIOLATIONS = [
'Z202', # since our test case is complex, that's fine
]
def _assert_errors_count_in_output(output, errors, all_violations):
found_errors = Counter((
mat... | errors | modified | 53d6339096089cb8be3cf5eed1f5fca112ab0d9afe258cd7b0337cd51162cbcc | assert||# -*- coding: utf-8 -*- import re import subprocess from collections import Counter ERROR_PATTERN = re.compile(r'(Z\d{3})') IGNORED_VIOLATIONS = [ 'Z202', # since our test case is complex, that's fine ] def _assert_errors_count_in_output(output, errors, all_violations): found_errors = Counter(( match.group(0) f... | errors | 20 | 8 | |
wemake-services/wemake-python-styleguide | train | 141 | 2cb76c24c9cff4748cf11ca339106492e6746383 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 24 | 8 | assert | # -*- coding: utf-8 -*-
import re
import subprocess
from collections import Counter
ERROR_PATTERN = re.compile(r'(Z\d{3})')
IGNORED_VIOLATIONS = [
'Z202', # since our test case is complex, that's fine
]
def _assert_errors_count_in_output(output, errors, all_violations):
found_errors = Counter((
mat... | errors.pop(found_error) | modified | e9d0f2944b496c54a49ee32af58d916b72d638183d52a4870c8264525c977675 | assert||# -*- coding: utf-8 -*- import re import subprocess from collections import Counter ERROR_PATTERN = re.compile(r'(Z\d{3})') IGNORED_VIOLATIONS = [ 'Z202', # since our test case is complex, that's fine ] def _assert_errors_count_in_output(output, errors, all_violations): found_errors = Counter(( match.group(0) f... | errors.pop(found_error) | 21 | 8 | |
wemake-services/wemake-python-styleguide | train | 141 | 2cb76c24c9cff4748cf11ca339106492e6746383 | train | tests/test_visitors/test_ast/test_functions/test_super_call.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_functions/test_super_call.py | 80 | 4 | assert_* | test_wrong_super_call | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
IncorrectSuperCallViolation,
)
from wemake_python_styleguide.visitors.ast.functions import (
WrongFunctionCallVisitor,
)
# Correct:
correct_super_call = """
class Example(object):
def some_method(self,... | [IncorrectSuperCallViolation]) | added | e02e58f520f45df8e09f88fc1ed5ebfd02ec17dc15b1f7dbd59202a098ff0191 | assert_*|test_wrong_super_call|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( IncorrectSuperCallViolation, ) from wemake_python_styleguide.visitors.ast.functions import ( WrongFunctionCallVisitor, ) # Correct: correct_super_call = """ class Example(object): def so... | null | null | null |
wemake-services/wemake-python-styleguide | train | 141 | 2cb76c24c9cff4748cf11ca339106492e6746383 | train | tests/test_visitors/test_ast/test_functions/test_super_call.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_functions/test_super_call.py | 100 | 4 | assert_* | test_double_wrong_super_call | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
IncorrectSuperCallViolation,
)
from wemake_python_styleguide.visitors.ast.functions import (
WrongFunctionCallVisitor,
)
# Correct:
correct_super_call = """
class Example(object):
def some_method(self,... | [ IncorrectSuperCallViolation, IncorrectSuperCallViolation, ]) | added | 55f7453df9d01c4a953eec26d58bf96fe61e154833e2e4e1b835be21b5d358ad | assert_*|test_double_wrong_super_call|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( IncorrectSuperCallViolation, ) from wemake_python_styleguide.visitors.ast.functions import ( WrongFunctionCallVisitor, ) # Correct: correct_super_call = """ class Example(object):... | null | null | null |
wemake-services/wemake-python-styleguide | train | 142 | 0d0dcbd97aed94951b08bec20f10389f864d16ed | 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 | 168 | 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 | c0cece485a475d93444ff4853736dfb1d7ae400aa6e7d644b0e0b6bf2a93fceb | 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]) | 166 | 4 |
wemake-services/wemake-python-styleguide | train | 142 | 0d0dcbd97aed94951b08bec20f10389f864d16ed | 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 | 169 | 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... | number.replace('-', '')) | modified | f5fd022036d0fd591060a7621c31219a8172947db6f4b34000d857c44beee46c | 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... | number.replace('-', '')) | 167 | 4 |
wemake-services/wemake-python-styleguide | train | 142 | 0d0dcbd97aed94951b08bec20f10389f864d16ed | 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 | 203 | 4 | assert_* | test_magic_number_octal_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]) | added | 2167e7afc8e2c78de2e26fcc6b66fc88ef2aad02b03e52ef42c893ba1104413b | assert_*|test_magic_number_octal_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 # C... | null | null | null |
wemake-services/wemake-python-styleguide | train | 143 | 5f6d369953384fef57512c0be293581b744b7f6d | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 170 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
It is used for e2e tests.
"""
from __future__ import print_function # noqa: Z422
import os.path # noqa: Z301
import sys as sys # noqa: Z113
from some import _protected # noqa: Z440
from .version import get_version # noqa: Z300
full_name... | octal_number | modified | 507da2cb33e7c4599c768c688de6892a2b23e56da7ce8ea82f0edbd347087a1f | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. It is used for e2e tests. """ from __future__ import print_function # noqa: Z422 import os.path # noqa: Z301 import sys as sys # noqa: Z113 from some import _protected # noqa: Z440 from .version import get_version # noqa: Z300 full_name = u... | hex_number | 169 | 0 | |
wemake-services/wemake-python-styleguide | train | 143 | 5f6d369953384fef57512c0be293581b744b7f6d | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 180 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
It is used for e2e tests.
"""
from __future__ import print_function # noqa: Z422
import os.path # noqa: Z301
import sys as sys # noqa: Z113
from some import _protected # noqa: Z440
from .version import get_version # noqa: Z300
full_name... | hex_number | added | 3ef17fd2690791dc4217b5ea6485a65daa5ea966c12bc76e0df2ceb05459e556 | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. It is used for e2e tests. """ from __future__ import print_function # noqa: Z422 import os.path # noqa: Z301 import sys as sys # noqa: Z113 from some import _protected # noqa: Z440 from .version import get_version # noqa: Z300 full_name = u... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 143 | 5f6d369953384fef57512c0be293581b744b7f6d | train | tests/test_visitors/test_ast/test_complexity/test_counts/test_try_except.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_counts/test_try_except.py | 35 | 4 | assert_* | test_try_except_count_default | # -*- coding: utf-8 -*-
from wemake_python_styleguide.violations.complexity import (
TooManyExceptCasesViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.counts import (
TryExceptVisitor,
)
complex_try_except = """
try:
do_some_bad_things()
except ValueError:
print('value')
except KeyE... | [TooManyExceptCasesViolation]) | added | ed968e7e8a1218508cb3897959ba478083a8b9b238c4a4ecbe86f2da4847e86c | assert_*|test_try_except_count_default|# -*- coding: utf-8 -*- from wemake_python_styleguide.violations.complexity import ( TooManyExceptCasesViolation, ) from wemake_python_styleguide.visitors.ast.complexity.counts import ( TryExceptVisitor, ) complex_try_except = """ try: do_some_bad_things() except ValueError: print... | null | null | null |
wemake-services/wemake-python-styleguide | train | 144 | 9bfa92eaf4dd61ab6b5eae43aaedf7eb0af3af10 | train | tests/test_regressions/test_regression112.py | train | wemake-services/wemake-python-styleguide:tests/test_regressions/test_regression112.py | 51 | 4 | assert | test_regression112 | # -*- coding: utf-8 -*-
import ast
from pyflakes.checker import Checker as PyFlakesChecker
from wemake_python_styleguide.checker import Checker
code_that_brakes = '''
def current_session(
telegram_id: int,
for_update: bool = True,
) -> TelegramSession:
"""
Was triggering `AttributeError`.
See: ... | flakes.root | modified | 7eff4ffe7f29529473cd031decb6a35d7e99875b1f474b1a7e638fcbdc2f03b5 | assert|test_regression112|# -*- coding: utf-8 -*- import ast from pyflakes.checker import Checker as PyFlakesChecker from wemake_python_styleguide.checker import Checker code_that_brakes = ''' def current_session( telegram_id: int, for_update: bool = True, ) -> TelegramSession: """ Was triggering `AttributeError`. See:... | flakes.root | 52 | 4 |
wemake-services/wemake-python-styleguide | train | 145 | 0a4ed8092cbcd37a9c963352f76e2b0d19913243 | 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 | 46 | 4 | assert_* | test_upper_case_class_attributes | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
UpperCaseAttributeViolation,
)
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
static_attribute = """
class Test(object):
{0} = None
"""
regression423 = """
class MyClass(object):
def... | [UpperCaseAttributeViolation]) | added | 25144260d07ee008dc1957681bbdd7fa484a30a14b0bbe4ef1b5224cd37ea941 | assert_*|test_upper_case_class_attributes|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( UpperCaseAttributeViolation, ) from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor static_attribute = """ class Test(object): {0} = None """ regression423 = """ ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 145 | 0a4ed8092cbcd37a9c963352f76e2b0d19913243 | 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 | 47 | 4 | assert_* | test_upper_case_class_attributes | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
UpperCaseAttributeViolation,
)
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
static_attribute = """
class Test(object):
{0} = None
"""
regression423 = """
class MyClass(object):
def... | non_snake_case_name) | added | 2cb79242918274ed801cc8234da4f71358d252cc4d5f1f5b4db0141501001fc8 | assert_*|test_upper_case_class_attributes|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( UpperCaseAttributeViolation, ) from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor static_attribute = """ class Test(object): {0} = None """ regression423 = """ ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 146 | bb7df2abdaaea6b2143712791060bd1cfdce9580 | train | tests/test_visitors/test_ast/test_complexity/test_counts/test_try_except.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_counts/test_try_except.py | 60 | 4 | assert_* | test_try_except_count_default | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyExceptCasesViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.counts import (
TryExceptVisitor,
)
try_without_except = """
try:
...
finally:
...
"""
simple_try_except = """
try:
... | [TooManyExceptCasesViolation]) | added | 72f94efbaf058b7250440f0cd91ab847a1b3c2b2e4eae1a3c46d806af4321eaa | assert_*|test_try_except_count_default|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( TooManyExceptCasesViolation, ) from wemake_python_styleguide.visitors.ast.complexity.counts import ( TryExceptVisitor, ) try_without_except = """ try: ... finally: ... """ simple_try... | null | null | null |
wemake-services/wemake-python-styleguide | train | 147 | 005bfc89dbecc6774fd71cca05ec96d88b8407b4 | train | tests/test_visitors/test_tokenize/test_comments/test_empty_line_after_coding.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_comments/test_empty_line_after_coding.py | 81 | 4 | assert_* | test_incorrect_coding_comment | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
EmptyLineAfterCodingViolation,
)
from wemake_python_styleguide.visitors.tokenize.comments import (
FileMagicCommentsVisitor,
)
# Correct:
empty_module = ''
empty_module_with_coding = """# -*- coding: utf-8 -*... | [EmptyLineAfterCodingViolation]) | added | 679a4092456e12e977545b32d15f211692be851da833cd8c79529cb478b07300 | assert_*|test_incorrect_coding_comment|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( EmptyLineAfterCodingViolation, ) from wemake_python_styleguide.visitors.tokenize.comments import ( FileMagicCommentsVisitor, ) # Correct: empty_module = '' empty_module_with_coding ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 148 | 0c55d5215d79b53fa093493efc7ede017a5ae2a5 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 21 | 8 | assert | # -*- coding: utf-8 -*-
import re
import subprocess
from collections import Counter
ERROR_PATTERN = re.compile(r'(Z\d{3})')
IGNORED_VIOLATIONS = [
'Z202', # since our test case is complex, that's fine
'Z402', # since we obviously use a lot of `noqa` comments
]
def _assert_errors_count_in_output(output, er... | errors | modified | 393620d9d6086e703a0055b7424f3a4a8aec14d073b4b24a20a5ebfac9dd706d | assert||# -*- coding: utf-8 -*- import re import subprocess from collections import Counter ERROR_PATTERN = re.compile(r'(Z\d{3})') IGNORED_VIOLATIONS = [ 'Z202', # since our test case is complex, that's fine 'Z402', # since we obviously use a lot of `noqa` comments ] def _assert_errors_count_in_output(output, errors, ... | errors | 20 | 8 | |
wemake-services/wemake-python-styleguide | train | 148 | 0c55d5215d79b53fa093493efc7ede017a5ae2a5 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 24 | 8 | assert | # -*- coding: utf-8 -*-
import re
import subprocess
from collections import Counter
ERROR_PATTERN = re.compile(r'(Z\d{3})')
IGNORED_VIOLATIONS = [
'Z202', # since our test case is complex, that's fine
'Z402', # since we obviously use a lot of `noqa` comments
]
def _assert_errors_count_in_output(output, er... | errors | modified | 377dae5c9e5407ccc41e3fd0b559c78a2f86baac56d50c9a32a9eba07c8774e7 | assert||# -*- coding: utf-8 -*- import re import subprocess from collections import Counter ERROR_PATTERN = re.compile(r'(Z\d{3})') IGNORED_VIOLATIONS = [ 'Z202', # since our test case is complex, that's fine 'Z402', # since we obviously use a lot of `noqa` comments ] def _assert_errors_count_in_output(output, errors, ... | errors | 23 | 8 | |
wemake-services/wemake-python-styleguide | train | 148 | 0c55d5215d79b53fa093493efc7ede017a5ae2a5 | train | tests/test_checker/test_noqa.py | test | wemake-services/wemake-python-styleguide:tests/test_checker/test_noqa.py | 25 | 8 | assert | # -*- coding: utf-8 -*-
import re
import subprocess
from collections import Counter
ERROR_PATTERN = re.compile(r'(Z\d{3})')
IGNORED_VIOLATIONS = [
'Z202', # since our test case is complex, that's fine
'Z402', # since we obviously use a lot of `noqa` comments
]
def _assert_errors_count_in_output(output, er... | errors.pop(found_error) | modified | a2398913d2fe75989b7b190e11f08820eba161039330574c75373603e692a9a0 | assert||# -*- coding: utf-8 -*- import re import subprocess from collections import Counter ERROR_PATTERN = re.compile(r'(Z\d{3})') IGNORED_VIOLATIONS = [ 'Z202', # since our test case is complex, that's fine 'Z402', # since we obviously use a lot of `noqa` comments ] def _assert_errors_count_in_output(output, errors, ... | errors.pop(found_error) | 24 | 8 | |
wemake-services/wemake-python-styleguide | train | 148 | 0c55d5215d79b53fa093493efc7ede017a5ae2a5 | train | tests/test_visitors/test_tokenize/test_comments/test_noqa_count.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_comments/test_noqa_count.py | 33 | 4 | assert_* | test_noqa_overuse | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
OveruseOfNoqaCommentViolation,
)
from wemake_python_styleguide.visitors.tokenize.comments import (
WrongCommentVisitor,
)
@pytest.mark.parametrize('code', [
'wallet = 10 # noqa: Z002,Z114',
'walle... | [OveruseOfNoqaCommentViolation]) | added | d183be561c67539cd29a371611b19710510989bdf9095917bda9e80603205cff | assert_*|test_noqa_overuse|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( OveruseOfNoqaCommentViolation, ) from wemake_python_styleguide.visitors.tokenize.comments import ( WrongCommentVisitor, ) @pytest.mark.parametrize('code', [ 'wallet = 10 # noqa: Z002,Z114', ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 149 | 21a08b546468a53d6b198e6b57abdb1cdd7b1c30 | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 174 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
It is used for e2e tests.
"""
from __future__ import print_function # noqa: Z422
import os.path # noqa: Z301
import sys as sys # noqa: Z113
from some import _protected # noqa: Z440
from .version import get_version # noqa: Z300
full_name... | octal_number | added | 4990e8e6e2c0d626c798efc85aa53455c0624923a334e8d58d56bb82ccaa1cd2 | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. It is used for e2e tests. """ from __future__ import print_function # noqa: Z422 import os.path # noqa: Z301 import sys as sys # noqa: Z113 from some import _protected # noqa: Z440 from .version import get_version # noqa: Z300 full_name = u... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 149 | 21a08b546468a53d6b198e6b57abdb1cdd7b1c30 | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 184 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
It is used for e2e tests.
"""
from __future__ import print_function # noqa: Z422
import os.path # noqa: Z301
import sys as sys # noqa: Z113
from some import _protected # noqa: Z440
from .version import get_version # noqa: Z300
full_name... | hex_number | added | 4c3948c573da8ae8e721165e80f9ae7552a0373c9615f94dd15ec7ceba6f5c47 | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. It is used for e2e tests. """ from __future__ import print_function # noqa: Z422 import os.path # noqa: Z301 import sys as sys # noqa: Z113 from some import _protected # noqa: Z440 from .version import get_version # noqa: Z300 full_name = u... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 149 | 21a08b546468a53d6b198e6b57abdb1cdd7b1c30 | train | tests/test_checker/test_module_names.py | train | wemake-services/wemake-python-styleguide:tests/test_checker/test_module_names.py | 31 | 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 | 0611c5d7be03fef6a99d475728e04f5e691c733a01d71aa53d722786c65c48f4 | 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 | 33 | 4 |
wemake-services/wemake-python-styleguide | train | 149 | 21a08b546468a53d6b198e6b57abdb1cdd7b1c30 | train | tests/test_visitors/test_ast/test_functions/test_unused_variables.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_functions/test_unused_variables.py | 125 | 4 | assert_* | test_wrong_super_call | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
UnusedVariableIsUsedViolation,
)
from wemake_python_styleguide.visitors.ast.functions import (
FunctionDefinitionVisitor,
)
# Correct:
correct_module = """
_PROTECTED = 1
PUBLIC = _PROTECTED + 1
"""
correct_class... | [UnusedVariableIsUsedViolation]) | added | 8acb1ebf6591fcfc2765b7337e8726c471cf75b2abd608a03ddc077816df6262 | assert_*|test_wrong_super_call|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( UnusedVariableIsUsedViolation, ) from wemake_python_styleguide.visitors.ast.functions import ( FunctionDefinitionVisitor, ) # Correct: correct_module = """ _PROTECTED = 1 PUBLIC = _PROTECTED + 1... | null | null | null |
wemake-services/wemake-python-styleguide | train | 149 | 21a08b546468a53d6b198e6b57abdb1cdd7b1c30 | train | tests/test_visitors/test_ast/test_functions/test_unused_variables.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_functions/test_unused_variables.py | 145 | 4 | assert_* | test_double_wrong_variables | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
UnusedVariableIsUsedViolation,
)
from wemake_python_styleguide.visitors.ast.functions import (
FunctionDefinitionVisitor,
)
# Correct:
correct_module = """
_PROTECTED = 1
PUBLIC = _PROTECTED + 1
"""
correct_class... | [ UnusedVariableIsUsedViolation, UnusedVariableIsUsedViolation, ]) | added | bce7327f8bf3ef4967748352c58d7f34cc8f6fb04b755da5a07219929336176f | assert_*|test_double_wrong_variables|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( UnusedVariableIsUsedViolation, ) from wemake_python_styleguide.visitors.ast.functions import ( FunctionDefinitionVisitor, ) # Correct: correct_module = """ _PROTECTED = 1 PUBLIC = _PROTECT... | null | null | null |
wemake-services/wemake-python-styleguide | train | 150 | 5686c25eb65bcfb3880a41dca3fdaf2ed7579fc5 | train | tests/test_visitors/test_ast/test_conditions/test_redundant_returnin_else.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_conditions/test_redundant_returnin_else.py | 61 | 4 | assert_* | test_else_that_can_be_removed_in_function | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
RedundantReturningElseViolation,
)
from wemake_python_styleguide.visitors.ast.conditions import IfStatementVisitor
function_level_condition = """
def function():
if some_condition:
{0}
else:
... | [RedundantReturningElseViolation]) | added | 2ed83f3c4eea1496862166f84812bdd3f1c6fd40f4da1ab2afe5c6b140aa88b3 | assert_*|test_else_that_can_be_removed_in_function|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( RedundantReturningElseViolation, ) from wemake_python_styleguide.visitors.ast.conditions import IfStatementVisitor function_level_condition = """ def function(): if s... | null | null | null |
wemake-services/wemake-python-styleguide | train | 150 | 5686c25eb65bcfb3880a41dca3fdaf2ed7579fc5 | train | tests/test_visitors/test_ast/test_conditions/test_redundant_returnin_else.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_conditions/test_redundant_returnin_else.py | 86 | 4 | assert_* | test_else_that_can_be_removed_in_loop | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
RedundantReturningElseViolation,
)
from wemake_python_styleguide.visitors.ast.conditions import IfStatementVisitor
function_level_condition = """
def function():
if some_condition:
{0}
else:
... | [RedundantReturningElseViolation]) | added | 7669e75854a0ec15b4b6aa1ca277f8985e84cf9ad9548e52992fe80e219e2a93 | assert_*|test_else_that_can_be_removed_in_loop|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( RedundantReturningElseViolation, ) from wemake_python_styleguide.visitors.ast.conditions import IfStatementVisitor function_level_condition = """ def function(): if some_... | null | null | null |
wemake-services/wemake-python-styleguide | train | 150 | 5686c25eb65bcfb3880a41dca3fdaf2ed7579fc5 | train | tests/test_visitors/test_ast/test_conditions/test_redundant_returnin_else.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_conditions/test_redundant_returnin_else.py | 104 | 4 | assert_* | test_else_that_can_be_removed_in_module | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
RedundantReturningElseViolation,
)
from wemake_python_styleguide.visitors.ast.conditions import IfStatementVisitor
function_level_condition = """
def function():
if some_condition:
{0}
else:
... | [RedundantReturningElseViolation]) | added | 2e7c77ac708846141b4575b2eb72c25d80f8dba4d2976b479f4f695a8cf9f16b | assert_*|test_else_that_can_be_removed_in_module|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( RedundantReturningElseViolation, ) from wemake_python_styleguide.visitors.ast.conditions import IfStatementVisitor function_level_condition = """ def function(): if som... | null | null | null |
wemake-services/wemake-python-styleguide | train | 151 | b31fe0ff3bdbf53e2bd193f2aed5a750fcc98c8e | train | tests/fixtures/external_plugins.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/external_plugins.py | 19 | 0 | assert | from sys import *
import sys
int = 12
++int
extra_parens = list((node for node in 'abc'))
some_tuple = (1, 2, )
breaking_pycodestyle=3
# commented: str = 'comment'
def camelCase(): ...
'{}'.format(1)
""
'%s' % 'test'
assert | True | modified | e0c478f7a08776ada9cdd9814d62a44a4e6f9fc1ebd2420536ad09e9774573d4 | assert||from sys import * import sys int = 12 ++int extra_parens = list((node for node in 'abc')) some_tuple = (1, 2, ) breaking_pycodestyle=3 # commented: str = 'comment' def camelCase(): ... '{}'.format(1) "" '%s' % 'test' assert | True | 19 | 0 | |
wemake-services/wemake-python-styleguide | train | 151 | b31fe0ff3bdbf53e2bd193f2aed5a750fcc98c8e | train | tests/test_visitors/test_ast/test_keywords/test_consistency_returning/test_consistency_return.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_consistency_returning/test_consistency_return.py | 93 | 4 | assert_* | test_wrong_return_statement | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
InconsistentReturnViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import (
ConsistentReturningVisitor,
)
# Correct:
correct_example1 = """
def function():
return None
"""
correct_example... | [InconsistentReturnViolation]) | added | 45cd30cf50d0f87ef3136e07bc1127d67790824c9662a89bc22f79adfa145e3e | assert_*|test_wrong_return_statement|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( InconsistentReturnViolation, ) from wemake_python_styleguide.visitors.ast.keywords import ( ConsistentReturningVisitor, ) # Correct: correct_example1 = """ def function(): return None... | null | null | null |
wemake-services/wemake-python-styleguide | train | 151 | b31fe0ff3bdbf53e2bd193f2aed5a750fcc98c8e | train | tests/test_visitors/test_ast/test_keywords/test_consistency_returning/test_consistency_yield.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_consistency_returning/test_consistency_yield.py | 90 | 4 | assert_* | test_wrong_yield_statement | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
InconsistentYieldViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import (
ConsistentReturningVisitor,
)
# Correct:
correct_example1 = """
def function():
yield
"""
correct_example2 = """... | [InconsistentYieldViolation]) | added | b5788d08cf81c4ba4788c0076a697c112735f45314b5873dd7f8ba9df1ce0c46 | assert_*|test_wrong_yield_statement|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( InconsistentYieldViolation, ) from wemake_python_styleguide.visitors.ast.keywords import ( ConsistentReturningVisitor, ) # Correct: correct_example1 = """ def function(): yield """ cor... | null | null | null |
wemake-services/wemake-python-styleguide | train | 151 | b31fe0ff3bdbf53e2bd193f2aed5a750fcc98c8e | train | tests/test_visitors/test_ast/test_loops/test_comprehensions/test_for_count.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_loops/test_comprehensions/test_for_count.py | 99 | 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.visitors.ast.loops import (
WrongComprehensionVisitor,
)
regular_loop_comprehension = """
nodes = [
target
for assignment in top_leve... | [TooManyForsInComprehensionViolation]) | modified | 8f08b1ea8e0a2471c93f59566d1402a724649f5897171879e77a0b57496995d6 | assert_*|test_multiple_for_keywords_in_comprehension|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( TooManyForsInComprehensionViolation, ) from wemake_python_styleguide.visitors.ast.loops import ( WrongComprehensionVisitor, ) regular_loop_comprehension = """ nodes = [... | [TooManyForsInComprehensionViolation]) | 97 | 4 |
wemake-services/wemake-python-styleguide | train | 151 | b31fe0ff3bdbf53e2bd193f2aed5a750fcc98c8e | train | tests/test_visitors/test_ast/test_loops/test_comprehensions/test_ifs_count.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_loops/test_comprehensions/test_ifs_count.py | 149 | 4 | assert_* | test_multiple_if_keywords_in_comprehension | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
MultipleIfsInComprehensionViolation,
)
from wemake_python_styleguide.visitors.ast.loops import (
WrongComprehensionVisitor,
)
# Lists:
list_ifs_multiple = """
def container():
nodes = [xy for xy in "abc" ... | [MultipleIfsInComprehensionViolation]) | modified | 4e3d322db5e3ba5b98cb7d382a5f8893c943971b55a0dc668a3d31f3e61606fb | assert_*|test_multiple_if_keywords_in_comprehension|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( MultipleIfsInComprehensionViolation, ) from wemake_python_styleguide.visitors.ast.loops import ( WrongComprehensionVisitor, ) # Lists: list_ifs_multiple = """ def conta... | [MultipleIfsInComprehensionViolation]) | 149 | 4 |
wemake-services/wemake-python-styleguide | train | 151 | b31fe0ff3bdbf53e2bd193f2aed5a750fcc98c8e | train | tests/test_visitors/test_ast/test_loops/test_comprehensions/test_yield_inside_comprehension.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_loops/test_comprehensions/test_yield_inside_comprehension.py | 46 | 4 | assert_* | test_yield_keyword_in_comprehension | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
YieldInComprehensionViolation,
)
from wemake_python_styleguide.visitors.ast.loops import (
WrongComprehensionVisitor,
)
list_comprehension = """
def container():
nodes = [{0} for xy in "abc"]
"""
gener... | [YieldInComprehensionViolation]) | modified | bcc01196c3ca6a7acc3c8cc186670f143ffa6586d7df2361eaab1d3f75751979 | assert_*|test_yield_keyword_in_comprehension|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( YieldInComprehensionViolation, ) from wemake_python_styleguide.visitors.ast.loops import ( WrongComprehensionVisitor, ) list_comprehension = """ def container(): nodes = [{... | [YieldInComprehensionViolation]) | 46 | 4 |
wemake-services/wemake-python-styleguide | train | 151 | b31fe0ff3bdbf53e2bd193f2aed5a750fcc98c8e | train | tests/test_visitors/test_ast/test_loops/test_loops/test_lambda_in_loop.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_loops/test_loops/test_lambda_in_loop.py | 54 | 4 | assert_* | test_lambda_body | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
LambdaInsideLoopViolation,
)
from wemake_python_styleguide.visitors.ast.loops import WrongLoopVisitor
lambda_inside_for_loop = """
def wrapper():
for index in range(10):
print(lambda: index)
"""
ne... | [LambdaInsideLoopViolation]) | modified | 3a06014c547a65e00af7019594b86b544172eb7f889a4ef80431b69bbe866cc3 | assert_*|test_lambda_body|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( LambdaInsideLoopViolation, ) from wemake_python_styleguide.visitors.ast.loops import WrongLoopVisitor lambda_inside_for_loop = """ def wrapper(): for index in range(10): print(lambda: index) ... | [LambdaInsideLoopViolation]) | 54 | 4 |
wemake-services/wemake-python-styleguide | train | 151 | b31fe0ff3bdbf53e2bd193f2aed5a750fcc98c8e | train | tests/test_visitors/test_ast/test_loops/test_loops/test_loop_with_else.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_loops/test_loops/test_loop_with_else.py | 152 | 4 | assert_* | test_wrong_else_in_for_loop | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
RedundantLoopElseViolation,
)
from wemake_python_styleguide.visitors.ast.loops import WrongLoopVisitor
wrong_else_in_for_loop = """
def wrapper():
for x in '123':
...
else:
...
"""
wron... | [RedundantLoopElseViolation]) | modified | 1b456bfc52375c4c177ccac167f623299aca9c1295247eb7d80d53594f81379f | assert_*|test_wrong_else_in_for_loop|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( RedundantLoopElseViolation, ) from wemake_python_styleguide.visitors.ast.loops import WrongLoopVisitor wrong_else_in_for_loop = """ def wrapper(): for x in '123': ... else: ... """... | [RedundantLoopElseViolation]) | 152 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.