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 | 82 | 46a7fc8143df9208490bdef54a156f8a64d307a4 | train | tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_jones/test_line_complexity.py | 150 | 4 | assert | test_that_some_nodes_are_ignored | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.complexity.jones import (
JonesComplexityVisitor,
LineComplexityViolation,
)
line_simple = 'x = 2'
line_with_types = 'x: int = 2'
line_with_comprehension = 'x = [f for f in "abc"]'
line_with_math = 'x = y * 2 + 19 / 9.3'
line_in... | number_of_lines | added | cd21d408c2803444390133e01252ec1467bc0e87986088e5ab221b8a8743c5a9 | assert|test_that_some_nodes_are_ignored|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.complexity.jones import ( JonesComplexityVisitor, LineComplexityViolation, ) line_simple = 'x = 2' line_with_types = 'x: int = 2' line_with_comprehension = 'x = [f for f in "abc"]' line_with_math = '... | null | null | null |
wemake-services/wemake-python-styleguide | train | 82 | 46a7fc8143df9208490bdef54a156f8a64d307a4 | train | tests/test_visitors/test_ast/test_imports/test_protected_import.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_imports/test_protected_import.py | 56 | 4 | assert_* | test_incorrect_import | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
ProtectedModuleViolation,
)
from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor
import_public = 'import public'
import_protected = 'import _protected'
import_from_protected = 'from _pro... | [ProtectedModuleViolation]) | added | f7ee92ab99490c2ae6790eec17a2a952cbf2b37af8d83a6896b8201918698f34 | assert_*|test_incorrect_import|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( ProtectedModuleViolation, ) from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor import_public = 'import public' import_protected = 'import _protected' import_fro... | null | null | null |
wemake-services/wemake-python-styleguide | train | 82 | 46a7fc8143df9208490bdef54a156f8a64d307a4 | train | tests/test_visitors/test_ast/test_keywords/test_loops.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_loops.py | 126 | 4 | assert_* | test_wrong_else_in_for_loop | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
RedundantForElseViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import WrongForElseVisitor
wrong_else_in_for_loop = """
for x in '123':
...
else:
...
"""
wrong_nested_else_in_for_loop ... | [RedundantForElseViolation]) | added | 8d925e600d32d7f22341fb804f9cc11c726506c095db602b2a51806722ee4283 | assert_*|test_wrong_else_in_for_loop|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( RedundantForElseViolation, ) from wemake_python_styleguide.visitors.ast.keywords import WrongForElseVisitor wrong_else_in_for_loop = """ for x in '123': ... else: ... """ wrong_nes... | null | null | null |
wemake-services/wemake-python-styleguide | train | 84 | 3ca1c7a71afbe7169b898b2690a31f5043dc2af6 | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 63 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
"""
from __future__ import print_function # noqa: Z422
from .version import get_version # noqa: Z300
import sys as sys # noqa: Z113
from some import _protected # noqa: Z440
full_name = u'Nikita Sobolev' # noqa: Z302
phone_number = 555_123_... | octal_number | added | 5e8b0db21bba725cd2700a773d095305a3d741bb3162248471a780bb20532126 | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. """ from __future__ import print_function # noqa: Z422 from .version import get_version # noqa: Z300 import sys as sys # noqa: Z113 from some import _protected # noqa: Z440 full_name = u'Nikita Sobolev' # noqa: Z302 phone_number = 555_123_9... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 84 | 3ca1c7a71afbe7169b898b2690a31f5043dc2af6 | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 73 | 0 | assert | # -*- coding: utf-8 -*-
"""
This file contains all possible violations.
"""
from __future__ import print_function # noqa: Z422
from .version import get_version # noqa: Z300
import sys as sys # noqa: Z113
from some import _protected # noqa: Z440
full_name = u'Nikita Sobolev' # noqa: Z302
phone_number = 555_123_... | hex_number | added | 0dd2c418d0cba109a3fb3800449a290997f7e5cfb4df0b9e66a2f45ce49e478e | assert||# -*- coding: utf-8 -*- """ This file contains all possible violations. """ from __future__ import print_function # noqa: Z422 from .version import get_version # noqa: Z300 import sys as sys # noqa: Z113 from some import _protected # noqa: Z440 full_name = u'Nikita Sobolev' # noqa: Z302 phone_number = 555_123_9... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 85 | aa5bb9dcb178520765129e803d0f2d3a58185f03 | train | tests/test_checker/test_module_names.py | train | wemake-services/wemake-python-styleguide:tests/test_checker/test_module_names.py | 28 | 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 | 43721ae34ef2482660a58e67f6210a2880273c0a1e360a843605e5028f23bfc3 | 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 | 27 | 4 |
wemake-services/wemake-python-styleguide | train | 85 | aa5bb9dcb178520765129e803d0f2d3a58185f03 | train | tests/test_options.py | train | wemake-services/wemake-python-styleguide:tests/test_options.py | 17 | 8 | assert | test_option_help | # -*- coding: utf-8 -*-
from wemake_python_styleguide.options.config import Configuration
def test_option_docs():
"""Ensures that all options are documented."""
for option in Configuration.options:
option_name = '``' + option.long_option_name[2:] + '``'
assert option_name in Configuration.__d... | option.help.endswith('.') | added | 71839dafac025525decfcd22b9bb16993d066f0135b83228e53a49a0d2fa92f7 | assert|test_option_help|# -*- coding: utf-8 -*- from wemake_python_styleguide.options.config import Configuration def test_option_docs(): """Ensures that all options are documented.""" for option in Configuration.options: option_name = '``' + option.long_option_name[2:] + '``' assert option_name in Configuration.__doc_... | null | null | null |
wemake-services/wemake-python-styleguide | train | 85 | aa5bb9dcb178520765129e803d0f2d3a58185f03 | train | tests/test_visitors/test_ast/test_naming/test_function_args_names.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_function_args_names.py | 157 | 4 | assert_* | test_private_function_arguments | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
ConsecutiveUnderscoresInNameViolation,
PrivateNameViolation,
TooShortNameViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
VARIABLE_NAMES_BLACKLIST,
... | [ PrivateNameViolation, PrivateNameViolation, ]) | modified | c73458323f47db22919ae0a1061198238d61959075092d24baf006a5cfcc3ef2 | assert_*|test_private_function_arguments|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( ConsecutiveUnderscoresInNameViolation, PrivateNameViolation, TooShortNameViolation, WrongVariableNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( VARIABLE_NA... | [ PrivateNameViolation, PrivateNameViolation, ]) | 156 | 4 |
wemake-services/wemake-python-styleguide | train | 85 | aa5bb9dcb178520765129e803d0f2d3a58185f03 | train | tests/test_visitors/test_filenames/test_module/test_module_magic_name.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_module/test_module_magic_name.py | 33 | 4 | assert_* | test_simple_filename | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.constants import MAGIC_MODULE_NAMES_WHITELIST
from wemake_python_styleguide.violations.naming import (
WrongModuleMagicNameViolation,
)
from wemake_python_styleguide.visitors.filenames.module import (
WrongModuleNameVisitor,
)
@pytest.mark.... | [WrongModuleMagicNameViolation]) | modified | 63b0d0322bb32e7e6c3a04f131008f2914ae4b8965d184716ec4e875bed080e9 | assert_*|test_simple_filename|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.constants import MAGIC_MODULE_NAMES_WHITELIST from wemake_python_styleguide.violations.naming import ( WrongModuleMagicNameViolation, ) from wemake_python_styleguide.visitors.filenames.module import ( WrongModuleNameVisito... | [WrongModuleMagicNameViolation]) | 33 | 4 |
wemake-services/wemake-python-styleguide | train | 85 | aa5bb9dcb178520765129e803d0f2d3a58185f03 | train | tests/test_visitors/test_filenames/test_module/test_module_name.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_module/test_module_name.py | 32 | 4 | assert_* | test_restricted_filename | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.constants import MODULE_NAMES_BLACKLIST
from wemake_python_styleguide.violations.naming import WrongModuleNameViolation
from wemake_python_styleguide.visitors.filenames.module import (
WrongModuleNameVisitor,
)
@pytest.mark.parametrize('filenam... | [WrongModuleNameViolation]) | modified | a41dd4c5b22dc86658c7301d770aec8b3cd8c19935460946846643bb51f95dde | assert_*|test_restricted_filename|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.constants import MODULE_NAMES_BLACKLIST from wemake_python_styleguide.violations.naming import WrongModuleNameViolation from wemake_python_styleguide.visitors.filenames.module import ( WrongModuleNameVisitor, ) @pytest... | [WrongModuleNameViolation]) | 32 | 4 |
wemake-services/wemake-python-styleguide | train | 85 | aa5bb9dcb178520765129e803d0f2d3a58185f03 | train | tests/test_visitors/test_filenames/test_module/test_module_name_length.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_module/test_module_name_length.py | 25 | 4 | assert_* | test_too_short_filename | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
TooShortNameViolation,
WrongModuleNamePatternViolation,
)
from wemake_python_styleguide.visitors.filenames.module import (
WrongModuleNameVisitor,
)
@pytest.mark.parametrize('filename', [
'a.py',
'some... | [ TooShortNameViolation, WrongModuleNamePatternViolation, ]) | modified | db59d8a8556bf7a6c7ab6b19aa8c057cc3d4d18e5237ad175ef0d350aac26346 | assert_*|test_too_short_filename|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( TooShortNameViolation, WrongModuleNamePatternViolation, ) from wemake_python_styleguide.visitors.filenames.module import ( WrongModuleNameVisitor, ) @pytest.mark.parametrize('filename', [ 'a.p... | [ TooShortModuleNameViolation, WrongModuleNamePatternViolation, ]) | 25 | 4 |
wemake-services/wemake-python-styleguide | train | 85 | aa5bb9dcb178520765129e803d0f2d3a58185f03 | train | tests/test_visitors/test_filenames/test_module/test_module_underscore_number.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_module/test_module_underscore_number.py | 26 | 4 | assert_* | test_filename_with_underscored_number | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
UnderScoredNumberNameViolation,
)
from wemake_python_styleguide.visitors.filenames.module import (
WrongModuleNameVisitor,
)
@pytest.mark.parametrize('filename', [
'version_2.py',
'custom_2_version.py',
])... | [UnderScoredNumberNameViolation]) | modified | 6262819bdbdf7df7792eb1c7bef871d28f51c3ff0cea303732e72194d0fcfd74 | assert_*|test_filename_with_underscored_number|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( UnderScoredNumberNameViolation, ) from wemake_python_styleguide.visitors.filenames.module import ( WrongModuleNameVisitor, ) @pytest.mark.parametrize('filename', [ 'version_2.py'... | [UnderScoredNumberNameViolation]) | 26 | 4 |
wemake-services/wemake-python-styleguide | train | 85 | aa5bb9dcb178520765129e803d0f2d3a58185f03 | train | tests/test_visitors/test_filenames/test_module/test_module_underscores.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_module/test_module_underscores.py | 37 | 4 | assert_* | test_underscore_filename | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
ConsecutiveUnderscoresInNameViolation,
PrivateNameViolation,
)
from wemake_python_styleguide.visitors.filenames.module import (
WrongModuleNameVisitor,
)
@pytest.mark.parametrize('filename', [
'some.py',
... | [ConsecutiveUnderscoresInNameViolation]) | added | f55f2b1b09cc14018fd578ad63f522dde6ab2e14c4ae368e4b91b0708c2c101b | assert_*|test_underscore_filename|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( ConsecutiveUnderscoresInNameViolation, PrivateNameViolation, ) from wemake_python_styleguide.visitors.filenames.module import ( WrongModuleNameVisitor, ) @pytest.mark.parametrize('filename', ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 86 | bfd3a13efe7534e155dd325f419d884c4c667a15 | train | tests/test_checker/test_module_names.py | train | wemake-services/wemake-python-styleguide:tests/test_checker/test_module_names.py | 28 | 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 | 97b03cc67e6f35597eb3e9671c74c76f770c35487369068cb41631e2fb8aa3af | 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 | 28 | 4 |
wemake-services/wemake-python-styleguide | train | 86 | bfd3a13efe7534e155dd325f419d884c4c667a15 | train | tests/test_visitors/conftest.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/conftest.py | 29 | 8 | assert | # -*- coding: utf-8 -*-
from typing import Sequence
import pytest
from wemake_python_styleguide.visitors.base import BaseVisitor
@pytest.fixture(scope='session')
def assert_errors():
"""Helper function to assert visitor violations."""
def factory(visitor: BaseVisitor, errors: Sequence[str]):
assert... | violation.__class__.should_use_text | added | c63ec52e6ded2d7b4e6253fea39363eff618977b449e89db1fda2b3b34811756 | assert||# -*- coding: utf-8 -*- from typing import Sequence import pytest from wemake_python_styleguide.visitors.base import BaseVisitor @pytest.fixture(scope='session') def assert_errors(): """Helper function to assert visitor violations.""" def factory(visitor: BaseVisitor, errors: Sequence[str]): assert len(errors) ... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 86 | bfd3a13efe7534e155dd325f419d884c4c667a15 | train | tests/test_visitors/test_ast/test_attributes/test_protected_attributes.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_attributes/test_protected_attributes.py | 138 | 4 | assert_* | test_protected_attribute_is_restricted | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.attributes import (
ProtectedAttributeViolation,
WrongAttributeVisitor,
)
# Incorrect:
protected_attribute_assigned = 'some._protected = 1'
protected_attribute_accessed = 'print(some._protected)'
protected_method_called = 'some... | [ProtectedAttributeViolation]) | added | 99561714d8b0a10fbe908c57451246898aa51187454c2cdc8c3f83c7056ad8c3 | assert_*|test_protected_attribute_is_restricted|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.attributes import ( ProtectedAttributeViolation, WrongAttributeVisitor, ) # Incorrect: protected_attribute_assigned = 'some._protected = 1' protected_attribute_accessed = 'print(some._protect... | null | null | null |
wemake-services/wemake-python-styleguide | train | 86 | bfd3a13efe7534e155dd325f419d884c4c667a15 | train | tests/test_visitors/test_ast/test_attributes/test_protected_attributes.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_attributes/test_protected_attributes.py | 139 | 4 | assert_* | test_protected_attribute_is_restricted | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.attributes import (
ProtectedAttributeViolation,
WrongAttributeVisitor,
)
# Incorrect:
protected_attribute_assigned = 'some._protected = 1'
protected_attribute_accessed = 'print(some._protected)'
protected_method_called = 'some... | '_protected') | added | 4b6c5d4d0f01c26c8d9010bedecdf7522b589a733accfed16f0718bd312b4ce1 | assert_*|test_protected_attribute_is_restricted|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.attributes import ( ProtectedAttributeViolation, WrongAttributeVisitor, ) # Incorrect: protected_attribute_assigned = 'some._protected = 1' protected_attribute_accessed = 'print(some._protect... | null | null | null |
wemake-services/wemake-python-styleguide | train | 86 | bfd3a13efe7534e155dd325f419d884c4c667a15 | 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... | str(abs(number))) | added | 76a31e1f8a7fb368d0fd6ff258fcc7d9b03f6713bcf4b051a9b6d692893211ae | 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... | null | null | null |
wemake-services/wemake-python-styleguide | train | 86 | bfd3a13efe7534e155dd325f419d884c4c667a15 | train | tests/test_visitors/test_ast/test_naming/test_variable_names.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_variable_names.py | 104 | 4 | assert_* | test_too_short_variable_names | # -*- coding: utf-8 -*-
import string
import pytest
from wemake_python_styleguide.violations.naming import (
ConsecutiveUnderscoresInNameViolation,
PrivateNameViolation,
TooShortNameViolation,
UnderscoredNumberNameViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast... | short_name) | added | ee6af28246c579adb1ca520ba49b31769e75c22bf856e055a3fc5d76e6034a95 | assert_*|test_too_short_variable_names|# -*- coding: utf-8 -*- import string import pytest from wemake_python_styleguide.violations.naming import ( ConsecutiveUnderscoresInNameViolation, PrivateNameViolation, TooShortNameViolation, UnderscoredNumberNameViolation, WrongVariableNameViolation, ) from wemake_python_stylegu... | null | null | null |
wemake-services/wemake-python-styleguide | train | 86 | bfd3a13efe7534e155dd325f419d884c4c667a15 | train | tests/test_visitors/test_ast/test_naming/test_variable_names.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_variable_names.py | 153 | 4 | assert_* | test_private_variable_names | # -*- coding: utf-8 -*-
import string
import pytest
from wemake_python_styleguide.violations.naming import (
ConsecutiveUnderscoresInNameViolation,
PrivateNameViolation,
TooShortNameViolation,
UnderscoredNumberNameViolation,
WrongVariableNameViolation,
)
from wemake_python_styleguide.visitors.ast... | [PrivateNameViolation]) | modified | 3194fa0138049749c82152fc5992f642d7b7d195f15796f101c2bf54b97656ab | assert_*|test_private_variable_names|# -*- coding: utf-8 -*- import string import pytest from wemake_python_styleguide.violations.naming import ( ConsecutiveUnderscoresInNameViolation, PrivateNameViolation, TooShortNameViolation, UnderscoredNumberNameViolation, WrongVariableNameViolation, ) from wemake_python_styleguid... | [PrivateNameViolation]) | 156 | 4 |
wemake-services/wemake-python-styleguide | train | 86 | bfd3a13efe7534e155dd325f419d884c4c667a15 | train | tests/test_visitors/test_filenames/test_module/test_module_underscore_number.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_module/test_module_underscore_number.py | 26 | 4 | assert_* | test_filename_with_underscored_number | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
UnderscoredNumberNameViolation,
)
from wemake_python_styleguide.visitors.filenames.module import (
WrongModuleNameVisitor,
)
@pytest.mark.parametrize('filename', [
'version_2.py',
'custom_2_version.py',
])... | [UnderscoredNumberNameViolation]) | modified | ee4ec51efca89f0f20354fdf80abe9505a60ce4ac4f11cde9dd406f6494054cd | assert_*|test_filename_with_underscored_number|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( UnderscoredNumberNameViolation, ) from wemake_python_styleguide.visitors.filenames.module import ( WrongModuleNameVisitor, ) @pytest.mark.parametrize('filename', [ 'version_2.py'... | [UnderScoredNumberNameViolation]) | 26 | 4 |
wemake-services/wemake-python-styleguide | train | 87 | 4401bbde12ce1c78d3dfa82ab7a5c32e8f5a9ff7 | train | tests/test_visitors/test_ast/test_naming/test_module_metadata.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_module_metadata.py | 41 | 4 | assert_* | test_wrong_metadata | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
WrongModuleMetadataViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
MODULE_METADATA_VARIABLES_BLACKLIST,
WrongModuleMetadataVisitor,
)
module_metadata = """
{0} = 'Nikita'
"""
ne... | [WrongModuleMetadataViolation]) | modified | 28a4949a1a6d1570f3b0e0b316e0bf225900e8e804f88689b2a8f542da3095cd | assert_*|test_wrong_metadata|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( WrongModuleMetadataViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( MODULE_METADATA_VARIABLES_BLACKLIST, WrongModuleMetadataVisitor, ) module_metadata = """ {0} = 'N... | [WrongModuleMetadataViolation]) | 41 | 4 |
wemake-services/wemake-python-styleguide | train | 87 | 4401bbde12ce1c78d3dfa82ab7a5c32e8f5a9ff7 | train | tests/test_visitors/test_ast/test_naming/test_naming.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming.py | 49 | 4 | assert_* | test_short_variable_name | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.constants import VARIABLE_NAMES_BLACKLIST
from wemake_python_styleguide.violations.naming import (
ConsecutiveUnderscoresInNameViolation,
PrivateNameViolation,
TooShortNameViolation,
UnderscoredNumberNameViolation,
WrongVariableNa... | [TooShortNameViolation]) | added | f4523720e8c3a1a6c9f1b476cdcd9c85a42b215c664891fa7c9c39aed7e4e10b | assert_*|test_short_variable_name|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.constants import VARIABLE_NAMES_BLACKLIST from wemake_python_styleguide.violations.naming import ( ConsecutiveUnderscoresInNameViolation, PrivateNameViolation, TooShortNameViolation, UnderscoredNumberNameViolation, Wro... | null | null | null |
wemake-services/wemake-python-styleguide | train | 87 | 4401bbde12ce1c78d3dfa82ab7a5c32e8f5a9ff7 | train | tests/test_visitors/test_ast/test_naming/test_naming.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming.py | 68 | 4 | assert_* | test_private_variable_name | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.constants import VARIABLE_NAMES_BLACKLIST
from wemake_python_styleguide.violations.naming import (
ConsecutiveUnderscoresInNameViolation,
PrivateNameViolation,
TooShortNameViolation,
UnderscoredNumberNameViolation,
WrongVariableNa... | private_name) | added | ad6961a0ff7a2bf5ed0563b56be4965e9aaca66cdbe96b07f1969a69938b18af | assert_*|test_private_variable_name|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.constants import VARIABLE_NAMES_BLACKLIST from wemake_python_styleguide.violations.naming import ( ConsecutiveUnderscoresInNameViolation, PrivateNameViolation, TooShortNameViolation, UnderscoredNumberNameViolation, W... | null | null | null |
wemake-services/wemake-python-styleguide | train | 87 | 4401bbde12ce1c78d3dfa82ab7a5c32e8f5a9ff7 | train | tests/test_visitors/test_ast/test_naming/test_naming.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming.py | 90 | 4 | assert_* | test_underscored_variable_name | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.constants import VARIABLE_NAMES_BLACKLIST
from wemake_python_styleguide.violations.naming import (
ConsecutiveUnderscoresInNameViolation,
PrivateNameViolation,
TooShortNameViolation,
UnderscoredNumberNameViolation,
WrongVariableNa... | [ConsecutiveUnderscoresInNameViolation]) | added | 05b531718e701649cc534451621afa5dfffd8abfa429218e54ce9a9e59a96dd1 | assert_*|test_underscored_variable_name|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.constants import VARIABLE_NAMES_BLACKLIST from wemake_python_styleguide.violations.naming import ( ConsecutiveUnderscoresInNameViolation, PrivateNameViolation, TooShortNameViolation, UnderscoredNumberNameViolatio... | null | null | null |
wemake-services/wemake-python-styleguide | train | 87 | 4401bbde12ce1c78d3dfa82ab7a5c32e8f5a9ff7 | train | tests/test_visitors/test_ast/test_naming/test_naming.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming.py | 113 | 4 | assert_* | test_number_prefix_variable_name | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.constants import VARIABLE_NAMES_BLACKLIST
from wemake_python_styleguide.violations.naming import (
ConsecutiveUnderscoresInNameViolation,
PrivateNameViolation,
TooShortNameViolation,
UnderscoredNumberNameViolation,
WrongVariableNa... | number_suffix) | added | fe8aa5dc6f62bf54f73083489768607100752c4a5ebbe32946d5542cd2652c32 | assert_*|test_number_prefix_variable_name|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.constants import VARIABLE_NAMES_BLACKLIST from wemake_python_styleguide.violations.naming import ( ConsecutiveUnderscoresInNameViolation, PrivateNameViolation, TooShortNameViolation, UnderscoredNumberNameViolat... | null | null | null |
wemake-services/wemake-python-styleguide | train | 87 | 4401bbde12ce1c78d3dfa82ab7a5c32e8f5a9ff7 | train | tests/test_visitors/test_filenames/test_module/test_module_pattern.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_module/test_module_pattern.py | 39 | 4 | assert_* | test_wrong_filename | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
WrongModuleNamePatternViolation,
)
from wemake_python_styleguide.visitors.filenames.module import (
WrongModuleNameVisitor,
)
@pytest.mark.parametrize('filename', [
'my_module.py',
'_prefixed.py',
'_pr... | [WrongModuleNamePatternViolation]) | modified | ed4e8cc2738998dd2cad6fbd6d9e52c91989b1b0001f6e1dab45c5c33187dc0b | assert_*|test_wrong_filename|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( WrongModuleNamePatternViolation, ) from wemake_python_styleguide.visitors.filenames.module import ( WrongModuleNameVisitor, ) @pytest.mark.parametrize('filename', [ 'my_module.py', '_prefixed.py',... | [WrongModuleNamePatternViolation]) | 39 | 4 |
wemake-services/wemake-python-styleguide | train | 88 | 87237b663bb455bd9ee23321437f0f289741e2e5 | 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 | 31 | 4 | assert_* | test_wrong_magic_used | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.constants import MAGIC_METHODS_BLACKLIST
from wemake_python_styleguide.violations.best_practices import (
BadMagicMethodViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
magic_method = """
class Example(obj... | [BadMagicMethodViolation]) | added | a91f6aecdfaf21695aff440e29a0a9fa90f2f7c497fee1d9c891c47e1e4a1e51 | 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... | null | null | null |
wemake-services/wemake-python-styleguide | train | 88 | 87237b663bb455bd9ee23321437f0f289741e2e5 | train | tests/test_visitors/test_ast/test_classes/test_yield_inside_init.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_yield_inside_init.py | 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 WrongClassVisitor
init_without_yield = """
class ModuleMembersVisitor(object):
def __init__(self, *args, **kwargs):
... | [YieldInsideInitViolation]) | added | f9c8b40f2d1091bd35f01ce869f99e4862668a43c89b1a9c3e6b757d01fbb1bc | assert_*|test_init_generator|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( YieldInsideInitViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor init_without_yield = """ class ModuleMembersVisitor(object): def __init__(self, *arg... | null | null | null |
wemake-services/wemake-python-styleguide | train | 88 | 87237b663bb455bd9ee23321437f0f289741e2e5 | 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 | 85 | 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 | 8c1d700fb2f8c34e3fa3cf2b8fff59b56049db523fba2f92691fd77b1893a9b1 | 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 | 88 | 87237b663bb455bd9ee23321437f0f289741e2e5 | train | tests/test_visitors/test_ast/test_comparisons/test_order.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_order.py | 114 | 4 | assert_* | test_comparison_wrong_order_multiple | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ComparisonOrderViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
WrongComparisionOrderVisitor,
)
# TODO: use lazy fixtures to pass:
# if_with_chained_comparisons1,
# if_with_chained... | [ ComparisonOrderViolation, ComparisonOrderViolation, ]) | added | fce987232c832d28df4edf39a15f2127afa82b9c0040f0192fea64d706f7034c | assert_*|test_comparison_wrong_order_multiple|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ComparisonOrderViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( WrongComparisionOrderVisitor, ) # TODO: use lazy fixtures to pass: # if_with_chain... | null | null | null |
wemake-services/wemake-python-styleguide | train | 88 | 87237b663bb455bd9ee23321437f0f289741e2e5 | train | tests/test_visitors/test_ast/test_complexity/test_counts/test_imports_counts.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_counts/test_imports_counts.py | 60 | 4 | assert_* | test_module_import_counts_violation | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.complexity.counts import (
ImportMembersVisitor,
TooManyImportsViolation,
)
module_import = ''
module_with_regular_imports = """
import sys
import os
"""
module_with_from_imports = """
from os import path
from sys import versio... | [TooManyImportsViolation]) | added | 2ca411267b9208ac5a7a1ddaed7927d7c71a3f2c1c998b3d5ff8209f0d3745ea | assert_*|test_module_import_counts_violation|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.complexity.counts import ( ImportMembersVisitor, TooManyImportsViolation, ) module_import = '' module_with_regular_imports = """ import sys import os """ module_with_from_imports = """ from os i... | null | null | null |
wemake-services/wemake-python-styleguide | train | 88 | 87237b663bb455bd9ee23321437f0f289741e2e5 | 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,
)
# TODO: use `mode` fixture after
# https://github.com/wemake-services/wemake-python-styleguide/issues/308
# will be fixed
def test_correct_arguments_count(
... | [TooManyArgumentsViolation]) | added | 39ae1b91139e7003839871529f52e16f1935d40937935caf53353668d02ee076 | assert_*|test_single_argument_count_invalid|# -*- coding: utf-8 -*- from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, TooManyArgumentsViolation, ) # TODO: use `mode` fixture after # https://github.com/wemake-services/wemake-python-styleguide/issues/308 # will be fixed de... | null | null | null |
wemake-services/wemake-python-styleguide | train | 88 | 87237b663bb455bd9ee23321437f0f289741e2e5 | train | tests/test_visitors/test_ast/test_complexity/test_function/test_local_variables.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_local_variables.py | 108 | 4 | assert_* | test_locals_wrong_count | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
TooManyLocalsViolation,
)
function_with_locals = """
{0}def function():
local_variable1 = 1
local_variable2 = 2
_ = None # `_` is not counted
"""
function_wit... | [TooManyLocalsViolation]) | added | 973cd9b0c25acaec4fbf0d571a8a6a5404796b2ad1c601b9e00a35c74a700ebe | assert_*|test_locals_wrong_count|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, TooManyLocalsViolation, ) function_with_locals = """ {0}def function(): local_variable1 = 1 local_variable2 = 2 _ = None # `_` is not counted """ func... | null | null | null |
wemake-services/wemake-python-styleguide | train | 88 | 87237b663bb455bd9ee23321437f0f289741e2e5 | train | tests/test_visitors/test_ast/test_imports/test_nested_imports.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_imports/test_nested_imports.py | 68 | 4 | assert_* | test_nested_import | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
NestedImportViolation,
)
from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor
# Incorrect imports:
nested_function_import = """
def function():
import os
"""
nested_function_from_i... | [NestedImportViolation]) | modified | a750bc6dd1f83dc74ed39ca50b124ce3953dc31a1a53fcf03b2d475a23834e09 | assert_*|test_nested_import|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( NestedImportViolation, ) from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor # Incorrect imports: nested_function_import = """ def function(): import os """ nested_... | [NestedImportViolation]) | 68 | 4 |
wemake-services/wemake-python-styleguide | train | 89 | 70584fc9b3f01488a7d44d2a0fa6abce92ec6399 | train | tests/test_visitors/test_ast/test_complexity/test_counts/test_bases_classes_counts.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_counts/test_bases_classes_counts.py | 60 | 4 | assert_* | test_bad_number_default_option | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyBaseClassesViolation,
)
from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor
correct_count = """
class CorrectClassName(
FirstParentClass,
SecondParentClass,
ThirdParentCla... | [TooManyBaseClassesViolation]) | modified | c5b8062e3818505a16ba75f2196902ef7c75a6413cc79835729e5f2aa98d8d24 | assert_*|test_bad_number_default_option|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( TooManyBaseClassesViolation, ) from wemake_python_styleguide.visitors.ast.classes import WrongClassVisitor correct_count = """ class CorrectClassName( FirstParentClass, SecondParent... | [TooManyBaseClassesViolation]) | 59 | 4 |
wemake-services/wemake-python-styleguide | train | 89 | 70584fc9b3f01488a7d44d2a0fa6abce92ec6399 | train | tests/test_visitors/test_ast/test_complexity/test_counts/test_method_counts.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_counts/test_method_counts.py | 125 | 4 | assert_* | test_method_counts_violation | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.complexity.counts import (
MethodMembersVisitor,
TooManyMethodsViolation,
)
module_without_methods = """
def first(): ...
def second(): ...
"""
module_without_methods_with_async_functions = """
async def first(): ...
async de... | [TooManyMethodsViolation]) | added | 8fd42f7be41b0102ad0fe9873b0cfd61e058e23e70b8765201d102c64ab9f6e4 | assert_*|test_method_counts_violation|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.complexity.counts import ( MethodMembersVisitor, TooManyMethodsViolation, ) module_without_methods = """ def first(): ... def second(): ... """ module_without_methods_with_async_functions = """ async d... | null | null | null |
wemake-services/wemake-python-styleguide | train | 89 | 70584fc9b3f01488a7d44d2a0fa6abce92ec6399 | train | tests/test_visitors/test_ast/test_complexity/test_function/test_expressions.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_expressions.py | 70 | 4 | assert_* | test_expressions_wrong_count | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
TooManyExpressionsViolation,
)
function_without_expressions = """
def function():
return 1
"""
function_with_expressions = """
def function():
print(1)
print(2... | [TooManyExpressionsViolation]) | added | 49cfe4843310f2a7bcdc87360e1533e031915db5aef9ce6ba92ffb62b483312b | assert_*|test_expressions_wrong_count|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, TooManyExpressionsViolation, ) function_without_expressions = """ def function(): return 1 """ function_with_expressions = """ def function(): pr... | null | null | null |
wemake-services/wemake-python-styleguide | train | 89 | 70584fc9b3f01488a7d44d2a0fa6abce92ec6399 | train | tests/test_visitors/test_ast/test_complexity/test_function/test_local_variables.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_local_variables.py | 120 | 4 | assert_* | test_locals_wrong_count | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
TooManyLocalsViolation,
)
function_with_locals = """
def function():
local_variable1 = 1
local_variable2 = 2
_ = None # `_` is not counted
"""
function_with_l... | [TooManyLocalsViolation]) | added | 627e0c7770d01d248dc40f1a31ade41a0ea57686fae5757a16832ce14f6c0915 | assert_*|test_locals_wrong_count|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, TooManyLocalsViolation, ) function_with_locals = """ def function(): local_variable1 = 1 local_variable2 = 2 _ = None # `_` is not counted """ functio... | null | null | null |
wemake-services/wemake-python-styleguide | train | 89 | 70584fc9b3f01488a7d44d2a0fa6abce92ec6399 | train | tests/test_visitors/test_ast/test_complexity/test_jones/test_module_complexity.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_jones/test_module_complexity.py | 77 | 4 | assert_* | test_module_score_error | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.complexity.jones import (
JonesComplexityVisitor,
JonesScoreViolation,
)
module_without_nodes = ''
module_with_nodes = """
some_value = 1 + 2
other = some_value if some_value > 2 else some_value * 8 + 34
"""
module_with_functio... | [JonesScoreViolation]) | added | bdd8f51d5e644cd7842be95e83ec00fabc07f8ff0a6b9aaea887db8496bef136 | assert_*|test_module_score_error|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.complexity.jones import ( JonesComplexityVisitor, JonesScoreViolation, ) module_without_nodes = '' module_with_nodes = """ some_value = 1 + 2 other = some_value if some_value > 2 else some_value * 8 + 34 ""... | null | null | null |
wemake-services/wemake-python-styleguide | train | 89 | 70584fc9b3f01488a7d44d2a0fa6abce92ec6399 | train | tests/test_visitors/test_ast/test_keywords/test_comprehensions.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_comprehensions.py | 180 | 4 | assert_* | test_multiple_for_keywords_in_comprehension | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyForsInComprehensionViolation,
)
from wemake_python_styleguide.violations.consistency import (
MultipleIfsInComprehensionViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import (
WrongL... | [TooManyForsInComprehensionViolation]) | added | 774f556ca3c7997f53af315270937109dbc437166d5444c7f052dd3aebbadb55 | assert_*|test_multiple_for_keywords_in_comprehension|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( TooManyForsInComprehensionViolation, ) from wemake_python_styleguide.violations.consistency import ( MultipleIfsInComprehensionViolation, ) from wemake_python_styleguid... | null | null | null |
wemake-services/wemake-python-styleguide | train | 89 | 70584fc9b3f01488a7d44d2a0fa6abce92ec6399 | train | tests/test_visitors/test_ast/test_keywords/test_global.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_global.py | 43 | 4 | assert_* | test_global_keywords | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
WrongKeywordViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import WrongKeywordVisitor
global_in_function = """
x = 0
def check_global():
global x
"""
nonlocal_in_function = """
def check... | [WrongKeywordViolation]) | added | 4b4fec99898dc527e82f15eb0707080ef04a67b1a1322b5e480996c42471888f | assert_*|test_global_keywords|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( WrongKeywordViolation, ) from wemake_python_styleguide.visitors.ast.keywords import WrongKeywordVisitor global_in_function = """ x = 0 def check_global(): global x """ nonlocal_in_functio... | null | null | null |
wemake-services/wemake-python-styleguide | train | 89 | 70584fc9b3f01488a7d44d2a0fa6abce92ec6399 | train | tests/test_visitors/test_ast/test_keywords/test_pass.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_pass.py | 56 | 4 | assert_* | test_pass_keyword | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
WrongKeywordViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import WrongKeywordVisitor
pass_function = """
def function():
pass
"""
pass_class = """
class Test(object):
pass
"""
pass_... | [WrongKeywordViolation]) | modified | 836eab419a7f70c247058f5ac9f8392f56416097b51924b70794446b6c2e17f4 | assert_*|test_pass_keyword|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( WrongKeywordViolation, ) from wemake_python_styleguide.visitors.ast.keywords import WrongKeywordVisitor pass_function = """ def function(): pass """ pass_class = """ class Test(object): pass... | [WrongKeywordViolation]) | 56 | 4 |
wemake-services/wemake-python-styleguide | train | 90 | 53c1515e1ad40e6595097941b9d08b686f671c8d | train | tests/test_checker/test_presets.py | train | wemake-services/wemake-python-styleguide:tests/test_checker/test_presets.py | 70 | 8 | assert | test_all_visitors_contained_in_checker | # -*- coding: utf-8 -*-
import importlib
import inspect
from importlib.machinery import SourceFileLoader
from operator import itemgetter
from pathlib import Path
import pytest
from wemake_python_styleguide.checker import Checker
from wemake_python_styleguide.visitors.base import (
BaseFilenameVisitor,
BaseNo... | checker_visitors | modified | f2e3f32c2538f0b9447dc58b1c6a70b87c2729bb75d09f3a3ea8c6e38c611d15 | assert|test_all_visitors_contained_in_checker|# -*- coding: utf-8 -*- import importlib import inspect from importlib.machinery import SourceFileLoader from operator import itemgetter from pathlib import Path import pytest from wemake_python_styleguide.checker import Checker from wemake_python_styleguide.visitors.base i... | checker_visitors | 72 | 8 |
wemake-services/wemake-python-styleguide | train | 90 | 53c1515e1ad40e6595097941b9d08b686f671c8d | train | tests/test_checker/test_presets.py | train | wemake-services/wemake-python-styleguide:tests/test_checker/test_presets.py | 72 | 4 | assert | test_all_visitors_contained_in_checker | # -*- coding: utf-8 -*-
import importlib
import inspect
from importlib.machinery import SourceFileLoader
from operator import itemgetter
from pathlib import Path
import pytest
from wemake_python_styleguide.checker import Checker
from wemake_python_styleguide.visitors.base import (
BaseFilenameVisitor,
BaseNo... | len(checker_visitors) | modified | 5ee8f7c0930ed30928bf9e69bb58bd0cbcf72f01caeadde91dc2be955b3b2d4f | assert|test_all_visitors_contained_in_checker|# -*- coding: utf-8 -*- import importlib import inspect from importlib.machinery import SourceFileLoader from operator import itemgetter from pathlib import Path import pytest from wemake_python_styleguide.checker import Checker from wemake_python_styleguide.visitors.base i... | len(checker_visitors) | 74 | 4 |
wemake-services/wemake-python-styleguide | train | 91 | 9948bd0b4006472a551f428722bd67742204c182 | train | tests/test_visitors/test_ast/test_imports/test_same_alias_import.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_imports/test_same_alias_import.py | 31 | 4 | assert_* | test_same_alias_import | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import SameAliasImportViolation
from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor
regular_import = 'import os as {0}'
from_import = 'from sys import os as {0}'
@pytest.mark.parametrize('code', [
reg... | same_alias) | added | fa5937d6475e5050291799818d6a07e7b6c98e1dbea76c6feae6c619204e0d40 | assert_*|test_same_alias_import|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import SameAliasImportViolation from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor regular_import = 'import os as {0}' from_import = 'from sys import os as {0}' @pytest.mark.pa... | null | null | null |
wemake-services/wemake-python-styleguide | train | 91 | 9948bd0b4006472a551f428722bd67742204c182 | 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 | 39 | 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
"""
@pytest.mark.parametrize('non_snake_case_name', [... | non_snake_case_name) | added | 53630b8c63a4c8a7427ffc0fd1ed9fd7a23fa3907a090dfaaddd5a82f629ba4a | 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 """ @pytest.mark.paramet... | null | null | null |
wemake-services/wemake-python-styleguide | train | 91 | 9948bd0b4006472a551f428722bd67742204c182 | train | tests/test_visitors/test_ast/test_naming/test_naming.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming.py | 118 | 4 | assert_* | test_number_prefix_variable_name | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.constants import VARIABLE_NAMES_BLACKLIST
from wemake_python_styleguide.violations.naming import (
ConsecutiveUnderscoresInNameViolation,
PrivateNameViolation,
TooShortNameViolation,
UnderscoredNumberNameViolation,
WrongVariableNa... | [UnderscoredNumberNameViolation]) | modified | d377c07d1a4eb1385689e5f06c3ade7c00b98696aa572eaeb077d501b08c34f5 | assert_*|test_number_prefix_variable_name|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.constants import VARIABLE_NAMES_BLACKLIST from wemake_python_styleguide.violations.naming import ( ConsecutiveUnderscoresInNameViolation, PrivateNameViolation, TooShortNameViolation, UnderscoredNumberNameViolat... | [UnderscoredNumberNameViolation]) | 117 | 4 |
wemake-services/wemake-python-styleguide | train | 91 | 9948bd0b4006472a551f428722bd67742204c182 | train | tests/test_visitors/test_filenames/test_module/test_module_magic_name.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_module/test_module_magic_name.py | 37 | 4 | assert_* | test_simple_filename | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.constants import MAGIC_MODULE_NAMES_WHITELIST
from wemake_python_styleguide.violations.naming import (
WrongModuleMagicNameViolation,
)
from wemake_python_styleguide.visitors.filenames.module import (
WrongModuleNameVisitor,
)
@pytest.mark.... | [WrongModuleMagicNameViolation]) | added | f0b62d610b0f477fbe1931ddb855d9b6e55584f338e36b5279ac19623f7484ab | assert_*|test_simple_filename|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.constants import MAGIC_MODULE_NAMES_WHITELIST from wemake_python_styleguide.violations.naming import ( WrongModuleMagicNameViolation, ) from wemake_python_styleguide.visitors.filenames.module import ( WrongModuleNameVisito... | null | null | null |
wemake-services/wemake-python-styleguide | train | 91 | 9948bd0b4006472a551f428722bd67742204c182 | train | tests/test_visitors/test_filenames/test_module/test_module_name.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_module/test_module_name.py | 36 | 4 | assert_* | test_restricted_filename | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.constants import MODULE_NAMES_BLACKLIST
from wemake_python_styleguide.violations.naming import WrongModuleNameViolation
from wemake_python_styleguide.visitors.filenames.module import (
WrongModuleNameVisitor,
)
@pytest.mark.parametrize('filenam... | [WrongModuleNameViolation]) | added | 2f97e40a8e21f364fc0940e9a42627ee37f1cb0e3a8bb958132d44cfbafae1d8 | assert_*|test_restricted_filename|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.constants import MODULE_NAMES_BLACKLIST from wemake_python_styleguide.violations.naming import WrongModuleNameViolation from wemake_python_styleguide.visitors.filenames.module import ( WrongModuleNameVisitor, ) @pytest... | null | null | null |
wemake-services/wemake-python-styleguide | train | 91 | 9948bd0b4006472a551f428722bd67742204c182 | train | tests/test_visitors/test_filenames/test_module/test_module_name_length.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_module/test_module_name_length.py | 39 | 4 | assert_* | test_length_option | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
TooShortNameViolation,
WrongModuleNamePatternViolation,
)
from wemake_python_styleguide.visitors.filenames.module import (
WrongModuleNameVisitor,
)
@pytest.mark.parametrize('filename', [
'a.py',
'some... | filename.replace('.py', '')) | added | 77045bba938eb09b2034ebc9c763bd2107ae118aff12fd5dc301c06c8cf5cd1d | assert_*|test_length_option|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( TooShortNameViolation, WrongModuleNamePatternViolation, ) from wemake_python_styleguide.visitors.filenames.module import ( WrongModuleNameVisitor, ) @pytest.mark.parametrize('filename', [ 'a.py', '... | null | null | null |
wemake-services/wemake-python-styleguide | train | 91 | 9948bd0b4006472a551f428722bd67742204c182 | train | tests/test_visitors/test_filenames/test_module/test_module_pattern.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_module/test_module_pattern.py | 43 | 4 | assert_* | test_wrong_filename | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
WrongModuleNamePatternViolation,
)
from wemake_python_styleguide.visitors.filenames.module import (
WrongModuleNameVisitor,
)
@pytest.mark.parametrize('filename', [
'my_module.py',
'_prefixed.py',
'_pr... | [WrongModuleNamePatternViolation]) | added | 181c62a3d352ee14045906d55f9f054e4398b4abd4ae70e6f5a5287a9fe2fd23 | assert_*|test_wrong_filename|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( WrongModuleNamePatternViolation, ) from wemake_python_styleguide.visitors.filenames.module import ( WrongModuleNameVisitor, ) @pytest.mark.parametrize('filename', [ 'my_module.py', '_prefixed.py',... | null | null | null |
wemake-services/wemake-python-styleguide | train | 91 | 9948bd0b4006472a551f428722bd67742204c182 | train | tests/test_visitors/test_filenames/test_module/test_module_underscore_number.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_filenames/test_module/test_module_underscore_number.py | 28 | 4 | assert_* | test_filename_with_underscored_number | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
UnderscoredNumberNameViolation,
)
from wemake_python_styleguide.visitors.filenames.module import (
WrongModuleNameVisitor,
)
@pytest.mark.parametrize('filename', [
'version_2.py',
'custom_2_version.py',
])... | filename.replace('.py', '')) | added | 09950ef896526f2b194816420aa6773590ca06dd0e8f664143e9358a56177c09 | assert_*|test_filename_with_underscored_number|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( UnderscoredNumberNameViolation, ) from wemake_python_styleguide.visitors.filenames.module import ( WrongModuleNameVisitor, ) @pytest.mark.parametrize('filename', [ 'version_2.py'... | null | null | null |
wemake-services/wemake-python-styleguide | train | 92 | 600e2dd9223b2a3efff52b357e473dee85668d6d | 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 | dca0576b88adc2ed501749d7fe008bdc56ee98fb6cc4d3d323288af71fd01015 | 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]) | 168 | 4 |
wemake-services/wemake-python-styleguide | train | 92 | 600e2dd9223b2a3efff52b357e473dee85668d6d | train | tests/test_visitors/test_ast/test_classes/test_base_class.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_classes/test_base_class.py | 52 | 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: ...'
class_with_empty_base = 'class Meta(): ...'
nested_class_without_ba... | [RequiredBaseClassViolation]) | added | 3844fd325033cabcec603abde75328957520487fb3afdbf38103f3105e6aa08a | 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: ...' class_with_empty_base = 'class Meta(): ...' ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 92 | 600e2dd9223b2a3efff52b357e473dee85668d6d | train | tests/test_visitors/test_ast/test_imports/test_dotted_raw_import.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_imports/test_dotted_raw_import.py | 39 | 4 | assert_* | test_wrong_dotted_import | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
DottedRawImportViolation,
)
from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor
regular_import = 'import {0}'
regular_import_with_alias = 'import {0} as alias'
from_import = 'from {0} impo... | to_import) | added | 5eb2cc0b2c8b23f202eb279ebb46559e9b48345cb95b5edd2fd5b3537ea8a175 | assert_*|test_wrong_dotted_import|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( DottedRawImportViolation, ) from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor regular_import = 'import {0}' regular_import_with_alias = 'import {0} as alias' f... | null | null | null |
wemake-services/wemake-python-styleguide | train | 92 | 600e2dd9223b2a3efff52b357e473dee85668d6d | train | tests/test_visitors/test_ast/test_keywords/test_global.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_global.py | 89 | 4 | assert_* | test_nonlocal_keywords | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
WrongKeywordViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import WrongKeywordVisitor
global_in_module = """
some = 0
global some
"""
global_in_function = """
some = 0
def check_global():
... | [WrongKeywordViolation]) | added | 25cfb6846ffa01dbf330b971a704f9309b1978515f82d8970682dc9acbecbab8 | assert_*|test_nonlocal_keywords|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( WrongKeywordViolation, ) from wemake_python_styleguide.visitors.ast.keywords import WrongKeywordVisitor global_in_module = """ some = 0 global some """ global_in_function = """ some = 0... | null | null | null |
wemake-services/wemake-python-styleguide | train | 92 | 600e2dd9223b2a3efff52b357e473dee85668d6d | train | tests/test_visitors/test_ast/test_keywords/test_pass.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_pass.py | 63 | 4 | assert_* | test_pass_keyword | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
WrongKeywordViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import WrongKeywordVisitor
pass_function = """
def function():
pass
"""
pass_class = """
class Test(object):
pass
"""
pass_... | 'pass') | added | b412258612e0bab25c5dc0dcb61e27e589f960b1f028947b5b6fb6515e72f8c3 | assert_*|test_pass_keyword|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( WrongKeywordViolation, ) from wemake_python_styleguide.visitors.ast.keywords import WrongKeywordVisitor pass_function = """ def function(): pass """ pass_class = """ class Test(object): pass... | null | null | null |
wemake-services/wemake-python-styleguide | train | 92 | 600e2dd9223b2a3efff52b357e473dee85668d6d | train | tests/test_visitors/test_ast/test_naming/test_variable_self_reassignment.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_variable_self_reassignment.py | 71 | 4 | assert_* | test_self_variable_reassignment | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
ReassigningVariableToItselfViolation,
)
from wemake_python_styleguide.visitors.ast.naming import (
WrongVariableAssignmentVisitor,
)
wrong_fragment = """
test_variable = 5
test_variable = test_variable
"""
... | [ReassigningVariableToItselfViolation]) | added | 57aca379d1d438b2a0a702d955c839d6d12bc822e8c8d0e9f087ffbed0af4fe1 | assert_*|test_self_variable_reassignment|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( ReassigningVariableToItselfViolation, ) from wemake_python_styleguide.visitors.ast.naming import ( WrongVariableAssignmentVisitor, ) wrong_fragment = """ test_variable = 5 test... | null | null | null |
wemake-services/wemake-python-styleguide | train | 92 | 600e2dd9223b2a3efff52b357e473dee85668d6d | train | tests/test_visitors/test_tokenize/test_wrong_primitives/test_number_suffixes.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_wrong_primitives/test_number_suffixes.py | 38 | 4 | assert_* | test_bad_number_suffixes | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
BadNumberSuffixViolation,
)
from wemake_python_styleguide.visitors.tokenize.primitives import (
WrongPrimitivesVisitor,
)
@pytest.mark.parametrize('number', [
'0XFF',
'1.5E+10',
'0O11',
'0B100... | [BadNumberSuffixViolation]) | added | 1e296a70ce524d5d74688c1e43d8c89c6b9e6e379e86456b10e46fa556a67516 | assert_*|test_bad_number_suffixes|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( BadNumberSuffixViolation, ) from wemake_python_styleguide.visitors.tokenize.primitives import ( WrongPrimitivesVisitor, ) @pytest.mark.parametrize('number', [ '0XFF', '1.5E+10', '0O11', ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 92 | 600e2dd9223b2a3efff52b357e473dee85668d6d | train | tests/test_visitors/test_tokenize/test_wrong_primitives/test_unicode_prefix.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_tokenize/test_wrong_primitives/test_unicode_prefix.py | 35 | 4 | assert_* | test_unicode_prefix | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
UnicodeStringViolation,
)
from wemake_python_styleguide.visitors.tokenize.primitives import (
WrongPrimitivesVisitor,
)
@pytest.mark.parametrize('primitive', [
'u"text"',
"u'unicode'",
'u"5_5"',
... | primitive) | added | be3d18aaf005815450a9f7f16d16b6954c5f203474e45621208abdb924200e86 | assert_*|test_unicode_prefix|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( UnicodeStringViolation, ) from wemake_python_styleguide.visitors.tokenize.primitives import ( WrongPrimitivesVisitor, ) @pytest.mark.parametrize('primitive', [ 'u"text"', "u'unicode'", 'u"5_5... | null | null | null |
wemake-services/wemake-python-styleguide | train | 93 | 3269be931f6c836eee077f35a4ab3e0d2683fe64 | train | tests/test_violations/test_docs.py | train | wemake-services/wemake-python-styleguide:tests/test_violations/test_docs.py | 17 | 8 | assert | test_all_violations_have_description_with_code | # -*- coding: utf-8 -*-
from wemake_python_styleguide.options.config import Configuration
def test_all_violations_are_documented(all_module_violations):
"""Ensures that all violations are documented."""
for module, classes in all_module_violations.items():
for violation_class in classes:
... | violation.__doc__ | modified | 29385d8d1faf76eed2def3bba4f3929e5113ef8e172e48eb0c70a998f6d3865d | assert|test_all_violations_have_description_with_code|# -*- coding: utf-8 -*- from wemake_python_styleguide.options.config import Configuration def test_all_violations_are_documented(all_module_violations): """Ensures that all violations are documented.""" for module, classes in all_module_violations.items(): for viola... | violation.__doc__ | 15 | 8 |
wemake-services/wemake-python-styleguide | train | 93 | 3269be931f6c836eee077f35a4ab3e0d2683fe64 | train | tests/test_violations/test_docs.py | train | wemake-services/wemake-python-styleguide:tests/test_violations/test_docs.py | 30 | 8 | assert | test_violation_name | # -*- coding: utf-8 -*-
from wemake_python_styleguide.options.config import Configuration
def test_all_violations_are_documented(all_module_violations):
"""Ensures that all violations are documented."""
for module, classes in all_module_violations.items():
for violation_class in classes:
... | class_name.endswith('Violation') | modified | 0d8d3b30c962a4330a61b96277cb9ac8c384e9f78db67788ef6c3be61a62d9d2 | assert|test_violation_name|# -*- coding: utf-8 -*- from wemake_python_styleguide.options.config import Configuration def test_all_violations_are_documented(all_module_violations): """Ensures that all violations are documented.""" for module, classes in all_module_violations.items(): for violation_class in classes: # On... | class_name.endswith('Violation') | 28 | 8 |
wemake-services/wemake-python-styleguide | train | 93 | 3269be931f6c836eee077f35a4ab3e0d2683fe64 | train | tests/test_violations/test_docs.py | train | wemake-services/wemake-python-styleguide:tests/test_violations/test_docs.py | 40 | 12 | assert | test_violation_error_text | # -*- coding: utf-8 -*-
from wemake_python_styleguide.options.config import Configuration
def test_all_violations_are_documented(all_module_violations):
"""Ensures that all violations are documented."""
for module, classes in all_module_violations.items():
for violation_class in classes:
... | violation.error_template.endswith(error_format) | modified | 1fb4700eb08c275199291997957c7d5382466a46fa5b5aa3bbdf4189d57d009a | assert|test_violation_error_text|# -*- coding: utf-8 -*- from wemake_python_styleguide.options.config import Configuration def test_all_violations_are_documented(all_module_violations): """Ensures that all violations are documented.""" for module, classes in all_module_violations.items(): for violation_class in classes... | violation.error_template.endswith(error_format) | 38 | 12 |
wemake-services/wemake-python-styleguide | train | 93 | 3269be931f6c836eee077f35a4ab3e0d2683fe64 | train | tests/test_violations/test_docs.py | train | wemake-services/wemake-python-styleguide:tests/test_violations/test_docs.py | 57 | 16 | assert | test_configuration | # -*- coding: utf-8 -*-
from wemake_python_styleguide.options.config import Configuration
def test_all_violations_are_documented(all_module_violations):
"""Ensures that all violations are documented."""
for module, classes in all_module_violations.items():
for violation_class in classes:
... | violation.__doc__ | added | a443843ddcf0098468274fba03d93d2fe00d9dfc767d32b9f0318d0ab211276b | assert|test_configuration|# -*- coding: utf-8 -*- from wemake_python_styleguide.options.config import Configuration def test_all_violations_are_documented(all_module_violations): """Ensures that all violations are documented.""" for module, classes in all_module_violations.items(): for violation_class in classes: # Onc... | null | null | null |
wemake-services/wemake-python-styleguide | train | 94 | 2a2a4a5f88756fb244f91056d4c9930b3cca448c | train | tests/test_visitors/test_ast/test_comparisons/test_literal.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_literal.py | 81 | 4 | assert_* | test_literal_special1 | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ConstantComparisonViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
ComparisonSanityVisitor,
)
if_with_chained_comparisons1 = 'if 0 < {0} < {1}: ...'
if_with_chained_comparisons2 = '... | [ConstantComparisonViolation]) | modified | 2df2fe6e29de4c0f9e40ab89656229e0f9bcb1d9778879a469c64d2de2d8ee53 | assert_*|test_literal_special1|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ConstantComparisonViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( ComparisonSanityVisitor, ) if_with_chained_comparisons1 = 'if 0 < {0} < {1}: ...' if_with_chai... | [ConstantComparisonViolation]) | 82 | 4 |
wemake-services/wemake-python-styleguide | train | 94 | 2a2a4a5f88756fb244f91056d4c9930b3cca448c | train | tests/test_visitors/test_ast/test_comparisons/test_literal.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_literal.py | 105 | 4 | assert_* | test_literal_special2 | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ConstantComparisonViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
ComparisonSanityVisitor,
)
if_with_chained_comparisons1 = 'if 0 < {0} < {1}: ...'
if_with_chained_comparisons2 = '... | [ConstantComparisonViolation]) | modified | 44587bd95b5166ac8b2911d0f4aed284cef5d26ba00aa58173a8289b8f731eb4 | assert_*|test_literal_special2|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ConstantComparisonViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( ComparisonSanityVisitor, ) if_with_chained_comparisons1 = 'if 0 < {0} < {1}: ...' if_with_chai... | [ConstantComparisonViolation]) | 107 | 4 |
wemake-services/wemake-python-styleguide | train | 94 | 2a2a4a5f88756fb244f91056d4c9930b3cca448c | train | tests/test_visitors/test_ast/test_comparisons/test_order.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_order.py | 85 | 4 | assert_* | test_comparison_wrong_order | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ComparisonOrderViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
WrongComparisionOrderVisitor,
)
@pytest.mark.parametrize('comparators', [
('first_name', 'second_name'),
('f... | [ComparisonOrderViolation]) | added | 12cfd1006c0848abffa0fb78942454b8de797588b7f49b8f0c86984539468faf | assert_*|test_comparison_wrong_order|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ComparisonOrderViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( WrongComparisionOrderVisitor, ) @pytest.mark.parametrize('comparators', [ ('first_name', 's... | null | null | null |
wemake-services/wemake-python-styleguide | train | 94 | 2a2a4a5f88756fb244f91056d4c9930b3cca448c | train | tests/test_visitors/test_ast/test_comparisons/test_order.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_comparisons/test_order.py | 110 | 4 | assert_* | test_comparison_wrong_order_multiple | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
ComparisonOrderViolation,
)
from wemake_python_styleguide.visitors.ast.comparisons import (
WrongComparisionOrderVisitor,
)
@pytest.mark.parametrize('comparators', [
('first_name', 'second_name'),
('f... | [ ComparisonOrderViolation, ComparisonOrderViolation, ]) | added | 70529d327dc3cce40f0c49a38da10dcb6dcd44004250eefddbc4f1b40ede8e20 | assert_*|test_comparison_wrong_order_multiple|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.consistency import ( ComparisonOrderViolation, ) from wemake_python_styleguide.visitors.ast.comparisons import ( WrongComparisionOrderVisitor, ) @pytest.mark.parametrize('comparators', [ ('first_... | null | null | null |
wemake-services/wemake-python-styleguide | train | 94 | 2a2a4a5f88756fb244f91056d4c9930b3cca448c | train | tests/test_visitors/test_ast/test_complexity/test_counts/test_condition_counts.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_counts/test_condition_counts.py | 117 | 4 | assert_* | test_module_condition_counts_violation | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.complexity.counts import (
ConditionsVisitor,
TooManyConditionsViolation,
)
empty_module = ''
assignment = 'some = x > y or None'
condition_with_single_if = """
if 4 > 2 and 3 / 2 == 1.5:
print(1)
"""
condition_with_single... | [TooManyConditionsViolation]) | added | 2f940dc8bbb477f314fa25f4486db041667dcfef607b9b44fc153cb7e8b5a5c7 | assert_*|test_module_condition_counts_violation|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.complexity.counts import ( ConditionsVisitor, TooManyConditionsViolation, ) empty_module = '' assignment = 'some = x > y or None' condition_with_single_if = """ if 4 > 2 and 3 / 2 == 1.5: pri... | null | null | null |
wemake-services/wemake-python-styleguide | train | 94 | 2a2a4a5f88756fb244f91056d4c9930b3cca448c | train | tests/test_visitors/test_ast/test_complexity/test_function/test_elifs.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_function/test_elifs.py | 142 | 4 | assert_* | test_elif_incorrect_count | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.complexity.function import (
FunctionComplexityVisitor,
TooManyElifsViolation,
)
function_with_one_elif = """
def test_module():
if 1 > 2:
...
elif 2 > 3:
...
else:
...
"""
function_with_two_... | [TooManyElifsViolation]) | added | f7416256d54472a984936902213b712f0250783bd854054f14872c3f5e1c4f63 | assert_*|test_elif_incorrect_count|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.complexity.function import ( FunctionComplexityVisitor, TooManyElifsViolation, ) function_with_one_elif = """ def test_module(): if 1 > 2: ... elif 2 > 3: ... else: ... """ function_with_two_elifs = """ d... | null | null | null |
wemake-services/wemake-python-styleguide | train | 94 | 2a2a4a5f88756fb244f91056d4c9930b3cca448c | train | tests/test_visitors/test_ast/test_complexity/test_offset_visitor.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_offset_visitor.py | 119 | 4 | assert_* | test_nested_offset_errors | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.complexity.offset import (
OffsetVisitor,
TooDeepNestingViolation,
)
nested_if = """
def container():
if True:
x = 1
"""
nested_if2 = """
def container():
if some_value:
call_other()
"""
nested_for = ""... | errors) | added | 7f61ef1ad0bf5dc1168dd0bbf722a71c6207f7d92d621c345689070485a50742 | assert_*|test_nested_offset_errors|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.complexity.offset import ( OffsetVisitor, TooDeepNestingViolation, ) nested_if = """ def container(): if True: x = 1 """ nested_if2 = """ def container(): if some_value: call_other() """ nested_for = """ ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 94 | 2a2a4a5f88756fb244f91056d4c9930b3cca448c | train | tests/test_visitors/test_ast/test_complexity/test_offset_visitor.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_offset_visitor.py | 145 | 4 | assert_* | test_nested_offset_error_text | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.complexity.offset import (
OffsetVisitor,
TooDeepNestingViolation,
)
nested_if = """
def container():
if True:
x = 1
"""
nested_if2 = """
def container():
if some_value:
call_other()
"""
nested_for = ""... | [TooDeepNestingViolation]) | added | 902b88668bfff60659dfb12ad6599ef8ec0828602d2e5922c61784a23efa01c0 | assert_*|test_nested_offset_error_text|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.complexity.offset import ( OffsetVisitor, TooDeepNestingViolation, ) nested_if = """ def container(): if True: x = 1 """ nested_if2 = """ def container(): if some_value: call_other() """ nested_for = ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 95 | 1758c4342d0a295a0ee29412f35920a8ff9d4d17 | 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 | 63 | 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 | ebbadfe1e5d33c070924cffc8c756809db4101912f38ab1cacd96b4b21fdb2d0 | 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 | 95 | 1758c4342d0a295a0ee29412f35920a8ff9d4d17 | 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 | 85 | 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]) | added | d85d95a645fccac30683f0d8ae7d0081d11ad85c26e07f21b5acb466b327f77f | 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} """ ... | null | null | null |
wemake-services/wemake-python-styleguide | train | 95 | 1758c4342d0a295a0ee29412f35920a8ff9d4d17 | 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 | 99 | 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]) | added | 4486fbe3f45f27ebc81f38470954cd5ad5e2f34dc96de06d0d91524d7d5a2a05 | 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} """ @... | null | null | null |
wemake-services/wemake-python-styleguide | train | 95 | 1758c4342d0a295a0ee29412f35920a8ff9d4d17 | train | tests/test_visitors/test_ast/test_complexity/test_classes/test_bases_classes_counts.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_classes/test_bases_classes_counts.py | 62 | 4 | assert_* | test_bad_number_default_option | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.complexity import (
TooManyBaseClassesViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.classes import (
ClassComplexityVisitor,
)
correct_count = """
class CorrectClassName(
FirstParentClass,
SecondParent... | [TooManyBaseClassesViolation]) | modified | ef60de859ce28486a665972ef65577b62993623a827afd59867192d1cb4b62f1 | assert_*|test_bad_number_default_option|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.complexity import ( TooManyBaseClassesViolation, ) from wemake_python_styleguide.visitors.ast.complexity.classes import ( ClassComplexityVisitor, ) correct_count = """ class CorrectClassName( FirstPare... | [TooManyBaseClassesViolation]) | 60 | 4 |
wemake-services/wemake-python-styleguide | train | 96 | e428aab6e79409b9a10dd2134cd1b8685bdc2213 | train | tests/test_violations/test_docs.py | train | wemake-services/wemake-python-styleguide:tests/test_violations/test_docs.py | 17 | 8 | assert | test_all_violations_have_versionadded | # -*- coding: utf-8 -*-
from wemake_python_styleguide.options.config import Configuration
def test_all_violations_are_documented(all_module_violations):
"""Ensures that all violations are documented."""
for module, classes in all_module_violations.items():
for violation_class in classes:
... | violation.__doc__ | added | aff9c05c61a014257c93d1433df171c3ed597cc123ecc903d44049697b39da9a | assert|test_all_violations_have_versionadded|# -*- coding: utf-8 -*- from wemake_python_styleguide.options.config import Configuration def test_all_violations_are_documented(all_module_violations): """Ensures that all violations are documented.""" for module, classes in all_module_violations.items(): for violation_clas... | null | null | null |
wemake-services/wemake-python-styleguide | train | 96 | e428aab6e79409b9a10dd2134cd1b8685bdc2213 | train | tests/test_violations/test_docs.py | train | wemake-services/wemake-python-styleguide:tests/test_violations/test_docs.py | 24 | 8 | assert | test_violation_name | # -*- coding: utf-8 -*-
from wemake_python_styleguide.options.config import Configuration
def test_all_violations_are_documented(all_module_violations):
"""Ensures that all violations are documented."""
for module, classes in all_module_violations.items():
for violation_class in classes:
... | class_name.endswith('Violation') | added | f6fdb3076631b12fe972f353fe7bffc85758a622444a6ace70646181f98efb60 | assert|test_violation_name|# -*- coding: utf-8 -*- from wemake_python_styleguide.options.config import Configuration def test_all_violations_are_documented(all_module_violations): """Ensures that all violations are documented.""" for module, classes in all_module_violations.items(): for violation_class in classes: # On... | null | null | null |
wemake-services/wemake-python-styleguide | train | 96 | e428aab6e79409b9a10dd2134cd1b8685bdc2213 | train | tests/test_violations/test_docs.py | train | wemake-services/wemake-python-styleguide:tests/test_violations/test_docs.py | 33 | 12 | assert | test_violation_error_text | # -*- coding: utf-8 -*-
from wemake_python_styleguide.options.config import Configuration
def test_all_violations_are_documented(all_module_violations):
"""Ensures that all violations are documented."""
for module, classes in all_module_violations.items():
for violation_class in classes:
... | violation.error_template | added | 9ea28a5a04c877f56bcbe81f43b19b85869f2a0e0f58e4fede8e11bd634f885a | assert|test_violation_error_text|# -*- coding: utf-8 -*- from wemake_python_styleguide.options.config import Configuration def test_all_violations_are_documented(all_module_violations): """Ensures that all violations are documented.""" for module, classes in all_module_violations.items(): for violation_class in classes... | null | null | null |
wemake-services/wemake-python-styleguide | train | 96 | e428aab6e79409b9a10dd2134cd1b8685bdc2213 | train | tests/test_violations/test_docs.py | train | wemake-services/wemake-python-styleguide:tests/test_violations/test_docs.py | 51 | 16 | assert | test_configuration | # -*- coding: utf-8 -*-
from wemake_python_styleguide.options.config import Configuration
def test_all_violations_are_documented(all_module_violations):
"""Ensures that all violations are documented."""
for module, classes in all_module_violations.items():
for violation_class in classes:
... | violation.__doc__ | added | bf8e8014170da8956e75975335558ecb352bdd2a9a8af0d50787e1ec80d8f6c1 | assert|test_configuration|# -*- coding: utf-8 -*- from wemake_python_styleguide.options.config import Configuration def test_all_violations_are_documented(all_module_violations): """Ensures that all violations are documented.""" for module, classes in all_module_violations.items(): for violation_class in classes: # Onc... | null | null | null |
wemake-services/wemake-python-styleguide | train | 97 | d3304e547d927708e0c25fe28e9ece4d43226ccb | train | tests/test_visitors/conftest.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/conftest.py | 18 | 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... | len(visitor.violations) | added | f94d0126aa67e064bf10f104d189ce24daf378834f8a0b123409e65f44b7c0fc | 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... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 97 | d3304e547d927708e0c25fe28e9ece4d43226ccb | train | tests/test_visitors/conftest.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/conftest.py | 21 | 12 | 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... | errors[index].code | added | b5f8fa4d0a8c9bdcd6c2aa194af6e3490bd8eac2a9d704fb05e6112ecc90d9af | 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... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 97 | d3304e547d927708e0c25fe28e9ece4d43226ccb | train | tests/test_visitors/conftest.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/conftest.py | 35 | 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.__class__.should_use_text | added | f8ccbfbc6ec8a2e7f8da5c6204556b929bd0bd88669128ee36ce77ac8ffa5981 | 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... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 97 | d3304e547d927708e0c25fe28e9ece4d43226ccb | train | tests/test_visitors/conftest.py | val | wemake-services/wemake-python-styleguide:tests/test_visitors/conftest.py | 41 | 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() | added | 9d2666cdc078a6cadc3c3ac940e7f07cb1801c6e5af5ad86f86fdfe99fbe6d8d | 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... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 98 | 8b9cfd896ae500e99a5a47a5f10386150a26082c | train | tests/fixtures/noqa.py | train | wemake-services/wemake-python-styleguide:tests/fixtures/noqa.py | 131 | 0 | assert | """
This file contains all possible violations.
It is used for e2e tests.
"""
from __future__ import print_function # noqa: Z422
from .version import get_version # noqa: Z300
import os.path # noqa: Z301
import sys as sys # noqa: Z113
from some import _protected # noqa: Z440
full_name = u'Nikita Sobolev' # noq... | octal_number | added | ecb9ad02268f1bbd2887c473aa93da3e9a282ab6fc73197d89bfdeb5360ced36 | assert||""" This file contains all possible violations. It is used for e2e tests. """ from __future__ import print_function # noqa: Z422 from .version import get_version # noqa: Z300 import os.path # noqa: Z301 import sys as sys # noqa: Z113 from some import _protected # noqa: Z440 full_name = u'Nikita Sobolev' # noqa:... | null | null | null | |
wemake-services/wemake-python-styleguide | train | 98 | 8b9cfd896ae500e99a5a47a5f10386150a26082c | train | tests/test_visitors/test_ast/test_complexity/test_counts/test_elifs.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_complexity/test_counts/test_elifs.py | 214 | 4 | assert_* | test_elif_incorrect_count | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.complexity.counts import (
ElifVisitor,
TooManyElifsViolation,
)
module_with_one_elif = """
if 1 > 2:
...
elif 2 > 3:
...
else:
...
"""
module_with_two_elifs = """
if 1 > 2:
...
elif 2 > 3:
...
elif 3 > 4:
... | [TooManyElifsViolation]) | added | da24164a22ed1309cd70bcfc23861505c8459b5efc119ac595b7626c0cac6f49 | assert_*|test_elif_incorrect_count|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.complexity.counts import ( ElifVisitor, TooManyElifsViolation, ) module_with_one_elif = """ if 1 > 2: ... elif 2 > 3: ... else: ... """ module_with_two_elifs = """ if 1 > 2: ... elif 2 > 3: ... elif 3 > 4... | null | null | null |
wemake-services/wemake-python-styleguide | train | 98 | 8b9cfd896ae500e99a5a47a5f10386150a26082c | train | tests/test_visitors/test_ast/test_keywords/test_comprehensions/test_for_count.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_comprehensions/test_for_count.py | 115 | 4 | assert_* | test_multiple_for_keywords_in_async_comprehension | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.keywords import (
TooManyForsInComprehensionViolation,
WrongComprehensionVisitor,
)
regular_loop_comprehension = """
nodes = [
target
for assignment in top_level_assigns
for target in assignment.targets
]
"""
comple... | [TooManyForsInComprehensionViolation]) | added | 04f49c6e2ea4968f31b4f14b16a166d8ea17bb079145baace1881dd1528922a9 | assert_*|test_multiple_for_keywords_in_async_comprehension|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.keywords import ( TooManyForsInComprehensionViolation, WrongComprehensionVisitor, ) regular_loop_comprehension = """ nodes = [ target for assignment in top_level_assigns for target... | null | null | null |
wemake-services/wemake-python-styleguide | train | 98 | 8b9cfd896ae500e99a5a47a5f10386150a26082c | train | tests/test_visitors/test_ast/test_keywords/test_comprehensions/test_ifs_count.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/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.keywords import (
WrongComprehensionVisitor,
)
# Lists:
list_ifs_multiple = """
def container():
nodes = [xy for xy in "ab... | [MultipleIfsInComprehensionViolation]) | added | 09c5cb6a1c104bb727bb3845867cc89c4376ab3a3685a3d6fdc898c524422472 | 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.keywords import ( WrongComprehensionVisitor, ) # Lists: list_ifs_multiple = """ def co... | null | null | null |
wemake-services/wemake-python-styleguide | train | 98 | 8b9cfd896ae500e99a5a47a5f10386150a26082c | train | tests/test_visitors/test_ast/test_keywords/test_loops/test_for_else.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_loops/test_for_else.py | 126 | 4 | assert_* | test_wrong_else_in_for_loop | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
RedundantForElseViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import WrongLoopVisitor
wrong_else_in_for_loop = """
for x in '123':
...
else:
...
"""
wrong_nested_else_in_for_loop = "... | [RedundantForElseViolation]) | modified | 04912a31141878337a9acbce4b3708b683f6f686405d69a911a56ffaa512e47e | assert_*|test_wrong_else_in_for_loop|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( RedundantForElseViolation, ) from wemake_python_styleguide.visitors.ast.keywords import WrongLoopVisitor wrong_else_in_for_loop = """ for x in '123': ... else: ... """ wrong_nested... | [RedundantForElseViolation]) | 126 | 4 |
wemake-services/wemake-python-styleguide | train | 98 | 8b9cfd896ae500e99a5a47a5f10386150a26082c | train | tests/test_visitors/test_ast/test_keywords/test_loops/test_lambda_in_loop.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_keywords/test_loops/test_lambda_in_loop.py | 51 | 4 | assert_* | test_lambda_body | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.ast.keywords import (
LambdaInsideLoopViolation,
WrongLoopVisitor,
)
lambda_inside_for_loop = """
for index in range(10):
print(lambda: index)
"""
nested_lambda_inside_for_loop = """
for index in range(10):
if some:
... | [LambdaInsideLoopViolation]) | added | 38814feb0ccb1d4f0255ba83f0c7e053dfdf3681e6282d32cb2bd63ffb68aa59 | assert_*|test_lambda_body|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.ast.keywords import ( LambdaInsideLoopViolation, WrongLoopVisitor, ) lambda_inside_for_loop = """ for index in range(10): print(lambda: index) """ nested_lambda_inside_for_loop = """ for index in range(10): if some: p... | null | null | null |
wemake-services/wemake-python-styleguide | train | 98 | 8b9cfd896ae500e99a5a47a5f10386150a26082c | 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 | 44 | 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_exception =... | [BaseExceptionViolation]) | modified | caafd2265e8057ff8a36ef71457c1a1a5aa664893fed79501a0406e267887542 | 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_e... | [BaseExceptionViolation]) | 46 | 4 |
wemake-services/wemake-python-styleguide | train | 98 | 8b9cfd896ae500e99a5a47a5f10386150a26082c | 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 | 46 | 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:
...
final... | [RedundantFinallyViolation]) | modified | b84912a9de6380b60bf0c8169f1038b734f9873515593243b1236b4a226977a3 | 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]) | 48 | 4 |
wemake-services/wemake-python-styleguide | train | 99 | a4aa15574ec42f0084a5062e16f155aeeb346881 | train | tests/test_visitors/test_ast/test_functions/test_unused_arguments.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_functions/test_unused_arguments.py | 165 | 4 | assert_* | test_regular_arguments_unused_override | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
UnusedArgumentIsUsedViolation,
UnusedArgumentViolation,
)
from wemake_python_styleguide.visitors.ast.functions import (
FunctionDefinitionVisitor,
)
regular_function_argument = """
def proxy({0}):
{... | [UnusedArgumentViolation]) | added | de32dae5aba783e57047258b3ce4600b23dbf4e9470b1bfde95b58c51f1fa686 | assert_*|test_regular_arguments_unused_override|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( UnusedArgumentIsUsedViolation, UnusedArgumentViolation, ) from wemake_python_styleguide.visitors.ast.functions import ( FunctionDefinitionVisitor, ) regular_function_arg... | null | null | null |
wemake-services/wemake-python-styleguide | train | 99 | a4aa15574ec42f0084a5062e16f155aeeb346881 | train | tests/test_visitors/test_ast/test_functions/test_unused_lambda_arguments.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_functions/test_unused_lambda_arguments.py | 126 | 4 | assert_* | test_unused_arguments_used | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
UnusedArgumentIsUsedViolation,
UnusedArgumentViolation,
)
from wemake_python_styleguide.visitors.ast.functions import (
FunctionDefinitionVisitor,
)
lambda_function_argument = 'lambda {0}: {1}'
lambda_f... | [UnusedArgumentIsUsedViolation]) | added | 0c3d42b21c0e114ebe991ea25e6bf5d04115d2c43570dc4b687b73952c439bdf | assert_*|test_unused_arguments_used|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.best_practices import ( UnusedArgumentIsUsedViolation, UnusedArgumentViolation, ) from wemake_python_styleguide.visitors.ast.functions import ( FunctionDefinitionVisitor, ) lambda_function_argument = 'lamb... | null | null | null |
wemake-services/wemake-python-styleguide | train | 99 | a4aa15574ec42f0084a5062e16f155aeeb346881 | train | tests/test_visitors/test_ast/test_functions/test_wrong_function_calls.py | test | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_functions/test_wrong_function_calls.py | 44 | 4 | assert_* | test_wrong_function_called | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.constants import FUNCTIONS_BLACKLIST
from wemake_python_styleguide.violations.best_practices import (
WrongFunctionCallViolation,
)
from wemake_python_styleguide.visitors.ast.functions import (
WrongFunctionCallVisitor,
)
regular_call = '{0}... | bad_function) | added | 4da7fb7272670d1e9aa9a552e4e9b2daf309c3ec71d06c05b5bdadb73b1883b8 | assert_*|test_wrong_function_called|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.constants import FUNCTIONS_BLACKLIST from wemake_python_styleguide.violations.best_practices import ( WrongFunctionCallViolation, ) from wemake_python_styleguide.visitors.ast.functions import ( WrongFunctionCallVisit... | null | null | null |
wemake-services/wemake-python-styleguide | train | 99 | a4aa15574ec42f0084a5062e16f155aeeb346881 | 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',
... | underscored_name) | added | 1810a7aa1e61ac1ec8631a2615bc20086f2ac6a94f5b33e6959ae8c2c26e33de | 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... | null | null | null |
wemake-services/wemake-python-styleguide | train | 99 | a4aa15574ec42f0084a5062e16f155aeeb346881 | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_restricted_argument.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_restricted_argument.py | 34 | 4 | assert_* | test_restricted_argument_name | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.constants import SPECIAL_ARGUMENT_NAMES_WHITELIST
from wemake_python_styleguide.violations.naming import (
ReservedArgumentNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
@pytest.mark.parametrize('argu... | [ReservedArgumentNameViolation]) | added | 5dcb0f024fbd846bf0cc9c3ba5afc7e65b91355b73c03e5d5d39cbb41a887c5d | assert_*|test_restricted_argument_name|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.constants import SPECIAL_ARGUMENT_NAMES_WHITELIST from wemake_python_styleguide.violations.naming import ( ReservedArgumentNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor... | null | null | null |
wemake-services/wemake-python-styleguide | train | 99 | a4aa15574ec42f0084a5062e16f155aeeb346881 | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_short.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_short.py | 22 | 4 | assert_* | test_short_variable_name | # -*- coding: utf-8 -*-
from wemake_python_styleguide.violations.naming import TooShortNameViolation
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
def test_short_variable_name(
assert_errors,
assert_error_text,
parse_ast_tree,
naming_template,
default_options,
mode... | [TooShortNameViolation]) | added | c24d3f837c8adfa251d4644d10dd471fb83c7b9c9ce147cefb53886a91a70cc1 | assert_*|test_short_variable_name|# -*- coding: utf-8 -*- from wemake_python_styleguide.violations.naming import TooShortNameViolation from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor def test_short_variable_name( assert_errors, assert_error_text, parse_ast_tree, naming_template, default_option... | null | null | null |
wemake-services/wemake-python-styleguide | train | 99 | a4aa15574ec42f0084a5062e16f155aeeb346881 | train | tests/test_visitors/test_ast/test_naming/test_naming_rules/test_underscored_number.py | train | wemake-services/wemake-python-styleguide:tests/test_visitors/test_ast/test_naming/test_naming_rules/test_underscored_number.py | 31 | 4 | assert_* | test_number_prefix_variable_name | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.naming import (
UnderscoredNumberNameViolation,
)
from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor
@pytest.mark.parametrize('number_suffix', [
'number_5',
'between_45_letters',
'with_multiple_grou... | [UnderscoredNumberNameViolation]) | added | f9ed40f6ee34b816792a005ae595edf1a14d274d7966e9033660f351f4cfb244 | assert_*|test_number_prefix_variable_name|# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.violations.naming import ( UnderscoredNumberNameViolation, ) from wemake_python_styleguide.visitors.ast.naming import WrongNameVisitor @pytest.mark.parametrize('number_suffix', [ 'number_5', 'between_45_letters... | null | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.