mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Merge pull request #1959 from floscher/licence
Allow British-English spelled LICENCE-files
This commit is contained in:
@@ -60,10 +60,10 @@ class TestGrammars < Minitest::Test
|
|||||||
def test_submodules_have_licenses
|
def test_submodules_have_licenses
|
||||||
categories = submodule_paths.group_by do |submodule|
|
categories = submodule_paths.group_by do |submodule|
|
||||||
files = Dir[File.join(ROOT, submodule, "*")]
|
files = Dir[File.join(ROOT, submodule, "*")]
|
||||||
license = files.find { |path| File.basename(path) =~ /\blicense\b/i } || files.find { |path| File.basename(path) =~ /\bcopying\b/i }
|
license = files.find { |path| File.basename(path) =~ /\blicen[cs]e\b/i } || files.find { |path| File.basename(path) =~ /\bcopying\b/i }
|
||||||
if license.nil?
|
if license.nil?
|
||||||
if readme = files.find { |path| File.basename(path) =~ /\Areadme\b/i }
|
if readme = files.find { |path| File.basename(path) =~ /\Areadme\b/i }
|
||||||
license = readme if File.read(readme) =~ /\blicense\b/i
|
license = readme if File.read(readme) =~ /\blicen[cs]e\b/i
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if license.nil?
|
if license.nil?
|
||||||
|
|||||||
Reference in New Issue
Block a user