From 11f7e6e1b4e53e4bdd47580353384d6eb6bbec3a Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Mon, 9 Feb 2015 21:29:53 +0100 Subject: [PATCH] Add Papyrus and GAP grammars to whitelist --- test/test_grammars.rb | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/test/test_grammars.rb b/test/test_grammars.rb index 188bc187..f30289a6 100644 --- a/test/test_grammars.rb +++ b/test/test_grammars.rb @@ -3,12 +3,16 @@ require_relative "./helper" class TestGrammars < Minitest::Test ROOT = File.expand_path("../..", __FILE__) - # These grammars have no license but have been grandfathered in. New grammars - # must have a license that allows redistribution. - UNLICENSED_GRAMMARS_WHITELIST = %w[ - vendor/grammars/Sublime-Lasso - vendor/grammars/Sublime-REBOL - vendor/grammars/x86-assembly-textmate-bundle + LICENSE_WHITELIST = [ + # This grammar's MIT license is inside a subdirectory. + "vendor/grammars/SublimePapyrus", + "vendor/grammars/gap-tmbundle", + + # These grammars have no license but have been grandfathered in. New grammars + # must have a license that allows redistribution. + "vendor/grammars/Sublime-Lasso", + "vendor/grammars/Sublime-REBOL", + "vendor/grammars/x86-assembly-textmate-bundle", ].freeze def setup @@ -77,9 +81,9 @@ class TestGrammars < Minitest::Test unlicensed = categories[:unlicensed] || [] unrecognized = categories[:unrecognized] || [] - disallowed_unlicensed = unlicensed - UNLICENSED_GRAMMARS_WHITELIST - disallowed_unrecognized = unrecognized - UNLICENSED_GRAMMARS_WHITELIST - extra_whitelist_entries = UNLICENSED_GRAMMARS_WHITELIST - (unlicensed | unrecognized) + disallowed_unlicensed = unlicensed - LICENSE_WHITELIST + disallowed_unrecognized = unrecognized - LICENSE_WHITELIST + extra_whitelist_entries = LICENSE_WHITELIST - (unlicensed | unrecognized) message = "" if disallowed_unlicensed.any? @@ -93,7 +97,7 @@ class TestGrammars < Minitest::Test end if extra_whitelist_entries.any? message << "\n\n" unless message.empty? - message << "The following grammar submodules are listed in UNLICENSED_GRAMMARS_WHITELIST but either have a license (yay!)\n" + message << "The following grammar submodules are listed in LICENSE_WHITELIST but either have a license (yay!)\n" message << "or have been removed from the repository. Please remove them from the whitelist.\n" message << extra_whitelist_entries.sort.join("\n") end