foodcritic 10.2.2 → 10.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -2
  3. data/Gemfile +2 -1
  4. data/README.md +7 -1
  5. data/Rakefile +55 -35
  6. data/bin/foodcritic +1 -7
  7. data/features/024_check_for_missing_platforms.feature +3 -4
  8. data/features/continuous_integration_support.feature +2 -2
  9. data/features/step_definitions/cookbook_steps.rb +24 -285
  10. data/features/support/command_helpers.rb +3 -0
  11. data/foodcritic.gemspec +12 -6
  12. data/lib/foodcritic/api.rb +14 -2
  13. data/lib/foodcritic/command_line.rb +8 -0
  14. data/lib/foodcritic/linter.rb +1 -1
  15. data/lib/foodcritic/output.rb +17 -3
  16. data/lib/foodcritic/rules/fc008.rb +8 -6
  17. data/lib/foodcritic/rules/fc024.rb +1 -1
  18. data/lib/foodcritic/rules/fc045.rb +1 -8
  19. data/lib/foodcritic/rules/fc068.rb +1 -1
  20. data/lib/foodcritic/rules/fc069.rb +365 -0
  21. data/lib/foodcritic/rules/fc070.rb +63 -0
  22. data/lib/foodcritic/rules/fc071.rb +6 -0
  23. data/lib/foodcritic/rules/fc072.rb +6 -0
  24. data/lib/foodcritic/rules/fc073.rb +17 -0
  25. data/lib/foodcritic/rules/fc074.rb +10 -0
  26. data/lib/foodcritic/rules/fc075.rb +9 -0
  27. data/lib/foodcritic/version.rb +1 -1
  28. data/spec/functional/fc001_spec.rb +67 -0
  29. data/spec/functional/fc008_spec.rb +33 -0
  30. data/spec/functional/fc011_spec.rb +20 -0
  31. data/spec/functional/fc012_spec.rb +20 -0
  32. data/spec/functional/fc016_spec.rb +48 -0
  33. data/spec/functional/fc028_spec.rb +48 -0
  34. data/spec/functional/fc029_spec.rb +33 -0
  35. data/spec/functional/fc031_spec.rb +14 -0
  36. data/spec/functional/fc042_spec.rb +13 -0
  37. data/spec/functional/fc045_spec.rb +18 -0
  38. data/spec/functional/fc052_spec.rb +13 -0
  39. data/spec/functional/fc053_spec.rb +13 -0
  40. data/spec/functional/fc055_spec.rb +18 -0
  41. data/spec/functional/fc056_spec.rb +18 -0
  42. data/spec/functional/fc061_spec.rb +48 -0
  43. data/spec/functional/fc062_spec.rb +13 -0
  44. data/spec/functional/fc063_spec.rb +18 -0
  45. data/spec/functional/fc064_spec.rb +13 -0
  46. data/spec/functional/fc065_spec.rb +13 -0
  47. data/spec/functional/fc066_spec.rb +13 -0
  48. data/spec/functional/fc067_spec.rb +13 -0
  49. data/spec/functional/fc068_spec.rb +13 -0
  50. data/spec/functional/fc069_spec.rb +23 -0
  51. data/spec/functional/fc070_spec.rb +38 -0
  52. data/spec/functional/fc071_spec.rb +14 -0
  53. data/spec/functional/fc072_spec.rb +13 -0
  54. data/spec/functional/fc073_spec.rb +56 -0
  55. data/spec/functional/fc074_spec.rb +39 -0
  56. data/spec/functional/fc075_spec.rb +41 -0
  57. data/spec/functional/root_aliases_spec.rb +13 -0
  58. data/spec/regression/cookbooks.txt +0 -2
  59. data/spec/regression/expected/activemq.txt +5 -0
  60. data/spec/regression/expected/apparmor.txt +8 -0
  61. data/spec/regression/expected/apt.txt +12 -0
  62. data/spec/regression/expected/aws.txt +13 -0
  63. data/spec/regression/expected/bluepill.txt +6 -0
  64. data/spec/regression/expected/boost.txt +6 -0
  65. data/spec/regression/expected/build-essential.txt +6 -0
  66. data/spec/regression/expected/chef-client.txt +13 -0
  67. data/spec/regression/expected/chef-server.txt +12 -0
  68. data/spec/regression/expected/chef.txt +36 -0
  69. data/spec/regression/expected/chef_handler.txt +7 -0
  70. data/spec/regression/expected/cron.txt +7 -0
  71. data/spec/regression/expected/database.txt +13 -0
  72. data/spec/regression/expected/dmg.txt +12 -0
  73. data/spec/regression/expected/drbd.txt +25 -0
  74. data/spec/regression/expected/dynect.txt +29 -0
  75. data/spec/regression/expected/erlang.txt +4 -0
  76. data/spec/regression/expected/fail2ban.txt +4 -0
  77. data/spec/regression/expected/firewall.txt +12 -0
  78. data/spec/regression/expected/gecode.txt +8 -0
  79. data/spec/regression/expected/gems.txt +31 -0
  80. data/spec/regression/expected/gunicorn.txt +9 -0
  81. data/spec/regression/expected/heartbeat.txt +8 -0
  82. data/spec/regression/expected/homebrew.txt +8 -0
  83. data/spec/regression/expected/iis.txt +30 -0
  84. data/spec/regression/expected/iptables.txt +8 -0
  85. data/spec/regression/expected/jetty.txt +11 -0
  86. data/spec/regression/expected/jpackage.txt +8 -0
  87. data/spec/regression/expected/keepalived.txt +4 -0
  88. data/spec/regression/expected/kickstart.txt +14 -0
  89. data/spec/regression/expected/logwatch.txt +4 -0
  90. data/spec/regression/expected/lvm.txt +12 -0
  91. data/spec/regression/expected/maradns.txt +13 -0
  92. data/spec/regression/expected/maven.txt +9 -0
  93. data/spec/regression/expected/memcached.txt +30 -0
  94. data/spec/regression/expected/motd-tail.txt +4 -0
  95. data/spec/regression/expected/mysql.txt +12 -0
  96. data/spec/regression/expected/ohai.txt +6 -0
  97. data/spec/regression/expected/openldap.txt +10 -0
  98. data/spec/regression/expected/openssh.txt +4 -0
  99. data/spec/regression/expected/openssl.txt +5 -0
  100. data/spec/regression/expected/partial_search.txt +5 -0
  101. data/spec/regression/expected/passenger_apache2.txt +29 -0
  102. data/spec/regression/expected/perl.txt +11 -0
  103. data/spec/regression/expected/php.txt +9 -0
  104. data/spec/regression/expected/postfix.txt +6 -0
  105. data/spec/regression/expected/powershell.txt +8 -0
  106. data/spec/regression/expected/resolver.txt +6 -0
  107. data/spec/regression/expected/rsync.txt +10 -0
  108. data/spec/regression/expected/rsyslog.txt +8 -0
  109. data/spec/regression/expected/sql_server.txt +4 -0
  110. data/spec/regression/expected/sqlite.txt +4 -0
  111. data/spec/regression/expected/ssh_known_hosts.txt +5 -0
  112. data/spec/regression/expected/stompserver.txt +5 -0
  113. data/spec/regression/expected/subversion.txt +5 -0
  114. data/spec/regression/expected/sudo.txt +8 -0
  115. data/spec/regression/expected/tftp.txt +5 -0
  116. data/spec/regression/expected/tomcat.txt +8 -0
  117. data/spec/regression/expected/transmission.txt +10 -0
  118. data/spec/regression/expected/ubuntu.txt +4 -0
  119. data/spec/regression/expected/ufw.txt +9 -0
  120. data/spec/regression/expected/unicorn.txt +6 -0
  121. data/spec/regression/expected/users.txt +7 -0
  122. data/spec/regression/expected/vim.txt +6 -0
  123. data/spec/regression/expected/webpi.txt +7 -0
  124. data/spec/regression/expected/whitelist-node-attrs.txt +6 -0
  125. data/spec/regression/expected/windows.txt +57 -0
  126. data/spec/regression/expected/wix.txt +4 -0
  127. data/spec/regression/expected/xfs.txt +4 -0
  128. data/spec/regression/expected/xml.txt +4 -0
  129. data/spec/regression/expected/yum.txt +17 -0
  130. data/spec/regression/expected/zlib.txt +4 -0
  131. data/spec/regression/expected/zsh.txt +4 -0
  132. data/spec/regression/regression_spec.rb +16 -10
  133. data/spec/spec_helper.rb +115 -10
  134. data/spec/{foodcritic → unit}/api_spec.rb +549 -593
  135. data/spec/{foodcritic → unit}/chef_spec.rb +15 -15
  136. data/spec/unit/command_line_spec.rb +122 -0
  137. data/spec/{foodcritic → unit}/domain_spec.rb +12 -12
  138. data/spec/{foodcritic → unit}/linter_spec.rb +20 -35
  139. data/spec/{foodcritic → unit}/template_spec.rb +13 -13
  140. metadata +161 -33
  141. data/features/001_check_node_access.feature +0 -60
  142. data/features/008_check_for_boilerplate_metadata.feature +0 -25
  143. data/features/011_check_for_markdown_readme.feature +0 -20
  144. data/features/012_check_for_deprecated_readme_format.feature +0 -20
  145. data/features/016_check_for_no_lwrp_default_action.feature +0 -25
  146. data/features/028_check_for_incorrect_platform_method.feature +0 -20
  147. data/features/029_check_for_no_leading_cookbook_name.feature +0 -18
  148. data/features/031_check_for_metadata_existence.feature +0 -15
  149. data/features/042_check_for_deprecated_require_recipe.feature +0 -15
  150. data/features/045_check_for_cookbook_name_in_metadata.feature +0 -20
  151. data/features/052_check_for_metadata_using_suggests_keyword.feature +0 -15
  152. data/features/053_check_for_metadata_using_recommends_keyword.feature +0 -15
  153. data/features/055_check_for_no_maintainer.feature +0 -25
  154. data/features/056_check_for_no_maintainer_email.feature +0 -25
  155. data/features/061_valid_cookbook_version_should_be_defined.feature +0 -55
  156. data/features/062_cookbook_should_have_cookbook_version.feature +0 -50
  157. data/features/063_cookbook_incorrectly_depends_on_itself.feature +0 -15
  158. data/features/064_check_for_no_issues_url.feature +0 -25
  159. data/features/065_check_for_no_source_url.feature +0 -25
  160. data/features/066_check_for_no_chef_version_metadata.feature +0 -20
  161. data/features/067_check_for_no_supports_metadata.feature +0 -20
  162. data/features/068_check_for_no_license_metadata.feature +0 -20
  163. data/spec/foodcritic/command_line_spec.rb +0 -74
  164. data/spec/regression/expected-output.txt +0 -355
  165. data/spec/regression_helpers.rb +0 -37
