#15 Change pp to process puppet scripts

open
puppet (1)
5
2013-09-29
2013-09-29
Paul Houghton
No

I recommend changing 'pp' file extension to process [http://puppetlabs.com/ puppet]. It is currently tied to pascal (less frequently used I would bet).

The puppet_count script would be
generic_count '#' "$@"

Discussion

  • Thanks for the suggestion!

    In general, sloccount tries to figure out automagically the type of file it's dealing with. Can you suggest any heuristics that are more likely to distinguish them?

     
  • Paul Houghton
    Paul Houghton
    2013-09-29

    Puppet is a fairly simple language that would be hard to distingush by file content. A potential soloution is to process it as puppet after the pascal_count program decides it's not pascal. I have not dug into your code yet, so I have don't know if that is viable yet. The problem is both of the following are valid .pp files

    example1.pp:
    package { 'sloccount' : ensure => 'installed' }
    
    example2.pp:
    node cworld {
      include mystuff
    }