Skip to main content

Chef/Style/FileMode

Cookstyle cops page

The Cookstyle cops department: Chef/Style

Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledYesAll Versions

Use strings to represent file modes to avoid confusion between octal and base 10 integer formats.

Examples

incorrect

remote_directory '/etc/my.conf' do
  content 'some content'
  mode 0600
  action :create
end

remote_directory 'handler' do
  source 'handlers'
  recursive true
  files_mode 644
  action :create
end

correct

remote_directory '/etc/my.conf' do
  content 'some content'
  mode '600'
  action :create
end

remote_directory 'handler' do
  source 'handlers'
  recursive true
  files_mode '644'
  action :create
end

Configurable attributes

NameDefault valueConfigurable values
Version Added5.0.0String
Include
    Array

    Thank you for your feedback!

    ×










    Search Results