Skip to content

puppet-languageserver is incompatible with puppet-lint 4.3.0 #396

@lelutin

Description

@lelutin

Describe the Bug

When replacing puppet-lint 4.2.4 with 4.3.0 in the vendor directory, puppet-languageserver stops producing diagnostics for lint errors

Expected Behavior

diagnostics should still get issued

Steps to Reproduce

Steps to reproduce the behavior:

  1. In the Rakefile, change the vendor ref to 4.3.0 and then build a release
  2. Start the languageserver per usual

Environment

  • Version 2.0.4
  • Platform Debian unstable (before trixie release)

Additional Context

I've identified a hack in the code for making the diagnostics still come out with puppet-lint 4.3.0. I have no idea if the solution is "the correct one" though.

The cause of the problem seems to be in puppetlabs/puppet-lint@c35705b where fileinfo started being passed as-is to File.extname(). puppet-languageserver give nil as a value to fileinfo so that call crashes.

the hack I used is to modify puppet-languageserver/manifest/validation_provider.rb at line 42 like the following (e.g. pass in an empty string to linter.run() instead of nil):

 39           linter = PuppetLint::Checks.new
 40           linter.load_data(nil, content)
 41 
 42           problems = linter.run('', content)
 43           unless problems.nil?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions