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

strict_indent fires a warning about the indent of a heredoc #26

Closed
jay7x opened this issue Jun 11, 2022 · 1 comment
Closed

strict_indent fires a warning about the indent of a heredoc #26

jay7x opened this issue Jun 11, 2022 · 1 comment

Comments

@jay7x
Copy link
Member

jay7x commented Jun 11, 2022

I see some strange behaviour of strict_indent when linting my Bolt plans.

pdk bundle exec puppet-lint plans/fix_bond0.pp
...
WARNING: indent should be 8 chars and is 0 on line 23 (check: strict_indent)

Line 23 is 1st line of an indented heredoc (https://puppet.com/docs/puppet/7/lang_data_string.html#lang_data_string_heredocs-stripindent)

        [Match]

I tried to change indentation of the heredoc but it didn't help.. message is still the same.

Plan is below (slightly redacted):

plan example::fix_bond0(
  TargetSpec $targets,
  String $run_as = 'root',
  Boolean $noop = true,
) {
  apply_prep($targets, { _run_as => $run_as })

  $res = apply($targets, {
      _run_as       => $run_as,
      _noop         => $noop,
      _catch_errors => true,
  }) {
    $bond0 = $facts['networking']['interfaces']['bond0']

    file { '/etc/systemd/network/bond0.network':
      ensure    => 'file',
      backup    => '.bak',
      owner     => 'root',
      group     => 'root',
      mode      => '0644',
      show_diff => true,
      content   => @("EOD"),
        [Match]
        Name=bond0

        [Link]
        MTUBytes=${bond0['mtu']}
        MACAddress=${bond0['mac'].upcase}
        ActivationPolicy=always-up

        [Network]
        VLAN=public
        VLAN=private
        | EOD
    }
    ~> exec { 'networkctl_reload':
      command     => '/usr/bin/networkctl reload',
      refreshonly => true,
    }
  }
}
@alexjfisher alexjfisher transferred this issue from voxpupuli/voxpupuli-puppet-lint-plugins Jun 11, 2022
@alexjfisher
Copy link
Member

Duplicate of #20

@alexjfisher alexjfisher marked this as a duplicate of #20 Jun 11, 2022
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