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

pdk validate's rubocop check does not skip the vendor directory

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Template:
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      Given

      [rn7284@chi-build06 controlrepo:production]$ head -20 .rubocop.yml
      ---
      require: rubocop-rspec
      AllCops:
        DisplayCopNames: true
        TargetRubyVersion: '2.1'
        Include:
        - "./**/*.rb"
        Exclude:
        - bin/*
        - ".vendor/**/*"
        - "**/Gemfile"
        - "**/Rakefile"
        - pkg/**/*
        - spec/fixtures/**/*
        - vendor/**/*
        - "**/Puppetfile"
        - "**/Vagrantfile"
        - "**/Guardfile"
      Metrics/LineLength:
        Description: People have wide screens, use them. 

      I would expect the vendor directory to be ignored. It is not ignored:

      [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 Ruby code style (**/**.rb).
      info: task-metadata-lint: ./: Target does not contain any files to validate (tasks/*.json).
      Error: puppet-syntax: UTF-8: Could not parse for environment production: invalid byte sequence
      convention: rubocop: vendor/ruby/gems/hiera-3.4.5/spec/unit/util_spec.rb:7:7: RSpec/PredicateMatcher: Prefer using `be_posix` matcher over `posix?`.
      convention: rubocop: vendor/ruby/gems/hiera-3.4.5/spec/unit/util_spec.rb:12:7: RSpec/PredicateMatcher: Prefer using `be_posix` matcher over `posix?`.
      convention: rubocop: vendor/ruby/gems/hiera-3.4.5/spec/unit/util_spec.rb:19:7: RSpec/PredicateMatcher: Prefer using `be_microsoft_windows` matcher over `microsoft_windows?`.
      <repeat for hundreds of lines>

      Only if I remove the vendor directory entirely does pdk validate ignore it. I tried a number of permutations of the line `vendor/*/` and could not find a version that would properly filter it out.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: