A Markdown shard for the Crystal programming language
修訂 | 910afe9ad2bb0209a26e27e63177a131a58ab15e (tree) |
---|---|
時間 | 2023-02-26 09:54:07 |
作者 | supercell <stigma@disr...> |
Commiter | supercell |
Small linting changes
@@ -1,3 +1,5 @@ | ||
1 | 1 | # Disable since we're following dart-lang/markdown |
2 | 2 | Metrics/CyclomaticComplexity: |
3 | 3 | Enabled: false |
4 | +Lint/NotNil: | |
5 | + Enabled: false |
@@ -32,6 +32,8 @@ def serve_index(response : HTTP::Server::Response, params : URI::Params) : Nil | ||
32 | 32 | Luce::ExtensionSet::NONE |
33 | 33 | end |
34 | 34 | |
35 | + # `ren_markdown` is used in "index.ecr" | |
36 | + # ameba:disable Lint/UselessAssign | |
35 | 37 | ren_markdown = Luce.to_html(markdown, extension_set: es) |
36 | 38 | renderer = ECR.render "index.ecr" |
37 | 39 | bytes = renderer.unsafe_byte_slice(0) |
@@ -2,7 +2,7 @@ | ||
2 | 2 | # |
3 | 3 | # This file was generated from emojilib's data file: |
4 | 4 | # https://raw.githubusercontent.com/muan/emojilib/v2.4.0/emojis.json |
5 | -# at 2023-02-25 04:34:09 UTC by the script, tools/update_emojis.cr. | |
5 | +# at 2023-02-25 08:44:29 UTC by the script, tools/update_emojis.cr. | |
6 | 6 | |
7 | 7 | module Luce |
8 | 8 | class LegacyEmojis |
@@ -17,7 +17,7 @@ module Luce | ||
17 | 17 | @@hash.fetch(name, nil) |
18 | 18 | end |
19 | 19 | |
20 | - def self.each(&block : Tuple(String, String) -> ) : Nil | |
20 | + def self.each(& : Tuple(String, String) -> ) : Nil | |
21 | 21 | @@hash.each { |key| yield key } |
22 | 22 | end |
23 | 23 |
@@ -37,7 +37,7 @@ emoji_content.puts " def self.[]?(name : String) : String?" | ||
37 | 37 | emoji_content.puts " @@hash.fetch(name, nil)" |
38 | 38 | emoji_content.puts " end" |
39 | 39 | emoji_content.puts |
40 | -emoji_content.puts " def self.each(&block : Tuple(String, String) -> ) : Nil" | |
40 | +emoji_content.puts " def self.each(& : Tuple(String, String) -> ) : Nil" | |
41 | 41 | emoji_content.puts " @@hash.each { |key| yield key }" |
42 | 42 | emoji_content.puts " end" |
43 | 43 | emoji_content.puts |
@@ -51,7 +51,7 @@ emoji_count = 0 | ||
51 | 51 | ignored = [] of String |
52 | 52 | |
53 | 53 | # Dump in sorted order now to facilitate comparison with new GitHub emoji |
54 | -sorted_keys = json.keys.sort | |
54 | +sorted_keys = json.keys.sort! | |
55 | 55 | sorted_keys.each do |name| |
56 | 56 | info = json[name] |
57 | 57 | if info.has_key?("char") |
@@ -161,7 +161,7 @@ def parse_github_filename_into_unicode_string(emoji_filename : String) : String | ||
161 | 161 | end |
162 | 162 | end |
163 | 163 | end |
164 | - code_points_hex.map { |hex| hex.chr }.join | |
164 | + code_points_hex.map(&.chr).join | |
165 | 165 | rescue e |
166 | 166 | STDERR.puts "Invalid/Non-Conformant emoji filename pattern found \"#{emoji_filename}\"!" |
167 | 167 | ERROR_SPECIAL_REPLACEMENT |
@@ -274,7 +274,7 @@ Options:" | ||
274 | 274 | errored = [] of String |
275 | 275 | |
276 | 276 | # Dump in sorted order now to facilitate comparison with new GitHub emoji |
277 | - sorted_keys = shortcode_to_emoji.keys.sort | |
277 | + sorted_keys = shortcode_to_emoji.keys.sort! | |
278 | 278 | sorted_keys.each do |shortcode_alias| |
279 | 279 | emoji_unicode = shortcode_to_emoji[shortcode_alias] |
280 | 280 |