From 7e63399196d88ed763c6d082a93ef9830e28e5e8 Mon Sep 17 00:00:00 2001 From: Alhadis Date: Tue, 4 Oct 2016 17:23:45 +1100 Subject: [PATCH 1/3] Delete colour property for ASN.1 language This is classified on GitHub as "data", so the colour it's assigned only wastes valuable "real estate" when checking colour proximity. References: github/linguist#3113 --- lib/linguist/languages.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 269525ce..f9c7c628 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -103,7 +103,6 @@ APL: language_id: 6 ASN.1: type: data - color: "#aeead0" extensions: - ".asn" - ".asn1" From e38cc75da57504655fa37192d47350bb1586f7f5 Mon Sep 17 00:00:00 2001 From: Alhadis Date: Wed, 5 Oct 2016 13:06:49 +1100 Subject: [PATCH 2/3] Update ASN.1 grammar This stops the ASN.1 submodule from being flagged as modified due to its .DS_Store file being wiped locally by an automated process. References: ajLangley12/language-asn1#1 --- vendor/grammars/language-asn1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/grammars/language-asn1 b/vendor/grammars/language-asn1 index bc3811c7..208b6d9e 160000 --- a/vendor/grammars/language-asn1 +++ b/vendor/grammars/language-asn1 @@ -1 +1 @@ -Subproject commit bc3811c7706476e48f5085660b72b18ad028314f +Subproject commit 208b6d9ebe873180b109a286a481ca6639200d3e From 20b8188384710444e3388b969cfe0327e1d4465d Mon Sep 17 00:00:00 2001 From: Alhadis Date: Wed, 5 Oct 2016 16:14:33 +1100 Subject: [PATCH 3/3] Add test to guard against unused colours --- lib/linguist/languages.yml | 2 +- test/test_language.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index f9c7c628..c890ae40 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -19,7 +19,7 @@ # language_id - Integer used as a language-name-independent indexed field so that we can rename # languages in Linguist without reindexing all the code on GitHub. Must not be # changed for existing languages without the explicit permission of GitHub staff. -# color - CSS hex color to represent the language. +# color - CSS hex color to represent the language. Only used if type is "programming" or "prose" # tm_scope - The TextMate scope that represents this programming # language. This should match one of the scopes listed in # the grammars.yml file. Use "none" if there is no grammar diff --git a/test/test_language.rb b/test/test_language.rb index 1f6d19d2..08f60112 100644 --- a/test/test_language.rb +++ b/test/test_language.rb @@ -494,4 +494,11 @@ class TestLanguage < Minitest::Test message << missing.sort.join("\n") assert missing.empty?, message end + + def test_no_unused_colours + Language.all.each do |language| + next unless language.type == :data || language.type == :prose + assert !language.color, "Unused colour assigned to #{language.name}" + end + end end