Hey Everyone,
This weeks Cookstyle is out with 4 new Chef Infa Cops as well as few nice fixes.
4 New Cops
ChefModernize/NodeInitPackage
The ChefModernize/NodeInitPackage cop detects cookbooks that detect the systemd init system by parsing the content of /proc/1/comm. Chef Infra Client 12.0 and later include a node['init_package'] attribute, which should be used instead.
ChefDeprecations/WindowsFeatureServermanagercmd
The ChefDeprecations/WindowsFeatureServermanagercmd cop detects windows_feature resources that set the install_method property to :servermanagercmd. The windows_feature resource no longer supports the legacy Server Manager command in Windows. Use :windows_feature_dism or :windows_feature_powershell instead.
ChefModernize/WindowsRegistryUAC
The ChefModernize/WindowsRegistryUAC resource detects the usage of the registry_key resource to set values in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System key in order to control UAC behavior in Windows. Chef Infra Client 15.0+ ships with a windows_uac resource that should be used instead.
ChefModernize/UseRequireRelative
The ChefModernize/UseRequireRelative cop detects cookbooks that use overly complex require statements with File.expand_path and __FILE__. These can be simplified by using require_relative instead.
Other fixes and changes
- Updated
ChefStyle/TrueClassFalseClassResourcePropertiesto no longer detectTrueClass/FalseClassin resource attributes where these are required. - Updated
ChefModernize/ExecuteAptUpdateto detect additional execute resources runningapt-get updateas well as resources notifying one of these execute resources. - Disabled RuboCop's
Naming/MethodNameandNaming/VariableNamecops since these can't be autocorrected and don't impact Chef Infra Client.
Enjoy,
Tim