Modify rule S6331: Add Python as covered language (#798)

This commit is contained in:
Nils Werner 2022-03-29 09:47:35 +02:00 committed by GitHub
parent f307690d5a
commit e39785564d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 38 additions and 18 deletions

View File

@ -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

View 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[]

View File

@ -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[]

View File

@ -0,0 +1,2 @@
{
}

View 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[]