Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blablatdinov committed Sep 12, 2022
1 parent b11609c commit a30ad0b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_checker/test_noqa.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
'WPS613': 1,
'WPS614': 1,
'WPS615': 2,
'WPS473': 0,
})

# Violations which may be tweaked by `i_control_code` option:
Expand Down
1 change: 1 addition & 0 deletions tests/test_options/test_option_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ def test_option_docs():
"""Ensures that all options are documented."""
for option in config.Configuration._options: # noqa: WPS437
option_name = '``{0}``'.format(option.long_option_name[2:])
print(config.__doc__)
assert option_name in config.__doc__


Expand Down
3 changes: 3 additions & 0 deletions wemake_python_styleguide/options/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
- ``forbidden-inline-ignore`` - list of codes of violations or
class of violations that are forbidden to ignore inline, defaults to
:str:`wemake_python_styleguide.options.defaults.FORBIDDEN_INLINE_IGNORE`
- ``available-expressions-for-one-empty-line`` - number of expressions in
function or method body for available empty line (without code)
:str:`wemake_python_styleguide.options.defaults.AVAILABLE_EXPRESSIONS_FOR_ONE_EMPTY_LINE`
.. rubric:: Complexity options
Expand Down
3 changes: 3 additions & 0 deletions wemake_python_styleguide/presets/types/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
redundancy,
statements,
subscripts,
function_empty_lines,
)

#: Used to store all general visitors to be later passed to checker:
Expand Down Expand Up @@ -107,6 +108,8 @@

redundancy.RedundantEnumerateVisitor,

function_empty_lines.WrongEmptyLinesCountVisitor,

# Modules:
modules.EmptyModuleContentsVisitor,
modules.MagicModuleFunctionsVisitor,
Expand Down
7 changes: 7 additions & 0 deletions wemake_python_styleguide/violations/best_practices.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
KwargsUnpackingInClassDefinitionViolation
ConsecutiveSlicesViolation
GettingElementByUnpackingViolation
WrongEmptyLinesCountViolation
Best practices
--------------
Expand Down Expand Up @@ -166,6 +167,7 @@
.. autoclass:: KwargsUnpackingInClassDefinitionViolation
.. autoclass:: ConsecutiveSlicesViolation
.. autoclass:: GettingElementByUnpackingViolation
.. autoclass:: WrongEmptyLinesCountViolation
"""

Expand Down Expand Up @@ -2802,6 +2804,11 @@ def func(name):
baz()
Configuration:
This rule is configurable with ``--available-expressions-for-one-empty-line``.
Default:
:str:`wemake_python_styleguide.options.defaults.AVAILABLE_EXPRESSIONS_FOR_ONE_EMPTY_LINE`
.. versionadded:: 0.17.0
"""
Expand Down

0 comments on commit a30ad0b

Please sign in to comment.