Modify rule S6331: Add Python as covered language (#798)
This commit is contained in:
parent
f307690d5a
commit
e39785564d
@ -1,6 +1,6 @@
|
||||
There are several reasons to use a group in a regular expression:
|
||||
|
||||
* to change the precedence (e.g. ``++/do(g|or)/++`` will match 'dog' and 'door')
|
||||
* to change the precedence (e.g. `do(g|or)` will match 'dog' and 'door')
|
||||
* to remember parenthesised part of the match in the case of capturing group
|
||||
* to improve readability
|
||||
|
||||
|
17
rules/S6331/implementation.adoc
Normal file
17
rules/S6331/implementation.adoc
Normal file
@ -0,0 +1,17 @@
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
(visible only on this page)
|
||||
|
||||
== Message
|
||||
|
||||
Remove this empty group.
|
||||
|
||||
== Highlighting
|
||||
|
||||
The empty group should be highlighted.
|
||||
|
||||
'''
|
||||
|
||||
endif::env-github,rspecator-view[]
|
@ -14,20 +14,4 @@ include::../description.adoc[]
|
||||
"/foo\(\)/" // Matches 'foo()'
|
||||
----
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
(visible only on this page)
|
||||
|
||||
== Message
|
||||
|
||||
Remove this empty group.
|
||||
|
||||
== Highlighting
|
||||
|
||||
The empty group should be highlighted.
|
||||
|
||||
'''
|
||||
|
||||
endif::env-github,rspecator-view[]
|
||||
include::../implementation.adoc[]
|
||||
|
2
rules/S6331/python/metadata.json
Normal file
2
rules/S6331/python/metadata.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
17
rules/S6331/python/rule.adoc
Normal file
17
rules/S6331/python/rule.adoc
Normal file
@ -0,0 +1,17 @@
|
||||
include::../description.adoc[]
|
||||
|
||||
== Noncompliant Code Example
|
||||
|
||||
[source,python]
|
||||
----
|
||||
r"foo()" # Noncompliant, will match only 'foo'
|
||||
----
|
||||
|
||||
== Compliant Solution
|
||||
|
||||
[source,python]
|
||||
----
|
||||
r"foo\(\)" # Matches 'foo()'
|
||||
----
|
||||
|
||||
include::../implementation.adoc[]
|
Loading…
x
Reference in New Issue
Block a user