chef / chef-web-docs

All The Documentation
https://docs.chef.io
Other
132 stars 435 forks source link

Run cookstyle on example code, many warnings/correctness errors show up #1126

Closed dragon788 closed 6 years ago

dragon788 commented 6 years ago

For example this style for variables from the templates page causes cookstyle to complain.

  template '/etc/sudoers' do
  source 'sudoers.erb'
  mode '0440'
  owner 'root'
  group 'root'
  variables({
    sudoers_groups: node['authorization']['sudo']['groups'],
    sudoers_users: node['authorization']['sudo']['users']
  })
end
brewn commented 6 years ago

Given the amount of ruby code blocks in our documentation, we're going to need an automated process to run them through cookstyle and ensure that they're up to date. That's something that we're working on as part of our move to a new Middleman-based docs site, which will be introduced in the near future.

Nonetheless, I hate to close an issue without a PR to reference as a show of progress / completion, so I've run the cookbook code blocks in the templates guide through cookstyle: https://github.com/chef/chef-web-docs/pull/1161

There will be more progress on this front soon.