Uploaded image for project: 'Puppet Development Kit'
  1. Puppet Development Kit
  2. PDK-1202

The Rakefile config for puppet-lint still displays warnings for disabled checks (though the exit status is 0) unless .puppet-lint.rc also disables the checks

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDK 1.9.0
    • Component/s: None
    • Template:
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      This fixes a bug in PDK that did not honor the puppet-lint configurations specified in the Rakefile, since PDK doesn't call the rake command and executes puppet-lint directly. With this fix, the Rakefile configuration options for puppet-lint set up in the default template config and .sync.yml will be honored by PDK when calling puppet-lint.
      Show
      This fixes a bug in PDK that did not honor the puppet-lint configurations specified in the Rakefile, since PDK doesn't call the rake command and executes puppet-lint directly. With this fix, the Rakefile configuration options for puppet-lint set up in the default template config and .sync.yml will be honored by PDK when calling puppet-lint.
    • QA Risk Assessment:
      Needs Assessment

      Description

      I do not use the 140chars or arrow_alignment puppet-lint checks. I have configured the PDK templates to ignore those checks per https://github.com/puppetlabs/pdk-templates#rakefile. There is no .puppet-lint.rc file. These checks still generate warnings:

      [rn7284@chi-build06 controlrepo:production±]$ grep Rakefile -A3 .sync.yml
      Rakefile:
        default_disabled_lint_checks:
          - '140chars'
          - 'arrow_alignment' 
      [rn7284@chi-build06 controlrepo:production±]$ grep Lint Rakefile
      PuppetLint.configuration.send('disable_relative')
      PuppetLint.configuration.send('disable_140chars')
      PuppetLint.configuration.send('disable_arrow_alignment')
      [rn7284@chi-build06 controlrepo:production±]$ cat .puppet-lint.rc
      cat: .puppet-lint.rc: No such file or directory
      [rn7284@chi-build06 controlrepo:production±]$ pdk validate
      pdk (INFO): Running all available validators...
      pdk (INFO): Using Ruby 2.5.1
      pdk (INFO): Using Puppet 6.0.2
      [✔] Checking metadata syntax (metadata.json tasks/*.json).
      [✔] Checking module metadata style (metadata.json).
      [✔] Checking Puppet manifest syntax (**/**.pp).
      [✔] Checking Puppet manifest style (**/*.pp).
      [✔] Checking Ruby code style (**/**.rb).
      info: task-metadata-lint: ./: Target does not contain any files to validate (tasks/*.json).
      warning: puppet-lint: dist/eyaml/manifests/init.pp:43:12: indentation of => is not properly aligned (expected in column 14, but found it in column 12)
      warning: puppet-lint: dist/eyaml/manifests/init.pp:51:11: indentation of => is not properly aligned (expected in column 12, but found it in column 11)
      warning: puppet-lint: dist/eyaml/manifests/init.pp:52:11: indentation of => is not properly aligned (expected in column 12, but found it in column 11)
      <...>

      Only when I create a .puppet-lint.rc file do the warnings disappear:

      [rn7284@chi-build06 controlrepo:production]$ cat .puppet-lint.rc
      --no-arrow_alignment-check
      --no-140chars-check
      [rn7284@chi-build06 controlrepo:production]$ pdk validate
      pdk (INFO): Running all available validators...
      pdk (INFO): Using Ruby 2.5.1
      pdk (INFO): Using Puppet 6.0.2
      [✔] Checking metadata syntax (metadata.json tasks/*.json).
      [✔] Checking module metadata style (metadata.json).
      [✔] Checking Puppet manifest syntax (**/**.pp).
      [✔] Checking Puppet manifest style (**/*.pp).
      [✔] Checking Ruby code style (**/**.rb).
      info: task-metadata-lint: ./: Target does not contain any files to validate (tasks/*.json).
      [rn7284@chi-build06 controlrepo:production]$ 

      The Rakefile settings ONLY affect the rake task lint, and do not affect either pdk validate or calling puppet-lint directly:

      [rn7284@chi-build06 controlrepo:production]$ rm .puppet-lint.rc
      [rn7284@chi-build06 controlrepo:production±]$ pdk bundle exec puppet-lint dist/profile/manifests/base/linux.pp
      pdk (INFO): Using Ruby 2.5.1
      pdk (INFO): Using Puppet 6.0.2
      WARNING: indentation of => is not properly aligned (expected in column 23, but found it in column 14) on line 97
      WARNING: indentation of => is not properly aligned (expected in column 23, but found it in column 16) on line 98
      WARNING: indentation of => is not properly aligned (expected in column 23, but found it in column 16) on line 99
      WARNING: indentation of => is not properly aligned (expected in column 23, but found it in column 16) on line 100
      WARNING: indentation of => is not properly aligned (expected in column 23, but found it in column 16) on line 101
      WARNING: indentation of => is not properly aligned (expected in column 23, but found it in column 17) on line 102
      WARNING: indentation of => is not properly aligned (expected in column 14, but found it in column 12) on line 122
      WARNING: indentation of => is not properly aligned (expected in column 14, but found it in column 12) on line 123
      WARNING: indentation of => is not properly aligned (expected in column 14, but found it in column 13) on line 124
      WARNING: indentation of => is not properly aligned (expected in column 15, but found it in column 14) on line 176
      WARNING: indentation of => is not properly aligned (expected in column 15, but found it in column 14) on line 178
      WARNING: indentation of => is not properly aligned (expected in column 15, but found it in column 12) on line 179
      WARNING: indentation of => is not properly aligned (expected in column 15, but found it in column 14) on line 187
      WARNING: indentation of => is not properly aligned (expected in column 15, but found it in column 12) on line 188
      WARNING: indentation of => is not properly aligned (expected in column 15, but found it in column 13) on line 191
      WARNING: indentation of => is not properly aligned (expected in column 15, but found it in column 14) on line 194
      WARNING: indentation of => is not properly aligned (expected in column 15, but found it in column 12) on line 195[rn7284@chi-build06 controlrepo:production±]$ pdk bundle exec rake lint
      pdk (INFO): Using Ruby 2.5.1
      pdk (INFO): Using Puppet 6.0.2
       
       
      [rn7284@chi-build06 controlrepo:production±]$ 

      I expect to only have to configure the disabled checks in one place, and it was suggested on slack that this current behavior is unintended.

        Attachments

          Activity

            People

            • Assignee:
              tim.sharpe Tim Sharpe
              Reporter:
              rnelson0@gmail.com Rob Nelson
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support