Skip to content

Commit

Permalink
Merge branch 'issue-wemake-services#1160' into issue-#14
Browse files Browse the repository at this point in the history
  • Loading branch information
iZafiro committed Feb 25, 2020
2 parents 6e2dca9 + 1900847 commit 8db35f7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions wemake_python_styleguide/violations/complexity.py
Original file line number Diff line number Diff line change
Expand Up @@ -1101,21 +1101,25 @@ class TooComplexAnnotationViolation(ASTViolation):
@final
class TooManyRaisesViolation(ASTViolation):
"""
Summary here.
Forbids too many raise statements in a function.
Reasoning:
Reasoning here.
Too many raise statements in a function make the code
untraceable and overcomplicated.
Solution:
Solution here.
Split the function into smaller functions, such that
each of them can raise less errors.
Create more standard errors, or use alternative ways to
raise them.
Configuration:
This rule is configurable with ``--max-raises``.
Default:
:str:`wemake_python_styleguide.options.defaults.MAX_RAISES`
See also:
Links here.
https://stackoverflow.com/questions/2052390/manually-raising-throwing-an-exception-in-python
.. versionadded:: 0.15.0
Expand Down

0 comments on commit 8db35f7

Please sign in to comment.