odd puppet-lint config problems

17 views
Skip to first unread message

Ramin K

unread,
Jan 20, 2016, 4:17:31 PM1/20/16
to puppet...@googlegroups.com
I'm doing some work around distributing a puppet-lint wrapper
internally. Ideally I want a wrapper that reads a custom .puppet-lint.rc
within the repo and the rc file is --only-checks so we can enable new
checks as the codebase is ready to be stricter.

The problems I'm running into are

1. .puppet-lint.rc seems to be additive loading ~/.puppet-lint.rc,
./.puppet-lint.rc AND --conf path/to/.puppet-lint.rc

2. .puppet-lint.rc doesn't support --only-checks syntax

Has anyone done something similar and did you have to modify optparse.rb
and other Ruby code with puppet-lint to get it to work?

Ramin

Garrett Honeycutt

unread,
Jan 20, 2016, 4:34:07 PM1/20/16
to puppet...@googlegroups.com
Hi Ramin,

It sounds like you have a repo with a bunch of modules as opposed to one
repo per module. Recommend using a script that calls puppet-lint with
the arguments that you would like and integrating that into a pre-commit
check or a build pipeline.

I never use .puppt-lint.rc, instead you would normally have a
Rakefile[1] that would configure puppet-lint and run the tests with
`rake lint`.

See my last post under the subject 'Slightly Off-Topic: CI Test of
Puppet module fail' for how to configure it that way.

[1] - https://github.com/ghoneycutt/puppet-module-ssh/blob/master/Rakefile

Best regards,
-g

--
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658

Ramin K

unread,
Jan 20, 2016, 10:19:20 PM1/20/16
to puppet...@googlegroups.com
On 1/20/16 1:33 PM, Garrett Honeycutt wrote:
> Hi Ramin,
>
> It sounds like you have a repo with a bunch of modules as opposed to one
> repo per module. Recommend using a script that calls puppet-lint with
> the arguments that you would like and integrating that into a pre-commit
> check or a build pipeline.
>
> I never use .puppt-lint.rc, instead you would normally have a
> Rakefile[1] that would configure puppet-lint and run the tests with
> `rake lint`.
>
> See my last post under the subject 'Slightly Off-Topic: CI Test of
> Puppet module fail' for how to configure it that way.
>
> [1] - https://github.com/ghoneycutt/puppet-module-ssh/blob/master/Rakefile
>
> Best regards,
> -g
>

Thanks for the hint. A Rakefile will work and would be a nice place to
do environment sanity checks too.

Ramin
Reply all
Reply to author
Forward
0 new messages