@@ -79,6 +79,9 @@ module FoodCritic
79
79
  "FC066" => "Ensure chef_version is set in metadata",
80
80
  "FC067" => "Ensure at least one platform supported in metadata",
81
81
  "FC068" => "Ensure license is set in metadata",
82
+ "FC069" => "Ensure standardized license defined in metadata",
83
+ "FC070" => "Ensure supports metadata defines valid platforms",
84
+ "FC071" => "Missing LICENSE file",
82
85
  "FCTEST001" => "Test Rule",
83
86
  }
84
87
 
data/foodcritic.gemspec CHANGED
@@ -11,6 +11,14 @@ Gem::Specification.new do |s|
11
11
  s.license = "MIT"
12
12
  s.executables << "foodcritic"
13
13
  s.required_ruby_version = ">= 2.2.2"
14
+
15
+ s.files = Dir["chef_dsl_metadata/*.json"] +
16
+ Dir["lib/**/*.rb"] +
17
+ Dir["misc/**/*"]
18
+ s.files += Dir["Rakefile"] + Dir["Gemfile"] + Dir["*.gemspec"]
19
+ s.files += Dir["spec/**/*"] + Dir["features/**/*"]
20
+ s.files += Dir["*.md"] + Dir["LICENSE"] + Dir["man/*"]
21
+
14
22
  s.add_dependency("cucumber-core", ">= 1.3")
