Skip to main content

Chef/Sharing/InvalidLicenseString

Cookstyle cops page

The Cookstyle cops department: Chef/Sharing

Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledYesAll Versions

metadata.rb license field should include a SPDX compliant string or “all right reserved” (not case sensitive)

list of valid SPDX.org license strings. To build an array run this ruby:

require 'json'
require 'net/http'
json_data = JSON.parse(Net::HTTP.get(URI('https://raw.githubusercontent.com/spdx/license-list-data/master/json/licenses.json')))
licenses = json_data['licenses'].map {|l| l['licenseId'] }.sort

Examples

incorrect

license 'Apache 2.0'

correct

license 'Apache-2.0'
license 'all rights reserved'

Configurable attributes

NameDefault valueConfigurable values
Version Added5.2.0String
Include
  • **/metadata.rb
Array

Thank you for your feedback!

×









Search Results