From 09c642a0965487e2072d1a976b63250744954275 Mon Sep 17 00:00:00 2001 From: Victor Date: Mon, 11 Jan 2021 23:04:44 -0700 Subject: [PATCH 1/6] Add support for checksum list files --- grammars.yml | 1 + lib/linguist/languages.yml | 116 ++++++++++++++++++ samples/Checksums/bsd-style.sha256 | 3 + samples/Checksums/filenames/SHA256 | 3 + samples/Checksums/filenames/SHA256SUM | 1 + samples/Checksums/filenames/SHA256SUMS | 3 + samples/Checksums/gnu-style.sha256 | 3 + samples/Checksums/single_hash.crc | 1 + samples/Checksums/single_hash.crc32 | 1 + samples/Checksums/single_hash.md2 | 1 + samples/Checksums/single_hash.md4 | 1 + samples/Checksums/single_hash.md5 | 1 + samples/Checksums/single_hash.rmd160 | 1 + samples/Checksums/single_hash.sha1 | 1 + samples/Checksums/single_hash.sha224 | 1 + samples/Checksums/single_hash.sha256 | 1 + samples/Checksums/single_hash.sha384 | 1 + samples/Checksums/single_hash.sha512 | 1 + samples/Checksums/single_hash_dec.crc32 | 1 + .../single_hash_no_trailing_newline.sha256 | 1 + samples/Checksums/zero.sha2 | 1 + samples/Checksums/zero.sha3 | 1 + vendor/README.md | 1 + vendor/grammars/language-etc | 2 +- .../git_submodule/language-etc.dep.yml | 4 +- 25 files changed, 149 insertions(+), 3 deletions(-) create mode 100644 samples/Checksums/bsd-style.sha256 create mode 100644 samples/Checksums/filenames/SHA256 create mode 100644 samples/Checksums/filenames/SHA256SUM create mode 100644 samples/Checksums/filenames/SHA256SUMS create mode 100644 samples/Checksums/gnu-style.sha256 create mode 100644 samples/Checksums/single_hash.crc create mode 100644 samples/Checksums/single_hash.crc32 create mode 100644 samples/Checksums/single_hash.md2 create mode 100644 samples/Checksums/single_hash.md4 create mode 100644 samples/Checksums/single_hash.md5 create mode 100644 samples/Checksums/single_hash.rmd160 create mode 100644 samples/Checksums/single_hash.sha1 create mode 100644 samples/Checksums/single_hash.sha224 create mode 100644 samples/Checksums/single_hash.sha256 create mode 100644 samples/Checksums/single_hash.sha384 create mode 100644 samples/Checksums/single_hash.sha512 create mode 100644 samples/Checksums/single_hash_dec.crc32 create mode 100644 samples/Checksums/single_hash_no_trailing_newline.sha256 create mode 100644 samples/Checksums/zero.sha2 create mode 100644 samples/Checksums/zero.sha3 diff --git a/grammars.yml b/grammars.yml index 4d795a5ed1..a1ff2433fc 100644 --- a/grammars.yml +++ b/grammars.yml @@ -459,6 +459,7 @@ vendor/grammars/language-etc: - source.ucd.nameslist - source.ucd.unidata - source.wgetrc +- text.checksums - text.openbsd-pkg.desc - text.xml.svg vendor/grammars/language-faust: diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index fa4c4b2a10..73d1bf322b 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -766,6 +766,122 @@ Charity: tm_scope: none ace_mode: text language_id: 56 +Checksums: + type: data + tm_scope: text.checksums + aliases: + - checksum + - hash + - hashes + - sum + - sums + filenames: + - CHECKSUM + - CHECKSUMS + - CKSUM + - CKSUMS + - CRC + - CRC32 + - CRC32SUM + - CRC32SUMS + - CRCSUM + - CRCSUMS + - MD2 + - MD2SUM + - MD2SUMS + - MD4 + - MD4SUM + - MD4SUMS + - MD5 + - MD5SUM + - MD5SUMS + - RMD160 + - RMD160SUM + - RMD160SUMS + - SHA1 + - SHA1SUM + - SHA1SUMS + - SHA2 + - SHA224 + - SHA224SUM + - SHA224SUMS + - SHA256 + - SHA256SUM + - SHA256SUMS + - SHA2SUM + - SHA2SUMS + - SHA3 + - SHA384 + - SHA384SUM + - SHA384SUMS + - SHA3SUM + - SHA3SUMS + - SHA512 + - SHA512SUM + - SHA512SUMS + - SUM + - SUMS + - checksum + - checksums + - cksum + - cksums + - crc + - crc32 + - crc32sum + - crc32sums + - crcsum + - crcsums + - md2 + - md2sum + - md2sums + - md4 + - md4sum + - md4sums + - md5 + - md5sum + - md5sums + - rmd160 + - rmd160sum + - rmd160sums + - sha1 + - sha1sum + - sha1sums + - sha2 + - sha224 + - sha224sum + - sha224sums + - sha256 + - sha256sum + - sha256sums + - sha2sum + - sha2sums + - sha3 + - sha384 + - sha384sum + - sha384sums + - sha3sum + - sha3sums + - sha512 + - sha512sum + - sha512sums + - sum + - sums + extensions: + - ".crc" + - ".crc32" + - ".md2" + - ".md4" + - ".md5" + - ".rmd160" + - ".sha1" + - ".sha2" + - ".sha224" + - ".sha256" + - ".sha3" + - ".sha384" + - ".sha512" + ace_mode: text + language_id: 372063053 ChucK: type: programming extensions: diff --git a/samples/Checksums/bsd-style.sha256 b/samples/Checksums/bsd-style.sha256 new file mode 100644 index 0000000000..f0c8099628 --- /dev/null +++ b/samples/Checksums/bsd-style.sha256 @@ -0,0 +1,3 @@ +SHA256 (empty) = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 +SHA256 (file0) = 0000000000000000000000000000000000000000000000000000000000000000 +SHA256 (file1) = 0000000000000000000000000000000000000000000000000000000000000001 diff --git a/samples/Checksums/filenames/SHA256 b/samples/Checksums/filenames/SHA256 new file mode 100644 index 0000000000..f0c8099628 --- /dev/null +++ b/samples/Checksums/filenames/SHA256 @@ -0,0 +1,3 @@ +SHA256 (empty) = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 +SHA256 (file0) = 0000000000000000000000000000000000000000000000000000000000000000 +SHA256 (file1) = 0000000000000000000000000000000000000000000000000000000000000001 diff --git a/samples/Checksums/filenames/SHA256SUM b/samples/Checksums/filenames/SHA256SUM new file mode 100644 index 0000000000..2e9c4e327f --- /dev/null +++ b/samples/Checksums/filenames/SHA256SUM @@ -0,0 +1 @@ +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 empty_text_file diff --git a/samples/Checksums/filenames/SHA256SUMS b/samples/Checksums/filenames/SHA256SUMS new file mode 100644 index 0000000000..f485ee1f84 --- /dev/null +++ b/samples/Checksums/filenames/SHA256SUMS @@ -0,0 +1,3 @@ +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 *empty_binary_file +0000000000000000000000000000000000000000000000000000000000000000 *file0 +0000000000000000000000000000000000000000000000000000000000000001 *file1 diff --git a/samples/Checksums/gnu-style.sha256 b/samples/Checksums/gnu-style.sha256 new file mode 100644 index 0000000000..f485ee1f84 --- /dev/null +++ b/samples/Checksums/gnu-style.sha256 @@ -0,0 +1,3 @@ +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 *empty_binary_file +0000000000000000000000000000000000000000000000000000000000000000 *file0 +0000000000000000000000000000000000000000000000000000000000000001 *file1 diff --git a/samples/Checksums/single_hash.crc b/samples/Checksums/single_hash.crc new file mode 100644 index 0000000000..536e35fcfb --- /dev/null +++ b/samples/Checksums/single_hash.crc @@ -0,0 +1 @@ +ffffffff diff --git a/samples/Checksums/single_hash.crc32 b/samples/Checksums/single_hash.crc32 new file mode 100644 index 0000000000..536e35fcfb --- /dev/null +++ b/samples/Checksums/single_hash.crc32 @@ -0,0 +1 @@ +ffffffff diff --git a/samples/Checksums/single_hash.md2 b/samples/Checksums/single_hash.md2 new file mode 100644 index 0000000000..fe361f0340 --- /dev/null +++ b/samples/Checksums/single_hash.md2 @@ -0,0 +1 @@ +8350e5a3e24c153df2275c9f80692773 diff --git a/samples/Checksums/single_hash.md4 b/samples/Checksums/single_hash.md4 new file mode 100644 index 0000000000..f5c84055ad --- /dev/null +++ b/samples/Checksums/single_hash.md4 @@ -0,0 +1 @@ +31d6cfe0d16ae931b73c59d7e0c089c0 diff --git a/samples/Checksums/single_hash.md5 b/samples/Checksums/single_hash.md5 new file mode 100644 index 0000000000..df9edc403d --- /dev/null +++ b/samples/Checksums/single_hash.md5 @@ -0,0 +1 @@ +d41d8cd98f00b204e9800998ecf8427e diff --git a/samples/Checksums/single_hash.rmd160 b/samples/Checksums/single_hash.rmd160 new file mode 100644 index 0000000000..cbba92a809 --- /dev/null +++ b/samples/Checksums/single_hash.rmd160 @@ -0,0 +1 @@ +9c1185a5c5e9fc54612808977ee8f548b2258d31 diff --git a/samples/Checksums/single_hash.sha1 b/samples/Checksums/single_hash.sha1 new file mode 100644 index 0000000000..be0e2cdbdc --- /dev/null +++ b/samples/Checksums/single_hash.sha1 @@ -0,0 +1 @@ +da39a3ee5e6b4b0d3255bfef95601890afd80709 diff --git a/samples/Checksums/single_hash.sha224 b/samples/Checksums/single_hash.sha224 new file mode 100644 index 0000000000..6c38d98c01 --- /dev/null +++ b/samples/Checksums/single_hash.sha224 @@ -0,0 +1 @@ +d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f diff --git a/samples/Checksums/single_hash.sha256 b/samples/Checksums/single_hash.sha256 new file mode 100644 index 0000000000..c306804026 --- /dev/null +++ b/samples/Checksums/single_hash.sha256 @@ -0,0 +1 @@ +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 diff --git a/samples/Checksums/single_hash.sha384 b/samples/Checksums/single_hash.sha384 new file mode 100644 index 0000000000..9663344e7f --- /dev/null +++ b/samples/Checksums/single_hash.sha384 @@ -0,0 +1 @@ +38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b diff --git a/samples/Checksums/single_hash.sha512 b/samples/Checksums/single_hash.sha512 new file mode 100644 index 0000000000..c2f1924ca3 --- /dev/null +++ b/samples/Checksums/single_hash.sha512 @@ -0,0 +1 @@ +cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e diff --git a/samples/Checksums/single_hash_dec.crc32 b/samples/Checksums/single_hash_dec.crc32 new file mode 100644 index 0000000000..4f6ff861c9 --- /dev/null +++ b/samples/Checksums/single_hash_dec.crc32 @@ -0,0 +1 @@ +4294967295 diff --git a/samples/Checksums/single_hash_no_trailing_newline.sha256 b/samples/Checksums/single_hash_no_trailing_newline.sha256 new file mode 100644 index 0000000000..293ce40fd6 --- /dev/null +++ b/samples/Checksums/single_hash_no_trailing_newline.sha256 @@ -0,0 +1 @@ +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 \ No newline at end of file diff --git a/samples/Checksums/zero.sha2 b/samples/Checksums/zero.sha2 new file mode 100644 index 0000000000..cd09bbf164 --- /dev/null +++ b/samples/Checksums/zero.sha2 @@ -0,0 +1 @@ +0000000000000000000000000000000000000000000000000000000000000000 diff --git a/samples/Checksums/zero.sha3 b/samples/Checksums/zero.sha3 new file mode 100644 index 0000000000..e24f633b73 --- /dev/null +++ b/samples/Checksums/zero.sha3 @@ -0,0 +1 @@ +00000000000000000000000000000000000000000000000000000000 diff --git a/vendor/README.md b/vendor/README.md index 511d14730a..44164913a0 100644 --- a/vendor/README.md +++ b/vendor/README.md @@ -68,6 +68,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting - **CartoCSS:** [yohanboniface/carto-atom](https://github.com/yohanboniface/carto-atom) - **Ceylon:** [jeancharles-roger/ceylon-sublimetext](https://github.com/jeancharles-roger/ceylon-sublimetext) - **Chapel:** [chapel-lang/chapel-tmbundle](https://github.com/chapel-lang/chapel-tmbundle) +- **Checksums:** [Alhadis/language-etc](https://github.com/Alhadis/language-etc) - **ChucK:** [textmate/java.tmbundle](https://github.com/textmate/java.tmbundle) - **Cirru:** [Cirru/sublime-cirru](https://github.com/Cirru/sublime-cirru) - **Clarion:** [fushnisoft/SublimeClarion](https://github.com/fushnisoft/SublimeClarion) diff --git a/vendor/grammars/language-etc b/vendor/grammars/language-etc index c74c8dfe66..1360c89e72 160000 --- a/vendor/grammars/language-etc +++ b/vendor/grammars/language-etc @@ -1 +1 @@ -Subproject commit c74c8dfe66fd6239724cfd3a259de282234ac0d1 +Subproject commit 1360c89e72ee623f7191d8c42c59f5bbd312c391 diff --git a/vendor/licenses/git_submodule/language-etc.dep.yml b/vendor/licenses/git_submodule/language-etc.dep.yml index 30e448d596..8965972a44 100644 --- a/vendor/licenses/git_submodule/language-etc.dep.yml +++ b/vendor/licenses/git_submodule/language-etc.dep.yml @@ -1,13 +1,13 @@ --- name: language-etc -version: c74c8dfe66fd6239724cfd3a259de282234ac0d1 +version: 1360c89e72ee623f7191d8c42c59f5bbd312c391 type: git_submodule homepage: https://github.com/Alhadis/language-etc license: isc licenses: - sources: LICENSE.md text: | - Copyright (c) 2018-2020, John Gardner + Copyright (c) 2018-2021, John Gardner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above From 05b6be561e70ac18ad71b096a24b89b2e948960b Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 19 Jan 2021 20:42:42 -0700 Subject: [PATCH 2/6] Deduplicate filenames for Checksums --- lib/linguist/languages.yml | 45 -------------------------------------- 1 file changed, 45 deletions(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 73d1bf322b..c9f0b020ba 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -776,10 +776,6 @@ Checksums: - sum - sums filenames: - - CHECKSUM - - CHECKSUMS - - CKSUM - - CKSUMS - CRC - CRC32 - CRC32SUM @@ -819,51 +815,10 @@ Checksums: - SHA512 - SHA512SUM - SHA512SUMS - - SUM - - SUMS - checksum - checksums - cksum - cksums - - crc - - crc32 - - crc32sum - - crc32sums - - crcsum - - crcsums - - md2 - - md2sum - - md2sums - - md4 - - md4sum - - md4sums - - md5 - - md5sum - - md5sums - - rmd160 - - rmd160sum - - rmd160sums - - sha1 - - sha1sum - - sha1sums - - sha2 - - sha224 - - sha224sum - - sha224sums - - sha256 - - sha256sum - - sha256sums - - sha2sum - - sha2sums - - sha3 - - sha384 - - sha384sum - - sha384sums - - sha3sum - - sha3sums - - sha512 - - sha512sum - - sha512sums - sum - sums extensions: From da41388b9f3df5304dc16d2a7872611f9e75da09 Mon Sep 17 00:00:00 2001 From: Alhadis Date: Tue, 31 May 2022 15:38:53 +1000 Subject: [PATCH 3/6] Remove `.crc` and `CRC` from proposed filetypes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These names are too ubiquitous across GitHub, and code-searches yield no actually valid files containing a CRC32 sum. See http://github.com/github/linguist/pull/5138/files/09c642Ω#r559949817 for the original discussion justifying their removal. --- lib/linguist/languages.yml | 2 -- samples/Checksums/single_hash.crc | 1 - 2 files changed, 3 deletions(-) delete mode 100644 samples/Checksums/single_hash.crc diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 530cb5e350..4a795139ea 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -940,7 +940,6 @@ Checksums: - sum - sums filenames: - - CRC - CRC32 - CRC32SUM - CRC32SUMS @@ -986,7 +985,6 @@ Checksums: - sum - sums extensions: - - ".crc" - ".crc32" - ".md2" - ".md4" diff --git a/samples/Checksums/single_hash.crc b/samples/Checksums/single_hash.crc deleted file mode 100644 index 536e35fcfb..0000000000 --- a/samples/Checksums/single_hash.crc +++ /dev/null @@ -1 +0,0 @@ -ffffffff From db20a7ffee34aa24947a9bcbc17792d450c7d2b5 Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 7 Jun 2022 20:42:58 -0600 Subject: [PATCH 4/6] Update filenames and extensions for Checksums --- lib/linguist/languages.yml | 45 +++---------------- .../filenames/{SHA256 => SHA256SUMS.txt} | 0 .../SHA256SUM => gnu-style-text.sha256} | 2 +- ..._hash.rmd160 => single_hash.rmd160.digest} | 0 4 files changed, 6 insertions(+), 41 deletions(-) rename samples/Checksums/filenames/{SHA256 => SHA256SUMS.txt} (100%) rename samples/Checksums/{filenames/SHA256SUM => gnu-style-text.sha256} (78%) rename samples/Checksums/{single_hash.rmd160 => single_hash.rmd160.digest} (100%) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 0c993be9cc..17d3668695 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -968,60 +968,25 @@ Checksums: - sum - sums filenames: - - CRC32 - - CRC32SUM - - CRC32SUMS - - CRCSUM - - CRCSUMS - - MD2 - - MD2SUM - - MD2SUMS - - MD4 - - MD4SUM - - MD4SUMS - - MD5 - - MD5SUM - MD5SUMS - - RMD160 - - RMD160SUM - - RMD160SUMS - - SHA1 - - SHA1SUM - SHA1SUMS - - SHA2 - - SHA224 - - SHA224SUM - - SHA224SUMS - - SHA256 - - SHA256SUM - SHA256SUMS - - SHA2SUM - - SHA2SUMS - - SHA3 - - SHA384 - - SHA384SUM - - SHA384SUMS - - SHA3SUM - - SHA3SUMS - - SHA512 - - SHA512SUM + - SHA256SUMS.txt - SHA512SUMS - - checksum - - checksums - - cksum + - checksums.txt - cksums - - sum - - sums + - md5sum.txt extensions: - ".crc32" + - ".digest" - ".md2" - ".md4" - ".md5" - - ".rmd160" - ".sha1" - ".sha2" - ".sha224" - ".sha256" + - ".sha256sum" - ".sha3" - ".sha384" - ".sha512" diff --git a/samples/Checksums/filenames/SHA256 b/samples/Checksums/filenames/SHA256SUMS.txt similarity index 100% rename from samples/Checksums/filenames/SHA256 rename to samples/Checksums/filenames/SHA256SUMS.txt diff --git a/samples/Checksums/filenames/SHA256SUM b/samples/Checksums/gnu-style-text.sha256 similarity index 78% rename from samples/Checksums/filenames/SHA256SUM rename to samples/Checksums/gnu-style-text.sha256 index 2e9c4e327f..77fff0d158 100644 --- a/samples/Checksums/filenames/SHA256SUM +++ b/samples/Checksums/gnu-style-text.sha256 @@ -1 +1 @@ -e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 empty_text_file +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 empty_text_file diff --git a/samples/Checksums/single_hash.rmd160 b/samples/Checksums/single_hash.rmd160.digest similarity index 100% rename from samples/Checksums/single_hash.rmd160 rename to samples/Checksums/single_hash.rmd160.digest From d2079fd18d5be363d2e5307d157a1d83a4954ec1 Mon Sep 17 00:00:00 2001 From: Colin Seymour Date: Wed, 8 Jun 2022 10:09:35 +0100 Subject: [PATCH 5/6] Delete single_hash.rmd160.digest --- samples/Checksums/single_hash.rmd160.digest | 1 - 1 file changed, 1 deletion(-) delete mode 100644 samples/Checksums/single_hash.rmd160.digest diff --git a/samples/Checksums/single_hash.rmd160.digest b/samples/Checksums/single_hash.rmd160.digest deleted file mode 100644 index cbba92a809..0000000000 --- a/samples/Checksums/single_hash.rmd160.digest +++ /dev/null @@ -1 +0,0 @@ -9c1185a5c5e9fc54612808977ee8f548b2258d31 From 235ace91a7a8222643b412e13b36ff49270e3743 Mon Sep 17 00:00:00 2001 From: Colin Seymour Date: Wed, 8 Jun 2022 10:11:02 +0100 Subject: [PATCH 6/6] Remove .digest --- lib/linguist/languages.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 17d3668695..0437dfdf82 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -978,7 +978,6 @@ Checksums: - md5sum.txt extensions: - ".crc32" - - ".digest" - ".md2" - ".md4" - ".md5"