15
23
  s.add_dependency("nokogiri", ">= 1.5", "< 2.0")
16
24
  s.add_dependency("rake")
@@ -18,10 +26,8 @@ Gem::Specification.new do |s|
18
26
  s.add_dependency("yajl-ruby", "~> 1.1")
19
27
  s.add_dependency("erubis")
20
28
  s.add_dependency("rufus-lru", "~> 1.0")
21
- s.files = Dir["chef_dsl_metadata/*.json"] +
22
- Dir["lib/**/*.rb"] +
23
- Dir["misc/**/*"]
24
- s.files += Dir["Rakefile"] + Dir["Gemfile"] + Dir["*.gemspec"]
25
- s.files += Dir["spec/**/*"] + Dir["features/**/*"]
26
- s.files += Dir["*.md"] + Dir["LICENSE"] + Dir["man/*"]
29
+
30
+ s.add_development_dependency "rspec", "~> 3.5"
31
+ s.add_development_dependency "fuubar", "~> 2.0"
32
+ s.add_development_dependency "rspec-command", "~> 1.0"
27
33
  end
@@ -12,6 +12,18 @@ module FoodCritic
12
12
 
13
13
  class RecursedTooFarError < StandardError; end
14
14
 
15
+ # Match unless a file exists using the basepath of the cookbook and the filepath
16
+ #
17
+ # @author Joseph Holsten - joseph@josephholsten.com
18
+ # @since 10.3
19
+ # @param basepath [String] base path of the cookbook
20
+ # @param filepath [String] path to the file within the cookbook
21
+ # @return [String] the absolute path to the base of the cookbook
22
+ def ensure_file_exists(basepath, filepath)
23
+ path = File.join(basepath, filepath)
24
+ [file_match(path)] unless File.exist?(path)
25
+ end
26
+
15
27
  # Find attribute access by type.
