AtomLinter / linter-puppet-lint

Atom linter plugin for Puppet, using puppet-lint
6 stars 3 forks source link

No longer working #13

Closed LordChaos73 closed 9 years ago

LordChaos73 commented 9 years ago

Hi,

I am aware that the package is in transition regarding the new API but it seems the linter has completely stopped working now. I can insert bogus code and the linter is still reporting 'no issues'. Strangely, the messages that code is deprecated are no longer present.

Cheers,

Eric

asquelt commented 9 years ago

i've found this fork: https://github.com/looneychikun/linter-puppet-lint at commit https://github.com/looneychikun/linter-puppet-lint/tree/168990b to be working. also made a fork myself to additionally lint with puppet parser validate: https://github.com/asquelt/linter-puppet-parser hope this helps :cake:

lesinigo commented 9 years ago

This plugin wasn't working for me, without any apparent error; now I've just upgraded to v0.4.0 and it still doesn't work but it started spitting out errors.

I'm using Mac OS X 10.10 and I have installed puppet-lint in my home directory:

~ luca$ gem install --user-install puppet-lint
Fetching: puppet-lint-1.1.0.gem (100%)
Successfully installed puppet-lint-1.1.0
Parsing documentation for puppet-lint-1.1.0
Installing ri documentation for puppet-lint-1.1.0
1 gem installed

I can run it and I also have the local gem bin directory in my $PATH (I use it daily from the terminal while I work on Puppet manifests with Atom and it's definitely working correctly):

~ luca$ /Users/luca/.gem/ruby/2.0.0/bin/puppet-lint --version
puppet-lint 1.1.0
~ luca$ puppet-lint --version
puppet-lint 1.1.0
~ luca$ which puppet-lint
/Users/luca/.gem/ruby/2.0.0/bin/puppet-lint

I have configured the plugin (AFAIK) correctly:

~ luca$ grep puppet .atom/config.cson 
  "linter-puppet-lint":
    puppetLintExecutablePath: "/Users/luca/.gem/ruby/2.0.0/bin/puppet-lint"

Atom says (slightly edited for readability here):

/Users/luca/.atom/packages/linter-erb/lib/init.coffee:11 activate linter-erb
/Users/luca/.atom/packages/linter-jsonlint/lib/init.coffee:14 activate linter-jsonlint
index.js:56 Window load time: 2785ms
(big red dot with "2" inside)
/Applications/Misc/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:260
  Uncaught BufferedProcessError: Failed to spawn command `puppet-lint`.
  Make sure `puppet-lint` is installed and on your PATH

me too hope this helps 👍

LordChaos73 commented 9 years ago

Funnily, 0.4.0 seems to work fine for me, when I save a file it's being processed by the linter. I'm also on OSX 10.10 by the way.

➜  ~  which puppet-lint
/usr/bin/puppet-lint

➜  ~  puppet-lint --version
puppet-lint 1.1.0

➜  ~  cat .atom/config.cson |grep -i puppetlint
puppetLintExecutablePath: "/usr/bin/puppet-lint"

➜  ~  /usr/local/bin/atom --version
1.0.7
thejordanclark commented 9 years ago

Thanks for the update. It seems to be working well for me on my Linux box. Let me try it on my Mac and see how it goes there.

thejordanclark commented 9 years ago

Yeah It seems to work for me also after updating to linter-puppet-lint 0.4.0 on my OS 10.10.4 machine. With the exact same versions as you.

Thanks again for the update.

rafitadiaz commented 9 years ago

Perfect! It seems that the new version is working with the new API. Thanks everybody for the comments.

@lesinigo I have more or less the same configuration:

rafa@localhost ~: /.gem/ruby/1.9.1/bin$ /home/rdiaz/.gem/ruby/1.9.1/bin/puppet-lint --version
puppet-lint 1.1.0
rafa@localhost ~: puppet-lint --version
puppet-lint 1.1.0
And my plugin config looks like:
  "linter-puppet-lint":
    executablePath: "/home/rdiaz/.gem/ruby/1.9.1/bin/puppet-lint"

And it works fine for me. Sorry but I can't reproduce that error. It's anybody having troubles in Mac?

Anyway I'm going to close this bug since it seems to be working fine now.

janorn commented 9 years ago

I use version 0.5.0:

$ puppet-lint --version
puppet-lint 1.1.0
$ which puppet-lint
/Users/janorn/.rvm/bin/puppet-lint
$ grep puppetLintExecutablePath .atom/config.cson 
    puppetLintExecutablePath: "/Users/janorn/.rvm/bin/puppet-lint"
$ uname -a
Darwin watcnoclosxl082 13.4.0 Darwin Kernel Version 13.4.0: Wed Mar 18 16:20:14 PDT 2015; root:xnu-2422.115.14~1/RELEASE_X86_64 x86_64

I get this error as well: 'puppet-lint' could not be spawned. Is it installed and on your path? If so please open an issue on the package spawning the process.

darkn3rd commented 6 years ago

I found in my environment that Atom was using rvm installed ruby 2.3.3 from my local environment in its running process. I switched to that and installed puppet-lint. I had to quit and reload Atom and then it seems to work.

In case interested, the error in console was useful in saying it couldn't find the gem or build the gem:

Error running Puppet-Lint Error: Ignoring bindex-0.5.0 because its extensions are not built.  Try: gem pristine bindex --version 0.5.0
Ignoring byebug-9.0.6 because its extensions are not built.  Try: gem pristine byebug --version 9.0.6
Ignoring executable-hooks-1.3.2 because its extensions are not built.  Try: gem pristine executable-hooks --version 1.3.2
Ignoring ffi-1.9.18 because its extensions are not built.  Try: gem pristine ffi --version 1.9.18
Ignoring gem-wrappers-1.2.7 because its extensions are not built.  Try: gem pristine gem-wrappers --version 1.2.7
Ignoring nio4r-2.0.0 because its extensions are not built.  Try: gem pristine nio4r --version 2.0.0
Ignoring nokogiri-1.7.1 because its extensions are not built.  Try: gem pristine nokogiri --version 1.7.1
Ignoring puma-3.8.2 because its extensions are not built.  Try: gem pristine puma --version 3.8.2
Ignoring sqlite3-1.3.13 because its extensions are not built.  Try: gem pristine sqlite3 --version 1.3.13
Ignoring websocket-driver-0.6.5 because its extensions are not built.  Try: gem pristine websocket-driver --version 0.6.5
    at ChildProcess.<anonymous> (/Users/jmenchaca/.atom/packages/linter-puppet-lint/node_modules/sb-exec/lib/index.js:56)
    at emitTwo (events.js:106)
    at ChildProcess.emit (events.js:191)
    at maybeClose (internal/child_process.js:885)
    at Socket.<anonymous> (internal/child_process.js:334)
    at emitOne (events.js:96)
    at Socket.emit (events.js:188)
    at Pipe._handle.close [as _onclose] (net.js:501)
(anonymous) @ linter-registry.js [sm]:137

I was able to determine the environment on Mac with this:

ps eww -o command ${ATOM_PID} |  tr ' ' '\n' | grep -E 'GEM|^PATH'