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:
github-actions[bot] 2025-03-19 15:08:10 +01:00 committed by GitHub
parent f93da5854a
commit faeaec31d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,6 @@
{
"tags": [
"regex",
"clippy"
]
}

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