16
28
  def attribute_access(ast, options = {})
17
29
  options = { type: :any, ignore_calls: false }.merge!(options)
@@ -37,7 +49,7 @@ module FoodCritic
37
49
  # @deprecated chef-solo functionality in Chef has been replaced with local-mode
38
50
  # so this helper is no longer necessary and will be removed in Foodcritic 11.0
39
51
  def checks_for_chef_solo?(ast)
40
- puts "the checks_for_chef_solo? helper is deprecated and will be removed from the next release of Foodcritic"
52
+ $stderr.puts "the checks_for_chef_solo? helper is deprecated and will be removed from the next release of Foodcritic"
41
53
  raise_unless_xpath!(ast)
42
54
  # TODO: This expression is too loose, but also will fail to match other
43
55
  # types of conditionals.
@@ -61,7 +73,7 @@ module FoodCritic
61
73
  # @deprecated chef-solo functionality in Chef has been replaced with local-mode
62
74
  # so this helper is no longer necessary and will be removed in Foodcritic 11.0
63
75
  def chef_solo_search_supported?(recipe_path)
64
- puts "the chef_solo_search_supported? helper is deprecated and will be removed from the next release of Foodcritic"
76
+ $stderr.puts "the chef_solo_search_supported? helper is deprecated and will be removed from the next release of Foodcritic"
65
77
  return false if recipe_path.nil? || !File.exist?(recipe_path)
66
78
 
67
79
  # Look for the chef-solo-search library.
@@ -1,6 +1,14 @@
1
1
  module FoodCritic
2
2
  # Command line parsing.
3
3
  class CommandLine
4
+ def self.main(argv = ARGV, out = $stdout)
5
+ cmd_line = CommandLine.new(argv)
6
+ review, status = Linter.run(cmd_line)
7
+ printer = cmd_line.show_context? ? ContextOutput.new(out) : SummaryOutput.new(out)
8
+ printer.output(review)
9
+ status.to_i
10
+ end
11
+
4
12
  # Create a new instance of CommandLine
