Skip to content

Commit ed8cbf2

Browse files
authored
Merge pull request #1335 from github/misc-fixes
Fix license metadata, link rot, and Rubocop warnings
2 parents b4442b3 + f3b9912 commit ed8cbf2

4 files changed

Lines changed: 11 additions & 18 deletions

File tree

_licenses/bsd-4-clause.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ description: A permissive license similar to the <a href="/licenses/bsd-3-clause
77
how: Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. Replace [year] with the current year and [fullname] with the name (or names) of the copyright holders. Replace [project] with the project organization, if any, that sponsors this work.
88

99
using:
10-
Choco-solver: https://github.com/chocoteam/choco-solver/blob/master/LICENSE
1110
PMSPAUR-public: https://github.com/ArthurGodet/PMSPAUR-public/blob/master/LICENSE
11+
Sileo: https://github.com/Sileo/Sileo/blob/main/LICENSE
1212
Switchblade: https://github.com/SwitchbladeBot/switchblade/blob/dev/LICENSE
1313

1414
permissions:

_licenses/zlib.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ zlib License
3232
(C) [year] [fullname]
3333

3434
This software is provided 'as-is', without any express or implied
35-
warranty. In no event will the authors be held liable for any damages
35+
warranty. In no event will the authors be held liable for any damages
3636
arising from the use of this software.
3737

3838
Permission is granted to anyone to use this software for any purpose,

script/check-approval

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,13 @@ require 'colored'
1111
require 'fuzzy_match'
1212

1313
# Display usage instructions
14-
puts File.read(__FILE__).scan(/^# .*/)[0...3].join("\n").gsub(/^# /, '') if ARGV.count != 1
15-
16-
class TrueClass
17-
def to_s
18-
'Yes'.green
19-
end
14+
if ARGV.count != 1
15+
puts File.read(__FILE__).scan(/^# .*/)[0...3].join("\n").gsub(/^# /, '')
16+
exit 1
2017
end
2118

22-
class FalseClass
23-
def to_s
24-
'No'.red
25-
end
19+
def yes_no(value)
20+
value ? 'Yes'.green : 'No'.red
2621
end
2722

2823
license = ARGV[0].downcase.strip
@@ -47,16 +42,16 @@ rows << ['SPDX ID', id]
4742
rows << ['SPDX Name', name]
4843

4944
approvals.each do |approver, licenses|
50-
rows << ["#{approver} approved", licenses.include?(license)]
45+
rows << ["#{approver} approved", yes_no(licenses.include?(license))]
5146
end
5247

5348
license_ids = licenses.map { |l| l['id'] }
5449
current = license_ids.include?(license)
55-
rows << ['Current license', current]
50+
rows << ['Current license', yes_no(current)]
5651

5752
rows << :separator
5853
eligible = !current && spdx && approved_licenses.include?(license)
59-
rows << ['Eligible', eligible]
54+
rows << ['Eligible', yes_no(eligible)]
6055

6156
puts Terminal::Table.new title: "License: #{license}", rows:
6257
puts

spec/spec_helper.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ def spdx_list
7272
SpecHelper.spdx ||= begin
7373
url = 'https://spdx.org/licenses/licenses.json'
7474
list = JSON.parse(OpenURI.open_uri(url).read)['licenses']
75-
list.each_with_object({}) do |values, memo|
76-
memo[values['licenseId']] = values
77-
end
75+
list.to_h { |values| [values['licenseId'], values] }
7876
end
7977
end
8078

0 commit comments

Comments
 (0)