Re: [Puppet-dev] Re: [Puppet Users] Puppet Parse Trees (for a lint checker)

2011-03-02 Thread Nick Moffitt
Markus Roberts: > As a hack, I've occasionally done something like: > > diff --git a/lib/puppet/application/apply.rb [...] > - > Puppet::Node::Environment.new(Puppet[:environment]).known_resource_types > + print > ZAML.dump(Puppet::Node::Environment.new(Puppet[:environment]).known_reso

Re: [Puppet Users] Puppet Parse Trees (for a lint checker)

2011-03-01 Thread Henrik Lindberg
An alternative is to use the Geppetto tool which parses puppet manifests into a model. There is a Java API for this model. It can also be serialized in other formats that allow processing in other languages. I am interested in what "lint rules" you had in mind, maybe we could collaborate to

Re: [Puppet Users] Puppet Parse Trees (for a lint checker)

2011-03-01 Thread Nick Moffitt
Dan Bode: > Hi Nick (long time :) ) Hi! Nearly a year, by now! > It is possible to parse a given file and get an ASTArray back, is that > sufficient? I am pretty sure you are going to have to get your hands > into the Ruby code to really figure this out. I suppose so, although I hope that's som

Re: [Puppet Users] Puppet Parse Trees (for a lint checker)

2011-03-01 Thread Dan Bode
Hi Nick (long time :) ) On Tue, Mar 1, 2011 at 3:14 AM, Nick Moffitt wrote: > I mean to write a lint checker for my manifests, but I am not a ruby > developer to any degree of proficiency. What I think I would like is > some kind of serialization of the AST for a given .pp file, which I can > t

Re: [Puppet Users] Puppet Parse Trees (for a lint checker)

2011-03-01 Thread Nick Moffitt
(sorry Sandor, I hit individual reply entirely by mistake earlier) Sandor Szuecs: > On Mar 1, 2011, at 12:14 PM, Nick Moffitt wrote: > > Or is there already some easily-modifiable lint checker elsewhere? > > You probably want: > puppet --parseonly As of puppet 2.6.4 this does not print any parse

Re: [Puppet Users] Puppet Parse Trees (for a lint checker)

2011-03-01 Thread Sandor Szuecs
On Mar 1, 2011, at 12:14 PM, Nick Moffitt wrote: > Or is there already some > easily-modifiable lint checker elsewhere? You probably want: puppet --parseonly All the best, Sandor Szücs -- -- You received this message because you are subscribed to the Google Groups "Puppet Users" group.

[Puppet Users] Puppet Parse Trees (for a lint checker)

2011-03-01 Thread Nick Moffitt
I mean to write a lint checker for my manifests, but I am not a ruby developer to any degree of proficiency. What I think I would like is some kind of serialization of the AST for a given .pp file, which I can then import into my own Python code and analyze for undesirable patterns. Is there any