Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Puppet-Lint warnings/errors show as hints #189

Closed
glennsarti opened this issue Sep 24, 2019 · 4 comments · Fixed by #286
Closed

Puppet-Lint warnings/errors show as hints #189

glennsarti opened this issue Sep 24, 2019 · 4 comments · Fixed by #286
Labels
bug Something isn't working

Comments

@glennsarti
Copy link
Contributor

Using the following manifest

class bad_formatting {
  user { 'username':
    ensure => absent,
    auth_membership => 'false',
  }
}

The puppet-lint checks do not show correctly

image

The Language Server debug log shows:

, [2019-09-24T11:31:04.836536 #42384]  INFO -- : Received textDocument/didChange notification.
D, [2019-09-24T11:31:04.847963 #42384] DEBUG -- : --- OUTBOUND
{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///c%3A/Source/puppet-vscode-files/formatting.pp","diagnostics":[{"range":{"start":{"character":0,"line":0},"end":{"character":0,"line":0}},"message":"class not documented","source":"Puppet","code":"documentation","severity":2},{"range":{"start":{"character":23,"line":3},"end":{"character":28,"line":3}},"message":"quoted boolean value found","source":"Puppet","code":"quoted_booleans","severity":4},{"range":{"start":{"character":11,"line":2},"end":{"character":13,"line":2}},"message":"indentation of => is not properly aligned (expected in column 21, but found it in column 12)","source":"Puppet","code":"arrow_alignment","severity":4}]}}

The "missing" checks are being sent as Severity 4 (i.e. a Hint), not a warning or error.

It appears something has changed in puppet-lint for https://github.com/lingua-pupuli/puppet-editor-services/blob/78bb4b108ed70b72ae48c08b56232579af36b92b/lib/puppet-languageserver/manifest/validation_provider.rb#L64-L71

@glennsarti glennsarti added the bug Something isn't working label Sep 24, 2019
@glennsarti
Copy link
Contributor Author

Hrmmm ..... restarting the Language Sever "fixed it". More investigation required...

@glennsarti
Copy link
Contributor Author

Might be triggered Ctrl-Zing after doing a Format-Document command ...

@jpogran
Copy link
Contributor

jpogran commented May 28, 2020

Closing as need more context or information to scope work

@jpogran jpogran closed this as completed May 28, 2020
@glennsarti glennsarti reopened this Dec 30, 2020
@glennsarti
Copy link
Contributor Author

Found the problem. PuppetLint.configuration.fix doesn't get reset to false after a Format Document call. So everything after that comes in as :fixed problem kind, not :warning or :error

glennsarti added a commit to glennsarti/puppet-editor-services that referenced this issue Dec 30, 2020
Previously after a call to fix_validation_errors, many validation errors came
in as hints not errors.  This was due to PuppetLint not resetting the
`PuppetLint.configuration.fix` setting between calls.  This commit updates the
validation provider to reset this setting each call.  This commit also adds
tests for this scenario.
glennsarti added a commit to glennsarti/puppet-editor-services that referenced this issue Jan 6, 2021
Previously after a call to fix_validation_errors, many validation errors came
in as hints not errors.  This was due to PuppetLint not resetting the
`PuppetLint.configuration.fix` setting between calls.  This commit updates the
validation provider to reset this setting each call.  This commit also adds
tests for this scenario.
jpogran added a commit that referenced this issue Jan 6, 2021
(GH-189) Reset PuppetLint configuration for each call
glennsarti added a commit to glennsarti/puppet-editor-services that referenced this issue Jan 19, 2021
Previously in commit c70511b validation was changed to initialise Puppet Lint
correctly, however there was a typo in the provider.  This commit fixes the
typo and references the correct variable.
jpogran added a commit that referenced this issue Jan 25, 2021
(GH-189) Fix module root for validation
scoiatael pushed a commit to scoiatael/puppet-editor-services that referenced this issue Jan 14, 2022
Previously after a call to fix_validation_errors, many validation errors came
in as hints not errors.  This was due to PuppetLint not resetting the
`PuppetLint.configuration.fix` setting between calls.  This commit updates the
validation provider to reset this setting each call.  This commit also adds
tests for this scenario.
scoiatael pushed a commit to scoiatael/puppet-editor-services that referenced this issue Jan 14, 2022
Previously in commit c70511b validation was changed to initialise Puppet Lint
correctly, however there was a typo in the provider.  This commit fixes the
typo and references the correct variable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants