Permalink
Commits on Apr 13, 2018
  1. Release 13.1.1

    tas50 committed Apr 13, 2018
    Signed-off-by: Tim Smith <tsmith@chef.io>
Commits on Apr 12, 2018
  1. Fix attribute.rb -> attributes.rb for root_alias

    tas50 committed Apr 12, 2018
    This prevents failures when checking cookbooks at the cookbook level
    
    Signed-off-by: Tim Smith <tsmith@chef.io>
  2. Merge pull request #755 from Foodcritic/deprecated

    tas50 committed Apr 12, 2018
    Fix rules to have the deprecated tag not deprecation
  3. Fix rules to have the deprecated tag not deprecation

    tas50 committed Apr 12, 2018
    This gives us a consistent tag
    
    Signed-off-by: Tim Smith <tsmith@chef.io>
  4. Release 13.1.0

    tas50 committed Apr 12, 2018
    Signed-off-by: Tim Smith <tsmith@chef.io>
  5. Merge pull request #749 from Foodcritic/fc120_v2

    tas50 committed Apr 12, 2018
    Add FC120: Do not set the name property directly on a resource
  6. Fix 2 bugs in calculating the cookbook dir from cookbook fles (#753)

    tas50 authored and damacus committed Apr 12, 2018
    * Fix 2 bugs in calculating the cookbook dir from cookbook fles
    
    Both of these bugs happened when you matched on cookbook:
    
    If you used the Chef 13 recipe.rb or attribute.rb files we would end up 1 directory above the cookbook which would cause rules to fail
    If you placed you templates directly in the templates directory you would end up 1 directory above the cookbook which would cause rules to fail
    
    * Support templates infinitely nested in directories
    
    Instead of checking for files on disk a set number of directories up break apart the path and look for the templates directory if we end in .erb. This should be work for any valid cookbook file.
    
    * Add tests for cookbook_dir
  7. Merge pull request #747 from Foodcritic/build_essential

    tas50 committed Apr 12, 2018
    Add FC122: Use the build_essential resource instead of the recipe
  8. Merge pull request #748 from Foodcritic/fc116

    tas50 committed Apr 12, 2018
    Add FC116: Cookbook depends on the deprecated compat_resource cookbook
  9. Improve tag loading from rule files (#754)

    tas50 authored and damacus committed Apr 12, 2018
    Cache the lookups per cookbook so we don't have to go looking for a .foodcritic file for every file we find in the cookbook. In our chef-cookbooks org this reduces the number of times we check disk for the .foodcritic file and then parse its contents from 1379 (1 per file) to 120 (1 per cookbook). This reduces the Foodcritic runtime by 2.83% on my system with a nice fast SSD. That percent is only going to go up as disk gets slower.
    
    The PR also improves failure behaviors with bad/missing rule files:
    - Fail if the user specifies a rule file on the CLI and it's not there. Previously we just silently continued, which is awful
    - Fail if we can't read or parse the rule file, which resolves another complaint about how we handle failures in these files
    
    Signed-off-by: Tim Smith <tsmith@chef.io>
Commits on Apr 11, 2018
  1. Merge pull request #752 from Foodcritic/cache_cookbook_lookups

    tas50 committed Apr 11, 2018
    Cache cookbook lookups
  2. Don't use the abs path unless we need to

    tas50 committed Apr 11, 2018
    Signed-off-by: Tim Smith <tsmith@chef.io>
  3. Cache cookbook lookups

    tas50 committed Apr 11, 2018
    We lookup the path to cookbooks a lot and it requires a bit of logic to determine where the cookbook is. When I ran this against the collection of cookbooks in the chef-cookbooks org it dropped the time spent looking up cookbooks from 3.7 seconds to .1 seconds.
    
    Signed-off-by: Tim Smith <tsmith@chef.io>
  4. Release 13.0.1

    tas50 committed Apr 11, 2018
    Signed-off-by: Tim Smith <tsmith@chef.io>
  5. Merge pull request #751 from Foodcritic/discover_templates

    tas50 committed Apr 11, 2018
    Properly discover templates not in templates/default/
  6. Properly discover templates not in templates/default/

    tas50 committed Apr 11, 2018
    In Chef 12 we made it so you no longer needed to stick templates in the "default" directory, but foodcritic was still expecting them to be in a directory. This simple fix makes it so we can work with both cases.
    
    Signed-off-by: Tim Smith <tsmith@chef.io>
  7. Merge pull request #746 from Foodcritic/fail_right

    tas50 committed Apr 11, 2018
    Report the file that failed to parse on parsing errors
Commits on Apr 7, 2018
  1. Add FC120: Do not set the name property directly on a resource

    tas50 committed Apr 7, 2018
    People need to stop doing this and they don't know better right now.
    
    Signed-off-by: Tim Smith <tsmith@chef.io>
  2. Add FC116: Cookbook depends on the deprecated compat_resource cookbook

    tas50 committed Apr 7, 2018
    compat_resource isn't required with later released of Chef 12 and should
    not be used in modern cookbooks.
    
    Signed-off-by: Tim Smith <tsmith@chef.io>
  3. Add FC122: Use the build_essential resource instead of the recipe

    tas50 committed Apr 7, 2018
    This gets people ready to use the built in build_essential resource in
    Chef 14
    
    Signed-off-by: Tim Smith <tsmith@chef.io>
Commits on Apr 4, 2018
  1. Merge pull request #745 from scotthain/shain/force_utf8

    tas50 committed Apr 4, 2018
    Force UTF8 encoding
  2. Report the file that failed to parse on parsing errors

    tas50 committed Apr 4, 2018
    Right now if you provide a repo with a file that can't be parsed we just
    fail, leaving you to figure out what file was bad. With this change we
    rescue and report the failure.
    
    Signed-off-by: Tim Smith <tsmith@chef.io>
  3. Force UTF8 encoding

    scotthain committed Apr 4, 2018
    Signed-off-by: Scott Hain <shain@chef.io>
Commits on Mar 12, 2018
  1. Update FC085 to not be a chef13 check

    tas50 committed Mar 12, 2018
    This isn't actually going to break in chef13
    
    Signed-off-by: Tim Smith <tsmith@chef.io>
Commits on Mar 8, 2018
  1. Release 13.0

    tas50 committed Mar 8, 2018
    Signed-off-by: Tim Smith <tsmith@chef.io>
  2. Merge pull request #737 from richardc/FC007-test-typo

    tas50 committed Mar 8, 2018
    Corrects a typo in the tests for FC007
  3. Merge pull request #743 from Foodcritic/rubocop

    tas50 committed Mar 8, 2018
    Resolve all the rubocop warnings in Chefstyle 0.8.0
Commits on Mar 7, 2018
  1. Resolve all the rubocop warnings in Chefstyle 0.8.0

    tas50 committed Mar 7, 2018
    Signed-off-by: Tim Smith <tsmith@chef.io>
  2. Disable rubocop in the features directory

    tas50 committed Mar 7, 2018
    We're slowly killing these off and they're not app code so lets not bother.
    
    Signed-off-by: Tim Smith <tsmith@chef.io>
  3. Merge pull request #742 from richardc/rc-red-master-travis

    tas50 committed Mar 7, 2018
    Fixup failing travis on master
  4. (maint) Fix travis

    richardc committed Mar 7, 2018
    * Pin chefstyle to ~> 0.5.0 to avoid bringing in rubocop 0.52.1 with its new checks
    * Upgrade system gems to fix bundler in RVM 2.5.0
    
    This fixes issues with the regression tests resolving to the incorrect
    bundler, cauing this error with the 2.5.0 RVM:
    
      1) regression test with cookbook users should match expected output
         Failure/Error: command("git clone -q https://github.com/chef-cookbooks/#{name}.git .")
    
         Mixlib::ShellOut::ShellCommandFailed:
           Expected process to exit with [0], but received '1'
           ---- Begin output of bundle exec git clone -q https://github.com/chef-cookbooks/users.git . ----
           STDOUT:
           STDERR: /home/travis/.rvm/gems/ruby-2.5.0/bin/bundle:23:in `load': cannot load such file -- /home/travis/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/exe/bundle (LoadError)
           	from /home/travis/.rvm/gems/ruby-2.5.0/bin/bundle:23:in `<main>'
           	from /home/travis/.rvm/gems/ruby-2.5.0/bin/ruby_executable_hooks:15:in `eval'
           	from /home/travis/.rvm/gems/ruby-2.5.0/bin/ruby_executable_hooks:15:in `<main>'
           ---- End output of bundle exec git clone -q https://github.com/chef-cookbooks/users.git . ----
           Ran bundle exec git clone -q https://github.com/chef-cookbooks/users.git . returned 1
         # ./vendor/bundle/ruby/2.5.0/gems/mixlib-shellout-2.3.2/lib/mixlib/shellout.rb:293:in `invalid!'
         # ./vendor/bundle/ruby/2.5.0/gems/mixlib-shellout-2.3.2/lib/mixlib/shellout.rb:280:in `error!'
         # ./vendor/bundle/ruby/2.5.0/gems/rspec-command-1.0.3/lib/rspec_command.rb:111:in `block in command'
         # ./vendor/bundle/ruby/2.5.0/gems/rspec-command-1.0.3/lib/rspec_command.rb:108:in `tap'
         # ./vendor/bundle/ruby/2.5.0/gems/rspec-command-1.0.3/lib/rspec_command.rb:108:in `command'
         # ./spec/regression/regression_spec.rb:11:in `block (4 levels) in <top (required)>'
         # ./vendor/bundle/ruby/2.5.0/gems/rspec-command-1.0.3/lib/rspec_command.rb:47:in `block (2 levels) in <module:RSpecCommand>'
         # ./vendor/bundle/ruby/2.5.0/gems/rspec-command-1.0.3/lib/rspec_command.rb:45:in `block in <module:RSpecCommand>'
Commits on Mar 6, 2018
  1. Merge pull request #741 from Foodcritic/fix_tags

    tas50 committed Mar 6, 2018
    Take chef12 tags off issue_url and source_url