On 2013-23-04 13:55, Brice Figureau wrote:
On Tue, 2013-04-23 at 04:23 +0200, Henrik Lindberg wrote:
This is quite difficult. The puppet lexer (with quite a lot of changes
in the 3.x code stream, and with even more changes in the 3.2 --parser
future lexer/parser which will the standard in puppet 4) is designed
primarily for runtime lexing/parsing. Specifically it:
- stops on several types of lexing errors
- does not preserve whitepsace / linebreaks / formatting
That's the reason puppet doc doesn't work with every manifest.
Yeah, and the implementation of comment processing for docs has eroded
over time. In the --parser future it was dropped completely in favor of
a new clean implementation (T.B.D - perhaps in Geppetto instead).
still focusing on parsing with the intent of evaluation. There is no
reverse serialization (from AST to source text) or pretty printing, or
"cleaner".
Actually there is a bit in some of the AST leaves for reconstructing
puppet doc output.
Yes, but it is minimalistic. In --parser future there is a tree dumper
that currently dumps to a kind of lisp notation (for debugging and
comparisons in tests). A similar thing can be written for .pp source
output. Would not be difficult (but since whitespace is not preserved it
is of limited value - it would need to output things with a fixed
layout).
Still with puppet doc in mind, would that make sense to base its next
version on gepetto?
Yes, I think so. It already has a puppet source comments to HTML
formatter (it shows documentation parsed and formatted on the fly in
hovers over references).
I can imagine generating the docs on the fly - there is even an internal
web browser in Geppetto/Eclipse that could be used - i.e. change
comment, refresh page work cycle.
Why not join forces with puppet-lint or Geppetto? As the principal
developer on Geppetto I know I could sure use help :)
Do you have any pointers about what you'd want us to help?
I mean like the low hanging fruits we could help tackle?
Some of the easy things are:
- come up with something you want to see validated (a particular kind of
issue (real or stylistic).
- come up with a quick fix for that (a suggestion to the user).
- find existing rules / fixes that could work better
These are not difficult to implement.
Helping to create a new Puppet Doc tool would be amazing. This to some
extent is green field coding. For starters, how would it work, what are
the requirements.
For anyone that wants to really dig in, I would help with introduction
to the code be available to answer questions etc.
- henrik
--
You received this message because you are subscribed to the Google Groups "Puppet
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.