Issue #5403 has been reported by micah -.
----------------------------------------
Bug #5403: puppet-mode.el indentation problems with definitions
https://projects.puppetlabs.com/issues/5403
Author: micah -
Status: Unreviewed
Priority: Low
Assignee:
Category: ext
Target version:
Affected Puppet version:
Keywords:
Branch:
If I have a define where the closing parenthesis is on the final line, the
emacs puppet-mode indentation makes a funny choice. For example, if I have:
<pre>
define puppet::puppetmaster::hasdb(
$dbtype = 'mysql',
$dbname = 'puppet',
){
if !$puppet_storeconfig_password { fail("No \$puppet_storeconfig_password is
set, please set it in your manifests or site.pp to add a password") }
case $dbtype {
'mysql': { puppet::puppetmaster::hasdb::mysql{$name: dbname => $dbname,
dbhost => $dbhost, dbuser => $dbuser, dbpwd => $dbpwd, } }
}
}
</pre>
and I use the puppet-mode to perform indentation formatting of this define, it
results in this:
<pre>
define puppet::puppetmaster::hasdb (
$dbtype = 'mysql',
$dbname = 'puppet',
){
if !$puppet_storeconfig_password { fail("No \$puppet_storeconfig_password is
set, please set it in your manifests or site.pp to add a password") }
case $dbtype {
'mysql': { puppet::puppetmaster::hasdb::mysql{$name: dbname => $dbname,
dbhost => $dbhost, dbuser => $dbuser, dbpwd => $dbpwd, } }
}
}
</pre>
which makes it look like the define hasn't been closed properly because the
final curly brace isn't all the way over on the left. It seems to do the right
thing if I pull the closing parens up to the last variable and put the curly
brace on a new line, like so:
<pre>
define puppet::puppetmaster::hasdb (
$dbtype = 'mysql',
$dbname = 'puppet' )
{
if !$puppet_storeconfig_password { fail("No \$puppet_storeconfig_password is
set, please set it in your manifests or site.pp to add a password") }
case $dbtype {
'mysql': { puppet::puppetmaster::hasdb::mysql{$name: dbname => $dbname,
dbhost => $dbhost, dbuser => $dbuser, dbpwd => $dbpwd, } }
}
}
</pre>
Its not a big deal, but just an odd difference in behavior.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.