rspec/rules/S1717/python/rule.adoc
2022-02-04 16:28:24 +00:00

41 lines
777 B
Plaintext

Typically, backslashes are seen only as part of escape sequences. Therefore, the use of a backslash outside of a raw string or escape sequence looks suspiciously like a broken escape sequence.
Characters recognized as escape-able are: ``++abfnrtvox\'"++``
== Noncompliant Code Example
[source,python]
----
s = "Hello \world."
t = "Nice to \ meet you"
u = "Let's have \ lunch"
----
== Compliant Solution
[source,python]
----
s = "Hello world."
t = "Nice to \\ meet you"
u = r"Let's have \ lunch" // raw string
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]