Skip to content

Commit

Permalink
ctags configuration
Browse files Browse the repository at this point in the history
ctags let you generates a list of class/site/node/define which can then
be used by your texteditor to show up the puppet manifest
representation.

The configuration for ctags is done in /.ctags and ctags execution is
wrapped in a rake task 'tags' as a convenience.

Vim supports tags files and you can display the file structure using the
tagbar plugin.  The ctags configuration comes from:

  https://github.com/majutsushi/tagbar/wiki#puppet

I have added a `--languages=puppet` to restrict it to puppet manifests,
we might want to generate tags for python/php whatever script we have in
operations/puppet.

Change-Id: Ia164addddc48f897c3af092b1c14d80fb505889e
  • Loading branch information
hashar committed Oct 25, 2013
1 parent 63052a0 commit 4f6da0d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .ctags
@@ -0,0 +1,8 @@
-h pp
--langdef=puppet
--langmap=puppet:.pp
--languages=puppet
--regex-puppet=/^class[ \t]*([:a-zA-Z0-9_\-]+)[ \t]*/\1/c,class/
--regex-puppet=/^site[ \t]*([a-zA-Z0-9_\-]+)[ \t]*/\1/s,site/
--regex-puppet=/^node[ \t]*([a-zA-Z0-9_\-]+)[ \t]*/\1/n,node/
--regex-puppet=/^define[ \t]*([:a-zA-Z0-9_\-]+)[ \t]*/\1/d,definition/
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -15,3 +15,6 @@
# Automatically generated documentation:
/doc/*
!/doc/README

# ctags generated file (see `rake tags`)
/tags
10 changes: 10 additions & 0 deletions rakefile
Expand Up @@ -217,6 +217,16 @@ task :spec do
end
end

desc "Generates ctags"
task :tags do
puts "Generating ctags file.."
system('ctags -R .')
puts "Done"
puts
puts "See https://github.com/majutsushi/tagbar/wiki#puppet for vim"
puts "integration with the vim tagbar plugin."
end

# Wrapper to run rspec in a module
def run_module_spec(module_name)

Expand Down

0 comments on commit 4f6da0d

Please sign in to comment.