rodjek / puppet-lint

Check that your Puppet manifests conform to the style guide
MIT License
820 stars 204 forks source link

80char --> 140char transition incomplete #514

Closed mschuchard closed 8 years ago

mschuchard commented 8 years ago

With puppet-lint 2.0.0.

require 'puppet-lint'
require 'puppet-lint/optparser'

PuppetLint::OptParser.build.parse!(['--no-80chars-check'])

Code executes successfully.

require 'puppet-lint'
require 'puppet-lint/optparser'

PuppetLint::OptParser.build.parse!(['--no-140chars-check'])

Raises OptionParser::InvalidOption error.

rnelson0 commented 8 years ago

In 2.0.0, you should actually see the opposite:

[rnelson0@build03 controlrepo:zabbix_fixture]$ be gem list | grep puppet-lint
puppet-lint (2.0.0)
puppet-lint-absolute_classname-check (0.2.4)
puppet-lint-classes_and_types_beginning_with_digits-check (0.1.2)
puppet-lint-leading_zero-check (0.1.1)
puppet-lint-trailing_comma-check (0.3.2)
puppet-lint-unquoted_string-check (0.3.0)
puppet-lint-version_comparison-check (0.2.1)
[rnelson0@build03 controlrepo:zabbix_fixture]$ be ruby
require 'puppet-lint'
require 'puppet-lint/optparser'

PuppetLint::OptParser.build.parse!(['--no-80chars-check'])
-:4:in `<main>': invalid option: --no-80chars-check (OptionParser::InvalidOption)
[rnelson0@build03 controlrepo:zabbix_fixture]$ be ruby
require 'puppet-lint'
require 'puppet-lint/optparser'

PuppetLint::OptParser.build.parse!(['--no-140chars-check'])
[rnelson0@build03 controlrepo:zabbix_fixture]$

Can you share how you are running this, to generate the error?

mschuchard commented 8 years ago

I totally agree I should see the opposite, which is why I filed an issue.

I had to thoroughly check my environment to ensure something bizarre wasn't happening.

Upon double-check:

sudo gem list

*** LOCAL GEMS ***

...
puppet-lint (2.0.0)
...

sudo find / -name puppet-lint
/var/lib/gems/2.1.0/gems/puppet-lint-2.0.0/spec/puppet-lint
/var/lib/gems/2.1.0/gems/puppet-lint-2.0.0/lib/puppet-lint
/var/lib/gems/2.1.0/gems/puppet-lint-2.0.0/bin/puppet-lint
/usr/lib/ruby/vendor_ruby/puppet-lint
/usr/share/doc/puppet-lint
/usr/local/bin/puppet-lint
/usr/bin/puppet-lint

ll /usr/bin/puppet-lint 
-rwxr-xr-x 1 root root 134 Oct 25  2014 /usr/bin/puppet-lint*

ll /usr/local/bin/puppet-lint 
-rwxr-xr-x 1 root root 512 Jun 30 10:08 /usr/local/bin/puppet-lint*

/usr/bin/puppet-lint --version
puppet-lint 1.1.0

So apparently this is a bug with gem install/update/cleanup and not with puppet-lint. Awesomesauce; closing.