No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/puppet-lint/plugins
spec
.gitignore
.travis.yml
Gemfile
LICENSE
README.md
Rakefile
puppet-lint-appends-check.gemspec

README.md

puppet-lint-appends-check

Build Status Gem Version Gem Downloads Coverage Status Gemnasium

A puppet-lint plugin to check that the append (+=) operator is unused.

Installing

From the command line

$ gem install puppet-lint-appends-check

In a Gemfile

gem 'puppet-lint-appends-check', :require => false

Checks

Append operator use

Use of the append operator can lead to unexpected behavior.

What you have done

$ssh_users = ['myself', 'someone']

class test {
  $ssh_users += ['someone_else']
}

What you should have done

$ssh_users = ['myself', 'someone', 'someone_else']

# OR
$ssh_users = hiera('ssh_users')

Auto fixing

There is not one way to properly fix this type of style error, so running puppet-lint's fix feature will not have any effect.

Disabling the check

To disable this check, you can add --no-appends-check to your puppet-lint command line.

$ puppet-lint --no-appends-check path/to/file.pp

Alternatively, if you’re calling puppet-lint via the Rake task, you should insert the following line to your Rakefile.

PuppetLint.configuration.send('disable_appends')