Chef 13 Upgrade: knife-cookbook-doc Rubocop Updates

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 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.

Categories
Tags
Related Posts

Other posts you may be interested in:

Interactions with this post

Interactions with this post

This post has had 0 WebMention interactions, as of Thu, 23 May 2019 13:53:35 +0100.

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