5
13
  #
6
14
  # @param [Array] args The command line arguments
@@ -257,7 +257,7 @@ module FoodCritic
257
257
 
258
258
  if File.directory?(dir)
259
259
  glob = if path_type == :cookbook
260
- "{metadata.rb,{attributes,definitions,libraries,"\
260
+ "{metadata.rb,attributes.rb,recipe.rb,{attributes,definitions,libraries,"\
261
261
  "providers,recipes,resources}/*.rb,templates/*/*.erb}"
262
262
  else
263
263
  "*.rb"
@@ -1,8 +1,22 @@
1
1
  require "set"
2
2
 
3
3
  module FoodCritic
4
+ class Output
5
+ # Create Output writer.
6
+ #
7
+ # @param out [File] File-like object to output to.
8
+ def initialize(out)
9
+ @out = out
10
+ end
11
+
12
+ # Write a line of output.
13
+ def puts(*args)
14
+ @out.puts(*args)
15
+ end
16
+ end
17
+
4
18
  # Default output showing a summary view.
5
- class SummaryOutput
19
+ class SummaryOutput < Output
6
20
  # Output a summary view only listing the matching rules, file and line
7
21
  # number.
8
22
  #
@@ -13,7 +27,7 @@ module FoodCritic
13
27
  end
14
28
 
15
29
  # Display rule matches with surrounding context.
16
- class ContextOutput
30
+ class ContextOutput < Output
17
31
  # Output the review showing matching lines with context.
18
32
  #
19
33
  # @param [Review] review The review to output.
@@ -101,7 +115,7 @@ module FoodCritic
101
115
  # @param bg [String] background color
102
116
  # @param attr [String] any formatting options
103
117
  def ansi_print(text, fg, bg = nil, attr = nil)
104
- unless STDOUT.tty?
118
+ unless @out.tty?
105
119
  puts text
106
120
  return
107
121
  end
@@ -1,12 +1,14 @@
1
1
  rule "FC008", "Generated cookbook metadata needs updating" do
2
2
  tags %w{metadata supermarket}
3
3
  metadata do |ast, filename|
4
- {
5
- "maintainer" => "YOUR_COMPANY_NAME",
6
- "maintainer_email" => "YOUR_EMAIL",
7
- }.map do |field, value|
8
- ast.xpath(%Q{//command[ident/@value='#{field}']/
9
- descendant::tstring_content[@value='#{value}']})
4
+ [
5
+ { "maintainer" => "YOUR_COMPANY_NAME" },
6
+ { "maintainer" => "The Authors" },
7
+ { "maintainer_email" => "YOUR_EMAIL" },
8
+ { "maintainer_email" => "you@example.com" },
9
+ ].map do |metadata_hash|
10
+ ast.xpath(%Q{//command[ident/@value='#{metadata_hash.keys[0]}']/
11
+ descendant::tstring_content[@value='#{metadata_hash.values[0]}']})
10
12
  end
11
13
  end
12
14
  end
@@ -1,6 +1,6 @@
1
1
  rule "FC024", "Consider adding platform equivalents" do
2
2
  tags %w{portability}
3
- RHEL = %w{amazon centos redhat scientific oracle}
3
+ RHEL = %w{centos redhat scientific oracle}
4
4
  recipe do |ast, filename|
5
5
  next if Pathname.new(filename).basename.to_s == "metadata.rb"
