Chef/Sharing/InvalidLicenseString
The Cookstyle cops department: Chef/Sharing
Enabled by default | Supports autocorrection | Target Chef Version |
---|---|---|
Enabled | Yes | All 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
Name | Default value | Configurable values |
---|---|---|
Version Added | 5.2.0 | String |
Include |
| Array |