SonarJS icon indicating copy to clipboard operation
SonarJS copied to clipboard

Parsing error on Helm Chart YAML files

Open nils-werner-sonarsource opened this issue 2 years ago • 1 comments

Since SonarJs parses Yaml files to analyze possible JavaScript code inside, parser errors occur in YAML files containing Helm chart template directives. These directives do not follow the YAML standard.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "hello-world.fullname" . }}
  labels:
    {{- include "hello-world.labels" . | nindent 4 }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      {{- include "hello-world.selectorLabels" . | nindent 6 }}
...

Since these files do not contain valid JavaScript code, they should not be parsed and should be excluded from parsing by preprocessing. (See also SONARIAC-435)

nils-werner-sonarsource avatar Aug 04 '22 12:08 nils-werner-sonarsource

I am reopening this ticket, because the new predicate is not used in the sensor, which should be fixed

saberduck avatar Nov 29 '23 09:11 saberduck