6
6
  metadata_path = Pathname.new(
@@ -1,13 +1,6 @@
1
1
  rule "FC045", "Metadata does not contain cookbook name" do
2
2
  tags %w{correctness metadata chef12}
3
3
  metadata do |ast, filename|
4
- unless ast.xpath('descendant::stmts_add/command/ident/@value="name"')
5
- [file_match(filename)]
6
- end
7
- end
8
- cookbook do |filename|
9
- if !File.exist?(File.join(filename, "metadata.rb"))
10
- [file_match(File.join(filename, "metadata.rb"))]
11
- end
4
+ [file_match(filename)] unless field(ast, "name").any?
12
5
  end
13
6
  end
@@ -1,5 +1,5 @@
1
1
  rule "FC068", "Ensure license is set in metadata" do
2
- tags %w{metadata supermarket}
2
+ tags %w{metadata supermarket license}
3
3
  metadata do |ast, filename|
4
4
  [file_match(filename)] unless field(ast, "license").any?
5
5
  end
@@ -0,0 +1,365 @@
1
+ rule "FC069", "Ensure standardized license defined in metadata" do
2
+ tags %w{metadata supermarket license}
3
+ metadata do |ast, filename|
4
+ begin
5
+ license = ast.xpath(%Q{//command[ident/@value='license']/
6
+ descendant::tstring_content}).attribute("value").to_s
7
+
8
+ # list of valid SPDX.org license strings. To build an array run this:
9
+ # require 'json'
10
+ # require 'net/http'
11
+ # json_data = JSON.parse(Net::HTTP.get(URI('https://raw.githubusercontent.com/spdx/license-list-data/master/json/licenses.json')))
12
+ # licenses = json_data['licenses'].map {|l| l['licenseId'] }
13
+ #
14
+ valid = %w{
15
+ Glide
16
+ Abstyles
17
+ AFL-1.1
18
+ AFL-1.2
19
+ AFL-2.0
20
+ AFL-2.1
21
+ AFL-3.0
22
+ AMPAS
23
+ APL-1.0
24
+ Adobe-Glyph
25
+ APAFML
26
+ Adobe-2006
27
+ AGPL-1.0
28
+ Afmparse
29
+ Aladdin
30
+ ADSL
31
+ AMDPLPA
32
+ ANTLR-PD
33
+ Apache-1.0
34
+ Apache-1.1
35
+ Apache-2.0
36
+ AML
37
+ APSL-1.0
38
+ APSL-1.1
39
+ APSL-1.2
40
+ APSL-2.0
41
+ Artistic-1.0
42
+ Artistic-1.0-Perl
43
+ Artistic-1.0-cl8
44
+ Artistic-2.0
45
+ AAL
46
+ Bahyph
47
+ Barr
48
+ Beerware
49
+ BitTorrent-1.0
50
+ BitTorrent-1.1
51
+ BSL-1.0
52
+ Borceux
53
+ BSD-2-Clause
54
+ BSD-2-Clause-FreeBSD
55
+ BSD-2-Clause-NetBSD
56
+ BSD-3-Clause
57
+ BSD-3-Clause-Clear
58
+ BSD-3-Clause-No-Nuclear-License
59
+ BSD-3-Clause-No-Nuclear-License-2014
60
+ BSD-3-Clause-No-Nuclear-Warranty
61
+ BSD-4-Clause
62
+ BSD-Protection
63
+ BSD-Source-Code
64
+ BSD-3-Clause-Attribution
65
+ 0BSD
66
+ BSD-4-Clause-UC
67
+ bzip2-1.0.5
68
+ bzip2-1.0.6
69
+ Caldera
70
+ CECILL-1.0
71
+ CECILL-1.1
72
+ CECILL-2.0
73
+ CECILL-2.1
74
+ CECILL-B
75
+ CECILL-C
76
+ ClArtistic
77
+ MIT-CMU
78
+ CNRI-Jython
79
+ CNRI-Python
80
+ CNRI-Python-GPL-Compatible
81
+ CPOL-1.02
82
+ CDDL-1.0
83
+ CDDL-1.1
84
+ CPAL-1.0
85
+ CPL-1.0
86
+ CATOSL-1.1
87
+ Condor-1.1
88
+ CC-BY-1.0
89
+ CC-BY-2.0
90
+ CC-BY-2.5
91
+ CC-BY-3.0
92
+ CC-BY-4.0
93
+ CC-BY-ND-1.0
94
+ CC-BY-ND-2.0
95
+ CC-BY-ND-2.5
96
+ CC-BY-ND-3.0
97
+ CC-BY-ND-4.0
98
+ CC-BY-NC-1.0
99
+ CC-BY-NC-2.0
100
+ CC-BY-NC-2.5
101
+ CC-BY-NC-3.0
102
+ CC-BY-NC-4.0
103
+ CC-BY-NC-ND-1.0
104
+ CC-BY-NC-ND-2.0
105
+ CC-BY-NC-ND-2.5
106
+ CC-BY-NC-ND-3.0
107
+ CC-BY-NC-ND-4.0
108
+ CC-BY-NC-SA-1.0
109
+ CC-BY-NC-SA-2.0
110
+ CC-BY-NC-SA-2.5
111
+ CC-BY-NC-SA-3.0
112
+ CC-BY-NC-SA-4.0
113
+ CC-BY-SA-1.0
114
+ CC-BY-SA-2.0
115
+ CC-BY-SA-2.5
116
+ CC-BY-SA-3.0
117
+ CC-BY-SA-4.0
118
+ CC0-1.0
119
+ Crossword
120
+ CrystalStacker
121
+ CUA-OPL-1.0
122
+ Cube
123
+ curl
124
+ D-FSL-1.0
125
+ diffmark
126
+ WTFPL
127
+ DOC
128
+ Dotseqn
129
+ DSDP
130
+ dvipdfm
131
+ EPL-1.0
132
+ ECL-1.0
133
+ ECL-2.0
134
+ eGenix
135
+ EFL-1.0
136
+ EFL-2.0
137
+ MIT-advertising
138
+ MIT-enna
139
+ Entessa
140
+ ErlPL-1.1
141
+ EUDatagrid
142
+ EUPL-1.0
143
+ EUPL-1.1
144
+ Eurosym
145
+ Fair
146
+ MIT-feh
147
+ Frameworx-1.0
148
+ FreeImage
149
+ FTL
150
+ FSFAP
151
+ FSFUL
152
+ FSFULLR
153
+ Giftware
154
+ GL2PS
155
+ Glulxe
156
+ AGPL-3.0
157
+ GFDL-1.1
158
+ GFDL-1.2
159
+ GFDL-1.3
160
+ GPL-1.0
161
+ GPL-2.0
162
+ GPL-3.0
163
+ LGPL-2.1
164
+ LGPL-3.0
165
+ LGPL-2.0
166
+ gnuplot
167
+ gSOAP-1.3b
168
+ HaskellReport
169
+ HPND
170
+ IBM-pibs
171
+ IPL-1.0
172
+ ICU
173
+ ImageMagick
174
+ iMatix
175
+ Imlib2
176
+ IJG
177
+ Info-ZIP
178
+ Intel-ACPI
179
+ Intel
180
+ Interbase-1.0
181
+ IPA
182
+ ISC
183
+ JasPer-2.0
184
+ JSON
185
+ LPPL-1.0
186
+ LPPL-1.1
187
+ LPPL-1.2
188
+ LPPL-1.3a
189
+ LPPL-1.3c
190
+ Latex2e
191
+ BSD-3-Clause-LBNL
192
+ Leptonica
193
+ LGPLLR
194
+ Libpng
195
+ libtiff
196
+ LAL-1.2
197
+ LAL-1.3
198
+ LiLiQ-P-1.1
199
+ LiLiQ-Rplus-1.1
200
+ LiLiQ-R-1.1
201
+ LPL-1.02
202
+ LPL-1.0
203
+ MakeIndex
204
+ MTLL
205
+ MS-PL
206
+ MS-RL
207
+ MirOS
208
+ MITNFA
209
+ MIT
210
+ Motosoto
211
+ MPL-1.0
212
+ MPL-1.1
213
+ MPL-2.0
214
+ MPL-2.0-no-copyleft-exception
215
+ mpich2
216
+ Multics
217
+ Mup
218
+ NASA-1.3
219
+ Naumen
220
+ NBPL-1.0
221
+ Net-SNMP
222
+ NetCDF
223
+ NGPL
224
+ NOSL
225
+ NPL-1.0
226
+ NPL-1.1
227
+ Newsletr
228
+ NLPL
229
+ Nokia
230
+ NPOSL-3.0
231
+ NLOD-1.0
232
+ Noweb
233
+ NRL
234
+ NTP
235
+ Nunit
236
+ OCLC-2.0
237
+ ODbL-1.0
238
+ PDDL-1.0
239
+ OCCT-PL
240
+ OGTSL
241
+ OLDAP-2.2.2
242
+ OLDAP-1.1
243
+ OLDAP-1.2
244
+ OLDAP-1.3
245
+ OLDAP-1.4
246
+ OLDAP-2.0
247
+ OLDAP-2.0.1
248
+ OLDAP-2.1
249
+ OLDAP-2.2
250
+ OLDAP-2.2.1
251
+ OLDAP-2.3
252
+ OLDAP-2.4
253
+ OLDAP-2.5
254
+ OLDAP-2.6
255
+ OLDAP-2.7
256
+ OLDAP-2.8
257
+ OML
258
+ OPL-1.0
259
+ OSL-1.0
260
+ OSL-1.1
261
+ OSL-2.0
262
+ OSL-2.1
263
+ OSL-3.0
264
+ OpenSSL
265
+ OSET-PL-2.1
266
+ PHP-3.0
267
+ PHP-3.01
268
+ Plexus
269
+ PostgreSQL
270
+ psfrag
271
+ psutils
272
+ Python-2.0
273
+ QPL-1.0
274
+ Qhull
275
+ Rdisc
276
+ RPSL-1.0
277
+ RPL-1.1
278
+ RPL-1.5
279
+ RHeCos-1.1
280
+ RSCPL
281
+ RSA-MD
282
+ Ruby
283
+ SAX-PD
284
+ Saxpath
285
+ SCEA
286
+ SWL
287
+ SMPPL
288
+ Sendmail
289
+ SGI-B-1.0
290
+ SGI-B-1.1
291
+ SGI-B-2.0
292
+ OFL-1.0
293
+ OFL-1.1
294
+ SimPL-2.0
295
+ Sleepycat
296
+ SNIA
297
+ Spencer-86
298
+ Spencer-94
299
+ Spencer-99
300
+ SMLNJ
301
+ SugarCRM-1.1.3
302
+ SISSL
303
+ SISSL-1.2
304
+ SPL-1.0
305
+ Watcom-1.0
306
+ TCL
307
+ TCP-wrappers
308
+ Unlicense
309
+ TMate
310
+ TORQUE-1.1
311
+ TOSL
312
+ Unicode-DFS-2015
313
+ Unicode-DFS-2016
314
+ Unicode-TOU
315
+ UPL-1.0
316
+ NCSA
317
+ Vim
318
+ VOSTROM
319
+ VSL-1.0
320
+ W3C-20150513
321
+ W3C-19980720
322
+ W3C
323
+ Wsuipa
324
+ Xnet
325
+ X11
326
+ Xerox
327
+ XFree86-1.1
328
+ xinetd
329
+ xpp
330
+ XSkat
331
+ YPL-1.0
332
+ YPL-1.1
333
+ Zed
334
+ Zend-2.0
335
+ Zimbra-1.3
336
+ Zimbra-1.4
337
+ Zlib
338
+ zlib-acknowledgement
339
+ ZPL-1.1
340
+ ZPL-2.0
341
+ ZPL-2.1
342
+ eCos-2.0
343
+ GPL-1.0+
344
+ GPL-2.0+
345
+ GPL-2.0-with-autoconf-exception
346
+ GPL-2.0-with-bison-exception
347
+ GPL-2.0-with-classpath-exception
348
+ GPL-2.0-with-font-exception
349
+ GPL-2.0-with-GCC-exception
350
+ GPL-3.0+
351
+ GPL-3.0-with-autoconf-exception
352
+ GPL-3.0-with-GCC-exception
353
+ LGPL-2.1+
354
+ LGPL-3.0+
355
+ LGPL-2.0+
356
+ StandardML-NJ
357
+ WXwindows
358
+ }
359
+ valid << "All Rights Reserved" # Chef-DK's non-standard extra value
360
+ [file_match(filename)] unless valid.include?(license)
361
+ rescue NoMethodError # no license in the metadata
362
+ [file_match(filename)]
363
+ end
364
+ end
365
+ end