Page MenuHomePhabricator

ArcanistPuppetLintLinter doesn't work with puppet-lint 2.1.0 or later
Closed, DuplicatePublic

Description

puppet-lint 2.1.0 removed the deprecated linenumber formatter (Changelog, Github Issue) in favor of the line formatter that has been available since 1.0.0.

Reproduction steps:

  • Install puppet-lint 2.1.0 or later
  • Run the following commands to reproduce the error
$ mkdir linttest
$ cd linttest
$ git init
$ echo '{"linters": { "puppet": { "type": "puppet-lint" } } }' > .arclint
$ echo 'class test { file { "/tmp/test": ensure => absent } }' > test.pp
$ git add .
$ arc lint test.pp

Expected result:

$ arc lint test.pp 
>>> Lint for test.pp:


   Warning  (PUPPETLINT) Documentation
    Class not documented

    >>>        1 class test { file { "/tmp/test": ensure => absent } }
...

Actual result:

$ arc lint test.pp 
Exception
Some linters failed:
    - CommandException: Command failed with error #1!
      COMMAND
      'puppet-lint' '--error-level=all' '--log-format=%{linenumber}|%{column}|%{kind}|%{check}|%{message}' '/Users/chris/git/linttest/test.pp'
      
      STDOUT
      (empty)
      
      STDERR
      /Library/Ruby/Gems/2.0.0/gems/puppet-lint-2.1.1/lib/puppet-lint.rb:103:in `%': key{linenumber} not found (KeyError)
      	from /Library/Ruby/Gems/2.0.0/gems/puppet-lint-2.1.1/lib/puppet-lint.rb:103:in `format_message'
      	from /Library/Ruby/Gems/2.0.0/gems/puppet-lint-2.1.1/lib/puppet-lint.rb:152:in `block in report'
      	from /Library/Ruby/Gems/2.0.0/gems/puppet-lint-2.1.1/lib/puppet-lint.rb:142:in `each'
      	from /Library/Ruby/Gems/2.0.0/gems/puppet-lint-2.1.1/lib/puppet-lint.rb:142:in `report'
      	from /Library/Ruby/Gems/2.0.0/gems/puppet-lint-2.1.1/lib/puppet-lint.rb:201:in `print_problems'
      	from /Library/Ruby/Gems/2.0.0/gems/puppet-lint-2.1.1/lib/puppet-lint/bin.rb:60:in `block in run'
      	from /Library/Ruby/Gems/2.0.0/gems/puppet-lint-2.1.1/lib/puppet-lint/bin.rb:56:in `each'
      	from /Library/Ruby/Gems/2.0.0/gems/puppet-lint-2.1.1/lib/puppet-lint/bin.rb:56:in `run'
      	from /Library/Ruby/Gems/2.0.0/gems/puppet-lint-2.1.1/bin/puppet-lint:7:in `<top (required)>'
      	from /usr/local/bin/puppet-lint:23:in `load'... (49 more bytes) ...
(Run with `--trace` for a full exception trace.)

Arcanist version:

arcanist 822bc53ca306e06314560d8a76f68771d732e8e0 (25 Feb 2017)
libphutil e3381770af0fa8a01ca1e1078b041c00c7baab5a (25 Feb 2017)