Skip to content

Commit

Permalink
Removed check for long name in naming.py; will be refactored later
Browse files Browse the repository at this point in the history
Also removed test in test_naming until _check_name is refactored

Removed instances of previous TooLongNameViolation tests in naming.py and test_naming.py
  • Loading branch information
Casva committed Nov 4, 2018
1 parent c552476 commit eb1ba18
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
2 changes: 1 addition & 1 deletion tests/test_checker/test_noqa.py
Expand Up @@ -40,7 +40,7 @@ def test_noqa_fixture_disabled(absolute_path, all_violations):
'Z114': 1,
'Z115': 1,
'Z116': 1,
'Z117': 1,
'Z117': 0,

'Z200': 0,
'Z201': 0,
Expand Down
19 changes: 0 additions & 19 deletions tests/test_visitors/test_ast/test_naming/test_naming.py
Expand Up @@ -6,7 +6,6 @@
from wemake_python_styleguide.violations.naming import (
ConsecutiveUnderscoresInNameViolation,
PrivateNameViolation,
TooLongNameViolation,
TooShortNameViolation,
UnderscoredNumberNameViolation,
WrongVariableNameViolation,
Expand Down Expand Up @@ -142,21 +141,3 @@ def test_naming_correct(

assert_errors(visitor, [])


def test_long_variable_name(
assert_errors,
assert_error_text,
parse_ast_tree,
naming_template,
default_options,
mode,
):
"""Ensures that long names are not allowed."""
long_name = 'incredibly_and_very_long_name_that_will_definitely_not_work'
tree = parse_ast_tree(mode(naming_template.format(long_name)))

visitor = WrongNameVisitor(default_options, tree=tree)
visitor.run()

assert_errors(visitor, [TooLongNameViolation])
assert_error_text(visitor, long_name)
5 changes: 0 additions & 5 deletions wemake_python_styleguide/visitors/ast/naming.py
Expand Up @@ -16,7 +16,6 @@
from wemake_python_styleguide.violations.naming import (
ConsecutiveUnderscoresInNameViolation,
PrivateNameViolation,
TooLongNameViolation,
TooShortNameViolation,
UnderscoredNumberNameViolation,
UpperCaseAttributeViolation,
Expand Down Expand Up @@ -66,10 +65,6 @@ def _check_name(self, node: ast.AST, name: str) -> None:
ConsecutiveUnderscoresInNameViolation(node, text=name),
)

max_length = self.options.max_name_length
if logical.is_too_long_name(name, max_length=max_length):
self.add_violation(TooLongNameViolation(node, text=name))

def _check_function_signature(self, node: AnyFunctionDef) -> None:
for arg in node.args.args:
self._check_name(node, arg.arg)
Expand Down

0 comments on commit eb1ba18

Please sign in to comment.