Skip to main content

FileMode

All Cookstyle Cops


The department is: Chef/Style

The full name of the cop is: Chef/Style/FileMode


Enabled by default Supports autocorrection Target Chef Version
Enabled Yes All 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

Name Default value Configurable values
Version Added 5.0.0 String
Exclude
  • **/attributes/*
  • **/metadata.rb
  • **/Berksfile
Array

Was this page helpful?

×









Search Results