Skip to content

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

@oberon227

Description

@oberon227

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions