Modify rule S5856: Add language Rust (#4678)
* Add rust to rule S5856 * Add rule description * Fix header * Add Clippy tag and link to Clippy lint --------- Co-authored-by: sallaigy <sallaigy@users.noreply.github.com> Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com> Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
This commit is contained in:
parent
f93da5854a
commit
faeaec31d0
6
rules/S5856/rust/metadata.json
Normal file
6
rules/S5856/rust/metadata.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"tags": [
|
||||||
|
"regex",
|
||||||
|
"clippy"
|
||||||
|
]
|
||||||
|
}
|
41
rules/S5856/rust/rule.adoc
Normal file
41
rules/S5856/rust/rule.adoc
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
== Why is this an issue?
|
||||||
|
|
||||||
|
include::../description.adoc[]
|
||||||
|
|
||||||
|
=== Noncompliant code example
|
||||||
|
|
||||||
|
[source,rust,diff-id=1,diff-type=noncompliant]
|
||||||
|
----
|
||||||
|
Regex::new("(")
|
||||||
|
----
|
||||||
|
|
||||||
|
|
||||||
|
=== Compliant solution
|
||||||
|
|
||||||
|
[source,rust,diff-id=1,diff-type=compliant]
|
||||||
|
----
|
||||||
|
Regex::new("\(")
|
||||||
|
----
|
||||||
|
|
||||||
|
== Resources
|
||||||
|
|
||||||
|
=== Documentation
|
||||||
|
|
||||||
|
* Regex crate documentation - https://crates.io/crates/regex[regex]
|
||||||
|
* Clippy Lints - https://rust-lang.github.io/rust-clippy/master/index.html#invalid_regex
|
||||||
|
|
||||||
|
ifdef::env-github,rspecator-view[]
|
||||||
|
|
||||||
|
'''
|
||||||
|
== Implementation Specification
|
||||||
|
(visible only on this page)
|
||||||
|
|
||||||
|
=== Message
|
||||||
|
|
||||||
|
Invalid regular expression syntax.
|
||||||
|
|
||||||
|
=== Highlighting
|
||||||
|
|
||||||
|
The error inside the regular expression
|
||||||
|
|
||||||
|
endif::env-github,rspecator-view[]
|
Loading…
x
Reference in New Issue
Block a user