Skip to content

Commit

Permalink
Merge branch 'issue#11' into issue-wemake-services#1081: add document…
Browse files Browse the repository at this point in the history
…ation on the new rule. closes #11.
  • Loading branch information
Mael MADON committed Feb 23, 2020
2 parents ebca79d + fb08aa5 commit 84cf67f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions wemake_python_styleguide/violations/consistency.py
Expand Up @@ -2113,20 +2113,25 @@ class IterableUnpackingViolation(ASTViolation):

@final
class RawStringNotNeededViolation(TokenizeViolation):
"""
Summary here.
r"""
Forbid the use of raw strings when there is no backslash in the string.
Reasoning:
Reasoning here.
Raw string are only needed when dealing with \ in the string.
Solution:
Solution here.
Do not prefix the string with r. Use a normal string instead.
Example::
Examples here.
# Correct:
s = r'This is a correct use \'
# Wrong:
s = r'This string should not be prefixed with r.'
.. versionadded:: 0.13.0
"""

error_template = 'Error template here'
error_template = 'Found an unnecessary use of a raw string'
code = 357

0 comments on commit 84cf67f

Please sign in to comment.