Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update indent behaviour when semicolon is on a separate line #19

Open
oberon227 opened this issue Feb 23, 2020 · 1 comment
Open

Update indent behaviour when semicolon is on a separate line #19

oberon227 opened this issue Feb 23, 2020 · 1 comment

Comments

@oberon227
Copy link

oberon227 commented Feb 23, 2020

Consider the following code block from Puppet's Documentation:

file {
  default:
    ensure => file,
    owner  => "root",
    group  => "wheel",
    mode   => "0600",
  ;
  ['ssh_host_dsa_key', 'ssh_host_key', 'ssh_host_rsa_key']:
    # use all defaults
  ;
  ['ssh_config', 'ssh_host_dsa_key.pub', 'ssh_host_key.pub', 'ssh_host_rsa_key.pub', 'sshd_config']:
    # override mode
    mode => "0644",
  ;
}

Note that the semi-colons line up with the resource name.

puppet-lint-strict_indent-check will put the semi-colons 4 indents in, instead of 2, as such:

file {
  default:
    ensure => file,
    owner  => "root",
    group  => "wheel",
    mode   => "0600",
    ;
  ['ssh_host_dsa_key', 'ssh_host_key', 'ssh_host_rsa_key']:
    # use all defaults
    ;
  ['ssh_config', 'ssh_host_dsa_key.pub', 'ssh_host_key.pub', 'ssh_host_rsa_key.pub', 'sshd_config']:
    # override mode
    mode => "0644",
    ;
}

Following Puppet's documentation, I think the Acceptable Indentation list should be amended to include the indent decreasing when a resource-ending semicolon is on its own line.

@oberon227 oberon227 changed the title Incorrect behaviour on a multiple resource block Update indent behaviour when semicolon is on a separate line Feb 23, 2020
@oberon227
Copy link
Author

Sorry for the edits. Maybe next time I should do 10 minutes more code-reading before forming my comment...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants