rspec/rules/S5855/python/rule.adoc

20 lines
300 B
Plaintext
Raw Normal View History

include::../description.adoc[]
== Noncompliant Code Example
2022-02-04 17:28:24 +01:00
[source,python]
----
r"[ab]|a" # The "|a" is redundant because "[ab]" already matches "a"
r".*|a" # .* matches everything, so any other alternative is redundant
----
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,python]
----
r"[ab]"
r".*"
----