Chef 13 Upgrade: knife-cookbook-doc Rubocop Updates

Featured image for sharing metadata for article
As part of an upgrade from Chef 12 to Chef 13, this is one of the posts in which I've been detailing the issues I've encountered, and how I've resolved them .

As mentioned in 'Chef 13 Upgrade: knife-cookbook-doc gem upgrade' I use the knife-cookbook-doc gem to autogenerate my cookbook documentation, with formatting of the formats:

# attributes.rb
#<> Caddy base download URL: Required to override until https://github.com/dzabel/chef-caddy/pull/1 is merged
default['caddy']['url'] = 'https://caddyserver.com/download/linux/amd64?'

# resources/site.rb
=begin
#<
@property fqdn to configure a site for. When Chef Envrionment is `staging`, the FQDN that is configured will be `staging.{fqdn}`
#>
=end
property :fqdn

However, with the upgrade to Chef 13, Rubocop has been throwing a number of errors, Do not use block comments.

This was an easy fix to add to my .rubocop.yml, allowing me to simply ignore them in the source files I was using them:

Style/BlockComments:
  Exclude:
    - 'attributes/default.rb'
    - 'recipes/*.rb'
    - 'resources/*.rb'

And although not technically part of the Chef 13 upgrade, I also wanted to note that I have the following exception for my attributes files, as they use the first format, which Rubocop isn't happy about, either.

Layout/LeadingCommentSpace:
  Exclude:
    - 'attributes/default.rb'

Written by Jamie Tanna's profile image Jamie Tanna on , and last updated on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

#blogumentation #chef-13-upgrade #chef #knife-cookbook-doc #chef-13 #documentation #chef-13-upgrade-rubocop.

This post was filed under articles.

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.