NullPointerException in yaml:IndentationCheck

Template for a good bug report, formatted with Markdown:

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube 7.9.2 (build 30863)
    sonar-maven-plugin 3.7.0.1746

  • error observed
    ‘’’
    Caused by: java.lang.NullPointerException
    Checking rule: yaml:IndentationCheck
    Got RuleProperty @org.sonar.check.RuleProperty(description=The indentation width, in spaces, type=, defaultValue=consistent, key=spaces)
    Got RuleProperty @org.sonar.check.RuleProperty(description=Tells whether block sequences should be indented or not, type=, defaultValue=true, key=indent-sequences)
    Got RuleProperty @org .sonar.check.RuleProperty(description=Tells whether to lint indentation in multi-line strings, type=, defaultValue=false, key=check-multi-line-strings)
    YAMLLint config for rule yaml:IndentationCheck/indentation: '—
    (repeat)

NullPointerException
at com.github.sbaudoin.yamllint.rules.Indentation.checkToken (Indentation.java:359)
at com.github.sbaudoin.yamllint.rules.Indentation.check (Indentation.java:214)
at com.github.sbaudoin.yamllint.Linter.getCosmeticProblems (Linter.java:230)
at com.github.sbaudoin.sonar.plugins.yaml.checks.YamlLintCheck.validate (YamlLintCheck.java:46)


‘’’

  • steps to reproduce
    mvn install -DskipTests
    mvn sonar:sonar -X
    (Suspect cause: we have some generated yaml files placed in target/classes/openapi, later used via classpath)

  • potential workaround
    tried to disable the Indentation rule for yaml (yaml:IndentationCheck), did not work…

1 Like

Hey there!

sonar-yaml is a community supported plugin (which here means it is better to create a Github issue on the repo than post here). I’m sure @sbaudoin will happy to take a look!

Colin

Hi,

Is there a way to turn of sonar-yaml until the issue is solved?

/RogerL

Yes indeed!