rspec/rules/S115/plsql/rule.adoc

74 lines
1.2 KiB
Plaintext
Raw Normal View History

include::../common/introduction.adoc[]
== Why is this an issue?
include::../common/why-is-this-an-issue.adoc[]
include::../common/rule-behaviour.adoc[]
=== What is the potential impact?
include::../common/what-is-the-potential-impact.adoc[]
== How to fix it
include::../common/how-to-fix-it.adoc[]
=== Code examples
2020-06-30 10:16:44 +02:00
==== Noncompliant code example
2020-06-30 10:16:44 +02:00
The following example assumes that constant names should match the default
regular expression ``++[a-zA-Z]([a-zA-Z0-9_]*[a-zA-Z0-9])?++``:
[source,sql,diff-id=1,diff-type=noncompliant]
2020-06-30 10:16:44 +02:00
----
DECLARE
constant_ CONSTANT PLS_INTEGER := 42; -- Noncompliant
BEGIN
NULL;
END;
/
----
==== Compliant solution
2020-06-30 10:16:44 +02:00
[source,sql,diff-id=1,diff-type=compliant]
2020-06-30 10:16:44 +02:00
----
DECLARE
constant CONSTANT PLS_INTEGER := 42; -- Compliant
BEGIN
NULL;
END;
/
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../common/message.adoc[]
=== Parameters
.regexp
****
----
[a-zA-Z]([a-zA-Z0-9_]*[a-zA-Z0-9])?
----
The regular expression the name should match.
****
'''
== Comments And Links
(visible only on this page)
include::../common/comments-and-links.adoc[]
endif::env-github,rspecator-view[]