rspec/rules/S1717/python/rule.adoc

41 lines
777 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
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\'"++``
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
2022-02-04 17:28:24 +01:00
[source,python]
2021-04-28 16:49:39 +02:00
----
s = "Hello \world."
t = "Nice to \ meet you"
u = "Let's have \ lunch"
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,python]
2021-04-28 16:49:39 +02:00
----
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[]