# Cookstyle 5.18 released with 2 new Chef cops!

**URL:** <https://discourse.chef.io/t/cookstyle-5-18-released-with-2-new-chef-cops/16472>\
**Category:** Chef Release Announcements\
**Created:** [January 3, 2020, 8:27pm UTC](https://discourse.chef.io/t/cookstyle-5-18-released-with-2-new-chef-cops/16472 "2020-01-03T20:27:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tas50](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/tas50/32/941_2.png) [@tas50](https://discourse.chef.io/u/tas50)\
**Post date:** [January 3, 2020, 8:27pm UTC](https://discourse.chef.io/t/cookstyle-5-18-released-with-2-new-chef-cops/16472/1 "2020-01-03T20:27:54Z")

</div>

Hey folks,

After a short holiday break, we're back with a new release of Cookstyle. This new version adds 2 new cops and improves detection/autocorrection in existing cops.

### 2 New Cops

#### ChefModernize/ResourceForcingCompileTime

The `ChefModernize/ResourceForcingCompileTime` cop detects `hostname`, `build_essential`, `chef_gem`, and `ohai_hint` resources that are being set to run at compile-time by forcing an action on the resource block. These resources include `compile-time` properties which should be set to force the resources to run at compile-time.

#### ChefModernize/ExecuteSysctl

The `ChefModernize/ExecuteSysctl` detects the usage of `execute` to load sysctl values. Chef Infra Client 14.0+ includes the `sysctl` resource which should be used to idempotently add or remove sysctl values without the need for chaining `file` and `execute` resources.

### Other fixes and changes

- The `vendor` and `files` directories in cookbooks are now better excluded when running cookstyle against a mono-repo or other collection of multiple cookbooks.
- The `ChefRedundantCode/PropertyWithRequiredAndDefault` and `ChefStyle/TrueClassFalseClassResourceProperties` cops now check resource attributes in addition to properties.
- The `ChefRedundantCode/PropertyWithRequiredAndDefault` cop now supports autocorrection by removing unnecessary default values from the property.

Enjoy,  
Tim
