Skip to content

Commit

Permalink
Modify rule S117: Add exception to kubernetes language
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-wielage-sonarsource committed Dec 10, 2024
1 parent 11265c1 commit 3eda3f1
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions rules/S117/kubernetes/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@
:identifier: local variable and function parameter
:identifier_plural: local variables and function parameters
:identifier_or: local variable or function parameter
:regex: ^[a-z][a-zA-Z0-9]*$
:regex: ^\$[a-z][a-zA-Z0-9]*$

include::../rule.adoc[]

include::../introduction.adoc[]

include::../why-is-this-an-issue.adoc[]

=== Exceptions

The rule does not raise an issue on the usages of the blank identifier `$_` or the root context `$`.

include::../what-is-the-potential-impact.adoc[]

include::../how-to-fix-it.adoc[]

As a default, we suggest using the camelCase naming convention, as this is widely adopted for variables in Helm.


=== Code examples

==== Noncompliant code example
Expand Down Expand Up @@ -51,6 +63,11 @@ data:
{{ $keyC }}: {{ $valC | quote }}
{{- end }}
----

[source,text]
----
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className -}}
----
== Resources

=== Documentation
Expand Down

0 comments on commit 3eda3f1

Please sign in to comment.