From 7517cb105580fefdb1e9d51e1e60de613ed0639c Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Thu, 28 May 2026 17:38:45 +0200 Subject: [PATCH 1/4] Write trailing comma in a multiline call argument list --- src/compiler/crystal/tools/formatter.cr | 38 +++++++++++++++++++------ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/compiler/crystal/tools/formatter.cr b/src/compiler/crystal/tools/formatter.cr index 519038e8c6b0..3855bb5644f1 100644 --- a/src/compiler/crystal/tools/formatter.cr +++ b/src/compiler/crystal/tools/formatter.cr @@ -1173,7 +1173,7 @@ module Crystal if named_args = node.named_args write_token :OP_LPAREN skip_space - has_newlines, _, _ = format_named_args([] of ASTNode, named_args, @indent + 2) + has_newlines, _, _, _ = format_named_args([] of ASTNode, named_args, @indent + 2) # `format_named_args` doesn't skip trailing comma if @token.type.op_comma? next_token_skip_space_or_newline @@ -2483,10 +2483,12 @@ module Crystal last_arg = args.pop end - has_newlines, found_comment, _ = format_args args, true, node.named_args + has_newlines, found_comment, _, trailing_comma_written = + format_args args, true, node.named_args + if @token.type.op_comma? || @token.type.newline? if has_newlines - write "," + write "," unless trailing_comma_written found_comment = next_token_skip_space write_line unless found_comment write_indent @@ -2706,7 +2708,7 @@ module Crystal write "(" has_parentheses = true - has_newlines, found_comment, _ = format_call_args(node, true, base_indent) + has_newlines, found_comment, _, _ = format_call_args(node, true, base_indent) found_comment ||= skip_space if @token.type.newline? ends_with_newline = true @@ -2715,7 +2717,7 @@ module Crystal elsif has_args || node.block_arg write " " unless passed_backslash_newline skip_space - has_newlines, found_comment, _ = format_call_args(node, false, base_indent) + has_newlines, found_comment, _, _ = format_call_args(node, false, base_indent) end if block = node.block @@ -2775,6 +2777,7 @@ module Crystal def format_args(args : Array, has_parentheses, named_args = nil, block_arg = nil, needed_indent = @indent + 2, do_consume_newlines = false) has_newlines = false found_comment = false + trailing_comma_written = false @inside_call_or_assign += 1 unless args.empty? @@ -2782,17 +2785,36 @@ module Crystal end if named_args - has_newlines, named_args_found_comment, needed_indent = format_named_args(args, named_args, needed_indent) + has_newlines, named_args_found_comment, needed_indent, _ = format_named_args(args, named_args, needed_indent) found_comment = true if args.empty? && named_args_found_comment end if block_arg has_newlines = format_block_arg(block_arg, needed_indent) + elsif has_parentheses && has_newlines + # Don't use `skip_space` here because that would consume + # trailing comment and newline + while @token.type.space? + next_token + end + + case @token.type + when .op_comma?, .op_rparen?, .op_rsquare?, .op_rcurly? + # ignore + else + is_heredoc = @token.delimiter_state.kind.heredoc? || + (@last_is_heredoc && @token.type.newline?) + + unless is_heredoc + trailing_comma_written = true + write "," + end + end end @inside_call_or_assign -= 1 - {has_newlines, found_comment, needed_indent} + {has_newlines, found_comment, needed_indent, trailing_comma_written} end def format_args_simple(args, needed_indent, do_consume_newlines) @@ -2931,7 +2953,7 @@ module Crystal def format_parenthesized_args(args, named_args = nil) write "(" next_token_skip_space - has_newlines, found_comment, _ = format_args args, true, named_args: named_args + has_newlines, found_comment, _, _ = format_args args, true, named_args: named_args skip_space ends_with_newline = false if @token.type.newline? From 27cf9bc9150f46b98ee5771b1bffb3f24a36574a Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Wed, 27 May 2026 23:33:50 +0200 Subject: [PATCH 2/4] Adjust the specs --- spec/compiler/formatter/formatter_spec.cr | 34 +++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/spec/compiler/formatter/formatter_spec.cr b/spec/compiler/formatter/formatter_spec.cr index f6854a47a472..9f2046708cc0 100644 --- a/spec/compiler/formatter/formatter_spec.cr +++ b/spec/compiler/formatter/formatter_spec.cr @@ -100,7 +100,7 @@ describe Crystal::Formatter do assert_format "[\n1,\n\n2]", "[\n 1,\n\n 2,\n]" assert_format "[ # foo\n 1,\n]" assert_format "Set{ # foo\n 1,\n}" - assert_format "begin\n array[\n 0 # Zero\n ]\nend" + assert_format "begin\n array[\n 0 # Zero\n ]\nend", "begin\n array[\n 0, # Zero\n ]\nend" assert_format "begin\n array[\n 0, # Zero\n ]\nend" assert_format "[\n # foo\n] of String" assert_format "[\n# foo\n] of String", "[\n # foo\n] of String" @@ -459,7 +459,7 @@ describe Crystal::Formatter do CRYSTAL module M @[MyAnn( - 1 + 1, )] end CRYSTAL @@ -508,8 +508,8 @@ describe Crystal::Formatter do assert_format "::foo(1, 2)" assert_format "args.any? &.name.baz" assert_format "foo(\n 1, 2)", "foo(\n 1, 2)" - assert_format "foo(\n1,\n 2 \n)", "foo(\n 1,\n 2\n)" - assert_format "foo(\n1,\n\n 2 \n)", "foo(\n 1,\n\n 2\n)" + assert_format "foo(\n1,\n 2 \n)", "foo(\n 1,\n 2,\n)" + assert_format "foo(\n1,\n\n 2 \n)", "foo(\n 1,\n\n 2,\n)" assert_format "foo(\n 1,\n # 2,\n 3,\n)" assert_format "foo(\n 1,\n # 2,\n # 3,\n)" assert_format "foo 1,\n2", "foo 1,\n 2" @@ -518,7 +518,7 @@ describe Crystal::Formatter do assert_format "foo bar:baz, qux:other", "foo bar: baz, qux: other" assert_format "foo(\n 1, 2, &block)", "foo(\n 1, 2, &block)" assert_format "foo(\n 1, 2,\n&block)", "foo(\n 1, 2,\n &block)" - assert_format "foo(\n 1,\n 2\n) do\n 1\nend" + assert_format "foo(\n 1,\n 2\n) do\n 1\nend", "foo(\n 1,\n 2,\n) do\n 1\nend" assert_format "foo 1, a: 1,\nb: 2,\nc: 3,\n&block", "foo 1, a: 1,\n b: 2,\n c: 3,\n &block" assert_format "foo 1, do\n2\nend", "foo 1 do\n 2\nend" assert_format "a.b &.[c]?\n1" @@ -536,7 +536,7 @@ describe Crystal::Formatter do assert_format "foo.% bar" assert_format "foo.bar(&.%(baz))" assert_format "foo.bar(&.% baz)" - assert_format "if 1\n foo(\n bar\n # comment\n )\nend" + assert_format "if 1\n foo(\n bar\n # comment\n )\nend", "if 1\n foo(\n bar,\n # comment\n )\nend" assert_format "if 1\n foo(\n bar,\n # comment\n )\nend" assert_format "foo.bar\n.baz", "foo.bar\n .baz" @@ -1848,7 +1848,7 @@ describe Crystal::Formatter do assert_format "[\n a(), # b\n]", "[\n a(), # b\n]" assert_format "[\n a(),\n]", "[\n a(),\n]" assert_format "if 1\n[\n a() # b\n]\nend", "if 1\n [\n a(), # b\n ]\nend" - assert_format "foo(\n# x\n1,\n\n# y\nz: 2\n)", "foo(\n # x\n 1,\n\n # y\n z: 2\n)" + assert_format "foo(\n# x\n1,\n\n# y\nz: 2\n)", "foo(\n # x\n 1,\n\n # y\n z: 2,\n)" assert_format "foo(\n# x\n1,\n\n# y\nz: 2,\n\n# a\nb: 3)", "foo(\n # x\n 1,\n\n # y\n z: 2,\n\n # a\n b: 3)" assert_format "foo(\n 1, # hola\n2, # chau\n )", "foo(\n 1, # hola\n 2, # chau\n)" assert_format "foo (1)", "foo(1)" @@ -1886,7 +1886,7 @@ describe Crystal::Formatter do assert_format "case 1\nwhen 2\n 3\n # foo\nelse\n 4\n # bar\nend" assert_format "1 #=> 2", "1 # => 2" assert_format "1 #=>2", "1 # => 2" - assert_format "foo(\n [\n 1,\n 2,\n ],\n [\n 3,\n 4,\n ]\n)" + assert_format "foo(\n [\n 1,\n 2,\n ],\n [\n 3,\n 4,\n ]\n)", "foo(\n [\n 1,\n 2,\n ],\n [\n 3,\n 4,\n ],\n)" assert_format "begin\n %w(\n one two\n three four\n )\nend" assert_format "%w(\n one two\n three four\n)" assert_format "a = %w(\n one two\n three four\n)" @@ -1904,8 +1904,8 @@ describe Crystal::Formatter do assert_format "foo(1, 2, {\n foo: 1,\n bar: 2,\n})" assert_format "a = foo(1, 2, {\n foo: 1,\n bar: 2,\n})" assert_format "foo([\n 1,\n bar do\n end,\n [\n 2,\n ],\n])" - assert_format "foo(bar(\n 1,\n baz(\n 2,\n 3,\n )\n))" - assert_format "foo(bar(\n 1,\n baz(2,\n 3,\n )\n))", "foo(bar(\n 1,\n baz(2,\n 3,\n )\n))" + assert_format "foo(bar(\n 1,\n baz(\n 2,\n 3,\n )\n))", "foo(bar(\n 1,\n baz(\n 2,\n 3,\n ),\n))" + assert_format "foo(bar(\n 1,\n baz(2,\n 3,\n )\n))", "foo(bar(\n 1,\n baz(2,\n 3,\n ),\n))" assert_format "foo({\n 1 => 2,\n 3 => {\n 4 => 5,\n },\n})" assert_format "foo([\n 1, 2,\n 3, 4,\n])" assert_format "foo(baz(x, y) do\n 1 + 2\nend)" @@ -1962,7 +1962,7 @@ describe Crystal::Formatter do assert_format "begin\nend\n\n# a\n", "begin\n\nend\n\n# a" assert_format "begin\n 1\nend\n\n1\n", "begin\n 1\nend\n\n1" assert_format "{\n \"a\" => 1, \"b\" => 2,\n \"foo\" => 3, \"bar\" => 4,\n \"coconio\" => 5, \"lala\" => 6,\n}\n", "{\n \"a\" => 1, \"b\" => 2,\n \"foo\" => 3, \"bar\" => 4,\n \"coconio\" => 5, \"lala\" => 6,\n}" - assert_format "if 1\n foo(\n 1,\n 2 # lala\n )\nend\n", "if 1\n foo(\n 1,\n 2 # lala\n )\nend" + assert_format "if 1\n foo(\n 1,\n 2 # lala\n )\nend\n", "if 1\n foo(\n 1,\n 2, # lala\n )\nend" assert_format "case foo\nwhen 1\n # A\nelse\n# B\nend\n", "case foo\nwhen 1\n # A\nelse\n # B\nend" assert_format "return 1\n# end" assert_format "case\n# hello\nwhen 1\n 2\nend" @@ -2282,8 +2282,8 @@ describe Crystal::Formatter do assert_format "def a\n {\n 1, # x\n # y\n }\nend" assert_format "def a\n [\n 1, # x\n # y\n ]\nend" assert_format "def a\n b(\n 1, # x\n # y\n )\nend" - assert_format "def a\n b(\n 1, # x\n # y\n 2\n )\nend" - assert_format "def a\n b(\n a: 1, # x\n # y\n b: 2\n )\nend" + assert_format "def a\n b(\n 1, # x\n # y\n 2\n )\nend", "def a\n b(\n 1, # x\n # y\n 2,\n )\nend" + assert_format "def a\n b(\n a: 1, # x\n # y\n b: 2\n )\nend", "def a\n b(\n a: 1, # x\n # y\n b: 2,\n )\nend" assert_format "def a\n b(\n 1, # x\n # y\n a: 1, # x\n # y\n b: 2 # z\n )\nend" assert_format "def foo(a, **b : Int32)\nend" @@ -2468,13 +2468,13 @@ describe Crystal::Formatter do # #7614 assert_format "@[ Foo ]\ndef foo\nend", "@[Foo]\ndef foo\nend" assert_format "@[ Foo(foo: 1) ]\ndef foo\nend", "@[Foo(foo: 1)]\ndef foo\nend" - assert_format "@[Foo(\n foo: 1\n)]\ndef foo\nend" + assert_format "@[Foo(\n foo: 1\n)]\ndef foo\nend", "@[Foo(\n foo: 1,\n)]\ndef foo\nend" assert_format "@[Foo(\n foo: 1,\n)]\ndef foo\nend" # #7550 - assert_format "foo\n .bar(\n 1\n )" - assert_format "foo\n .bar\n .baz(\n 1\n )" - assert_format "foo.bar\n .baz(\n 1\n )" + assert_format "foo\n .bar(\n 1\n )", "foo\n .bar(\n 1,\n )" + assert_format "foo\n .bar\n .baz(\n 1\n )", "foo\n .bar\n .baz(\n 1,\n )" + assert_format "foo.bar\n .baz(\n 1\n )", "foo.bar\n .baz(\n 1,\n )" assert_format <<-CRYSTAL, def foo From a601ac461dda449eea9123d34432f4493f1d3486 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Thu, 28 May 2026 01:05:46 +0200 Subject: [PATCH 3/4] Add more specs --- spec/compiler/formatter/formatter_spec.cr | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/compiler/formatter/formatter_spec.cr b/spec/compiler/formatter/formatter_spec.cr index 9f2046708cc0..f68c12bc624e 100644 --- a/spec/compiler/formatter/formatter_spec.cr +++ b/spec/compiler/formatter/formatter_spec.cr @@ -2476,6 +2476,19 @@ describe Crystal::Formatter do assert_format "foo\n .bar\n .baz(\n 1\n )", "foo\n .bar\n .baz(\n 1,\n )" assert_format "foo.bar\n .baz(\n 1\n )", "foo.bar\n .baz(\n 1,\n )" + # #17018 + assert_format "foo(\n 1,\n bar: 2\n)", "foo(\n 1,\n bar: 2,\n)" + assert_format "foo(\n bar: 1\n)", "foo(\n bar: 1,\n)" + assert_format "foo(\n bar: 1 # fox\n)", "foo(\n bar: 1, # fox\n)" + assert_format "foo(\n 1 # fox\n)", "foo(\n 1, # fox\n)" + assert_format "foo(\n 1\n)", "foo(\n 1,\n)" + assert_format "foo(\n 1,\n &block\n)" + assert_format "foo \\\n 1,\n bar: 2" + assert_format "foo \\\n 1" + assert_format "foo(\n 1,\n bar: <<-HEREDOC\n foo\n HEREDOC\n)" + assert_format "foo(\n bar: <<-HEREDOC\n foo\n HEREDOC\n)" + assert_format "foo(\n <<-HEREDOC\n foo\n HEREDOC\n)" + assert_format <<-CRYSTAL, def foo {% if flag?(:foo) %} From 032b3ca55ed1bdd7e57bc6cd9755b1f3ec68dbc3 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Thu, 28 May 2026 17:29:48 +0200 Subject: [PATCH 4/4] Run `crystal tool format` --- samples/sdl/raytracer.cr | 2 +- samples/text_raytracer.cr | 2 +- scripts/github-changelog.cr | 2 +- spec/compiler/crystal/tools/init_spec.cr | 2 +- spec/compiler/ffi/ffi_spec.cr | 2 +- spec/compiler/formatter/formatter_spec.cr | 12 ++--- spec/compiler/macro/macro_methods_spec.cr | 38 +++++++------- spec/compiler/parser/parser_spec.cr | 22 ++++---- spec/primitives/external_command_spec.cr | 2 +- spec/std/crystal/compiler_rt/multi3_spec.cr | 2 +- spec/std/enumerable_spec.cr | 10 ++-- .../execution_context/global_queue_spec.cr | 2 +- spec/std/file/match-fast-glob_spec.cr | 6 +-- spec/std/file_spec.cr | 4 +- spec/std/http/cookies_spec.cr | 12 ++--- spec/std/http/web_socket_spec.cr | 8 +-- spec/std/openssl/ssl/socket_spec.cr | 6 +-- spec/std/regex_spec.cr | 2 +- src/big/lib_gmp.cr | 2 +- src/compiler/crystal/codegen/class_var.cr | 2 +- src/compiler/crystal/codegen/const.cr | 2 +- src/compiler/crystal/codegen/debug.cr | 8 +-- src/compiler/crystal/codegen/match.cr | 4 +- src/compiler/crystal/codegen/primitives.cr | 50 +++++++++---------- src/compiler/crystal/exception.cr | 2 +- src/compiler/crystal/interpreter/c.cr | 4 +- src/compiler/crystal/interpreter/compiler.cr | 4 +- .../crystal/interpreter/multidispatch.cr | 2 +- src/compiler/crystal/interpreter/repl.cr | 2 +- src/compiler/crystal/macros/methods.cr | 6 +-- src/compiler/crystal/semantic/bindings.cr | 2 +- .../crystal/semantic/semantic_visitor.cr | 2 +- .../semantic/type_declaration_visitor.cr | 4 +- .../crystal/semantic/type_guess_visitor.cr | 2 +- .../crystal/semantic/type_to_restriction.cr | 4 +- .../crystal/tools/macro_code_coverage.cr | 4 +- src/crystal/dwarf/line_numbers.cr | 2 +- src/crystal/event_loop/io_uring.cr | 2 +- src/crystal/event_loop/iocp.cr | 2 +- src/crystal/event_loop/libevent/event.cr | 2 +- src/crystal/system/win32/file.cr | 8 +-- src/crystal/system/win32/file_info.cr | 2 +- src/crystal/system/win32/process.cr | 2 +- src/crystal/system/win32/socket.cr | 2 +- src/exception/call_stack/stackwalk.cr | 2 +- src/file/match.cr | 4 +- src/float/printer/dragonbox.cr | 4 +- src/gc/boehm.cr | 2 +- src/http/web_socket/protocol.cr | 2 +- src/llvm/di_builder.cr | 2 +- src/llvm/module.cr | 2 +- src/llvm/type.cr | 2 +- src/oauth2/client.cr | 2 +- src/openssl/ssl/context.cr | 2 +- src/openssl/ssl/socket.cr | 2 +- src/spec/context.cr | 4 +- src/time.cr | 4 +- src/xml/builder.cr | 2 +- 58 files changed, 150 insertions(+), 150 deletions(-) diff --git a/samples/sdl/raytracer.cr b/samples/sdl/raytracer.cr index 6bcea6383a21..d3e29caf6c1f 100644 --- a/samples/sdl/raytracer.cr +++ b/samples/sdl/raytracer.cr @@ -214,7 +214,7 @@ scene = Scene.new( ], [ Light.new(Vec3.new(-10.0, 20.0, 30.0), Vec3.new(2.0, 2.0, 2.0)), - ] + ], ) SDL.init diff --git a/samples/text_raytracer.cr b/samples/text_raytracer.cr index 67ccc273cd47..bde1b03bee64 100644 --- a/samples/text_raytracer.cr +++ b/samples/text_raytracer.cr @@ -117,7 +117,7 @@ scene = [ ray = Ray.new( Vector.new(0.0, 0.0, 0.0), - Vector.new((fi - fw/2.0)/fw, (fj - fh/2.0)/fh, 1.0).normalize + Vector.new((fi - fw/2.0)/fw, (fj - fh/2.0)/fh, 1.0).normalize, ) hit = nil diff --git a/scripts/github-changelog.cr b/scripts/github-changelog.cr index 4ddb7bf36f6c..8f834341b41c 100755 --- a/scripts/github-changelog.cr +++ b/scripts/github-changelog.cr @@ -79,7 +79,7 @@ def query_prs(api_token, repository, milestone : String, cursor : String?) body: {query: query, variables: variables}.to_json, headers: HTTP::Headers{ "Authorization" => "bearer #{api_token}", - } + }, ) unless response.success? abort "GitHub API response: #{response.status}\n#{response.body}" diff --git a/spec/compiler/crystal/tools/init_spec.cr b/spec/compiler/crystal/tools/init_spec.cr index 2c126fd1dd58..c500a57a9222 100644 --- a/spec/compiler/crystal/tools/init_spec.cr +++ b/spec/compiler/crystal/tools/init_spec.cr @@ -26,7 +26,7 @@ end private def run_init_project(skeleton_type, name, author, email, github_name, dir = name) Crystal::Init::InitProject.new( - Crystal::Init::Config.new(skeleton_type, name, dir, author, email, github_name, true) + Crystal::Init::Config.new(skeleton_type, name, dir, author, email, github_name, true), ).run end diff --git a/spec/compiler/ffi/ffi_spec.cr b/spec/compiler/ffi/ffi_spec.cr index 96ba71c85c8f..6c95303e20a1 100644 --- a/spec/compiler/ffi/ffi_spec.cr +++ b/spec/compiler/ffi/ffi_spec.cr @@ -181,7 +181,7 @@ describe Crystal::FFI::CallInterface do j: 8, f: 9.0, d: 10.0, - p: pointerof(pointer_value).as(Void*) + p: pointerof(pointer_value).as(Void*), )).as(Void*), Pointer(Void).null, ] diff --git a/spec/compiler/formatter/formatter_spec.cr b/spec/compiler/formatter/formatter_spec.cr index f68c12bc624e..b37e983476fc 100644 --- a/spec/compiler/formatter/formatter_spec.cr +++ b/spec/compiler/formatter/formatter_spec.cr @@ -2390,28 +2390,28 @@ describe Crystal::Formatter do " <<-FOO\n" + " hello \n" + " FOO\n" + - "end" + "end", ) assert_format( "{% verbatim do %}\n" + " <<-FOO\n" + " hello \n" + " FOO\n" + - "{% end %}" + "{% end %}", ) assert_format( "{% if true %}\n" + " <<-FOO\n" + " hello \n" + " FOO\n" + - "{% end %}" + "{% end %}", ) assert_format( "{% for a in %w() %}\n" + " <<-FOO\n" + " hello \n" + " FOO\n" + - "{% end %}" + "{% end %}", ) assert_format( "macro foo\n" + @@ -2419,7 +2419,7 @@ describe Crystal::Formatter do " <<-FOO\n" + " hello \n" + " FOO\n" + - "end" + "end", ) # But remove trailing space in macro expression. @@ -2437,7 +2437,7 @@ describe Crystal::Formatter do " 42\n" + " }} \n" + " 2 \n" + - "end" + "end", ) # #7443 diff --git a/spec/compiler/macro/macro_methods_spec.cr b/spec/compiler/macro/macro_methods_spec.cr index 333f4b4fe097..8de05e3586b9 100644 --- a/spec/compiler/macro/macro_methods_spec.cr +++ b/spec/compiler/macro/macro_methods_spec.cr @@ -851,7 +851,7 @@ module Crystal it "#each" do assert_macro( %({% begin %}{% values = [] of Nil %}{% [1, 2, 3].each { |v| values << v } %}{{values}}{% end %}), - %([1, 2, 3]) + %([1, 2, 3]), ) end @@ -860,7 +860,7 @@ module Crystal it "builds the correct array" do assert_macro( %({% begin %}{% values = [] of Nil %}{% [1, 2, 3].each_with_index { |v, idx| values << (v + idx) } %}{{values}}{% end %}), - %([1, 3, 5]) + %([1, 3, 5]), ) end end @@ -869,7 +869,7 @@ module Crystal it "builds the correct array" do assert_macro( %({% begin %}{% values = [] of Nil %}{% [1, 2, 3].each_with_index { |v| values << v } %}{{values}}{% end %}), - %([1, 2, 3]) + %([1, 2, 3]), ) end end @@ -878,7 +878,7 @@ module Crystal it "builds the correct array" do assert_macro( %({% begin %}{% values = [] of Nil %}{% [1, 2, 3].each_with_index { |_, idx| values << idx } %}{{values}}{% end %}), - %([0, 1, 2]) + %([0, 1, 2]), ) end end @@ -887,7 +887,7 @@ module Crystal it "builds the correct array" do assert_macro( %({% begin %}{% values = [] of Nil %}{% [1, 2, 3].each_with_index { values << 7 } %}{{values}}{% end %}), - %([7, 7, 7]) + %([7, 7, 7]), ) end end @@ -1174,7 +1174,7 @@ module Crystal it "builds the correct array" do assert_macro( %({% begin %}{% values = [] of Nil %}{% {"k1" => "v1", "k2" => "v2"}.each { |k, v| values << {k, v} } %}{{values}}{% end %}), - %([{"k1", "v1"}, {"k2", "v2"}]) + %([{"k1", "v1"}, {"k2", "v2"}]), ) end end @@ -1183,7 +1183,7 @@ module Crystal it "builds the correct array" do assert_macro( %({% begin %}{% values = [] of Nil %}{% {"k1" => "v1", "k2" => "v2"}.each { |k| values << k } %}{{values}}{% end %}), - %(["k1", "k2"]) + %(["k1", "k2"]), ) end end @@ -1192,7 +1192,7 @@ module Crystal it "builds the correct array" do assert_macro( %({% begin %}{% values = [] of Nil %}{% {"k1" => "v1", "k2" => "v2"}.each { |_, v| values << v } %}{{values}}{% end %}), - %(["v1", "v2"]) + %(["v1", "v2"]), ) end end @@ -1201,7 +1201,7 @@ module Crystal it "builds the correct array" do assert_macro( %({% begin %}{% values = [] of Nil %}{% {"k1" => "v1", "k2" => "v2"}.each { values << {"k3", "v3"} } %}{{values}}{% end %}), - %([{"k3", "v3"}, {"k3", "v3"}]) + %([{"k3", "v3"}, {"k3", "v3"}]), ) end end @@ -1303,7 +1303,7 @@ module Crystal it "builds the correct array" do assert_macro( %({% begin %}{% values = [] of Nil %}{% {k1: "v1", k2: "v2"}.each { |k, v| values << {k, v} } %}{{values}}{% end %}), - %([{k1, "v1"}, {k2, "v2"}]) + %([{k1, "v1"}, {k2, "v2"}]), ) end end @@ -1312,7 +1312,7 @@ module Crystal it "builds the correct array" do assert_macro( %({% begin %}{% values = [] of Nil %}{% {k1: "v1", k2: "v2"}.each { |k| values << k } %}{{values}}{% end %}), - %([k1, k2]) + %([k1, k2]), ) end end @@ -1321,7 +1321,7 @@ module Crystal it "builds the correct array" do assert_macro( %({% begin %}{% values = [] of Nil %}{% {k1: "v1", k2: "v2"}.each { |_, v| values << v } %}{{values}}{% end %}), - %(["v1", "v2"]) + %(["v1", "v2"]), ) end end @@ -1330,7 +1330,7 @@ module Crystal it "builds the correct array" do assert_macro( %({% begin %}{% values = [] of Nil %}{% {k1: "v1", k2: "v2"}.each { values << {"k3", "v3"} } %}{{values}}{% end %}), - %([{"k3", "v3"}, {"k3", "v3"}]) + %([{"k3", "v3"}, {"k3", "v3"}]), ) end end @@ -1454,7 +1454,7 @@ module Crystal it "#each" do assert_macro( %({% begin %}{% values = [] of Nil %}{% {1, 2, 3}.each { |v| values << v } %}{{values}}{% end %}), - %([1, 2, 3]) + %([1, 2, 3]), ) end @@ -1463,7 +1463,7 @@ module Crystal it "builds the correct array" do assert_macro( %({% begin %}{% values = [] of Nil %}{% {1, 2, 3}.each_with_index { |v, idx| values << (v + idx) } %}{{values}}{% end %}), - %([1, 3, 5]) + %([1, 3, 5]), ) end end @@ -1472,7 +1472,7 @@ module Crystal it "builds the correct array" do assert_macro( %({% begin %}{% values = [] of Nil %}{% {1, 2, 3}.each_with_index { |v| values << v } %}{{values}}{% end %}), - %([1, 2, 3]) + %([1, 2, 3]), ) end end @@ -1481,7 +1481,7 @@ module Crystal it "builds the correct array" do assert_macro( %({% begin %}{% values = [] of Nil %}{% {1, 2, 3}.each_with_index { |_, idx| values << idx } %}{{values}}{% end %}), - %([0, 1, 2]) + %([0, 1, 2]), ) end end @@ -1490,7 +1490,7 @@ module Crystal it "builds the correct array" do assert_macro( %({% begin %}{% values = [] of Nil %}{% {1, 2, 3}.each_with_index { values << 7 } %}{{values}}{% end %}), - %([7, 7, 7]) + %([7, 7, 7]), ) end end @@ -3480,7 +3480,7 @@ module Crystal it "#each" do assert_macro( %({% begin %}{% values = [] of Nil %}{% (1..3).each { |v| values << v } %}{{values}}{% end %}), - %([1, 2, 3]) + %([1, 2, 3]), ) end end diff --git a/spec/compiler/parser/parser_spec.cr b/spec/compiler/parser/parser_spec.cr index 7a0377e4ae96..9b35aa5f2f3d 100644 --- a/spec/compiler/parser/parser_spec.cr +++ b/spec/compiler/parser/parser_spec.cr @@ -776,11 +776,11 @@ module Crystal Call.new("c", Call.new("d", Call.new("e"), - block: Block.new(body: 1.int32) + block: Block.new(body: 1.int32), ), - block: Block.new(body: 2.int32) + block: Block.new(body: 2.int32), ), - block: Block.new(body: 3.int32) + block: Block.new(body: 3.int32), ), block: Block.new(body: 4.int32)) it_parses "a b c d e { 1 } { 2 } do 3 end { 4 }", Call.new("a", @@ -788,13 +788,13 @@ module Crystal Call.new("c", Call.new("d", Call.new("e", - block: Block.new(body: 1.int32) + block: Block.new(body: 1.int32), ), - block: Block.new(body: 2.int32) + block: Block.new(body: 2.int32), ), - block: Block.new(body: 3.int32) + block: Block.new(body: 3.int32), ), - block: Block.new(body: 4.int32)) + block: Block.new(body: 4.int32)), ) end @@ -1062,14 +1062,14 @@ module Crystal block: Block.new(["".var], "c".var, unpacks: {0 => Expressions.new([Underscore.new, "c".var] of ASTNode)}, - ) + ), ) it_parses "foo { |(_, c, )| c }", Call.new("foo", block: Block.new(["".var], "c".var, unpacks: {0 => Expressions.new([Underscore.new, "c".var] of ASTNode)}, - ) + ), ) it_parses "foo { |(a, (b, (c, d)))| }", Call.new("foo", @@ -1558,8 +1558,8 @@ module Crystal it_parses "foo &.nil?", Call.new("foo", block: Block.new([Var.new("__arg0")], IsA.new(Var.new("__arg0"), Path.global("Nil"), nil_check: true))) it_parses "foo &.baz.qux do\nend", Call.new("foo", block: Block.new(["__arg0".var], - Call.new(Call.new("__arg0".var, "baz"), "qux", block: Block.new) - ) + Call.new(Call.new("__arg0".var, "baz"), "qux", block: Block.new), + ), ) it_parses "{{ foo.nil? }}", MacroExpression.new(Call.new(Var.new("foo"), "nil?")) diff --git a/spec/primitives/external_command_spec.cr b/spec/primitives/external_command_spec.cr index 6a8c88dcb958..08a4c1c7a815 100644 --- a/spec/primitives/external_command_spec.cr +++ b/spec/primitives/external_command_spec.cr @@ -23,7 +23,7 @@ describe "Crystal::Command" do process = Process.new(compiler_path, ["external", "foo", "bar"], output: :pipe, error: :pipe, - env: {"PATH" => {ENV["PATH"], File.dirname(command_path)}.join(Process::PATH_DELIMITER)} + env: {"PATH" => {ENV["PATH"], File.dirname(command_path)}.join(Process::PATH_DELIMITER)}, ) output = process.output.gets_to_end diff --git a/spec/std/crystal/compiler_rt/multi3_spec.cr b/spec/std/crystal/compiler_rt/multi3_spec.cr index 3c3c8eae7070..7f217210ae4a 100644 --- a/spec/std/crystal/compiler_rt/multi3_spec.cr +++ b/spec/std/crystal/compiler_rt/multi3_spec.cr @@ -47,6 +47,6 @@ it ".__multi3" do __multi3(-2097152, -4398046511103).should eq 9223372036852678656 __multi3( make_ti(0x00000000000000B5, 0x04F333F9DE5BE000), - make_ti(0x0000000000000000, 0x00B504F333F9DE5B) + make_ti(0x0000000000000000, 0x00B504F333F9DE5B), ).should eq make_ti(0x7FFFFFFFFFFFF328u64, 0xDF915DA296E8A000u64) end diff --git a/spec/std/enumerable_spec.cr b/spec/std/enumerable_spec.cr index d386a8d0ea90..e42ed8d7a0a1 100644 --- a/spec/std/enumerable_spec.cr +++ b/spec/std/enumerable_spec.cr @@ -1482,7 +1482,7 @@ describe "Enumerable" do words.each { |word| word.chars.tally_by(hash, &.downcase) } hash.should eq( - {'c' => 1, 'r' => 2, 'y' => 2, 's' => 1, 't' => 1, 'a' => 1, 'l' => 1, 'u' => 1, 'b' => 1} + {'c' => 1, 'r' => 2, 'y' => 2, 's' => 1, 't' => 1, 'a' => 1, 'l' => 1, 'u' => 1, 'b' => 1}, ) end end @@ -1500,7 +1500,7 @@ describe "Enumerable" do words.each(&.chars.tally(hash)) hash.should eq( - {'c' => 1, 'r' => 2, 'y' => 2, 's' => 1, 't' => 1, 'a' => 1, 'l' => 1, 'u' => 1, 'b' => 1} + {'c' => 1, 'r' => 2, 'y' => 2, 's' => 1, 't' => 1, 'a' => 1, 'l' => 1, 'u' => 1, 'b' => 1}, ) end @@ -1510,7 +1510,7 @@ describe "Enumerable" do words.each(&.chars.tally(hash)) hash.should eq( - {'a' => 2, 'b' => 2, 'c' => 2, 'd' => 1, 'r' => 2, 'y' => 2, 's' => 1, 't' => 1, 'l' => 1, 'u' => 1} + {'a' => 2, 'b' => 2, 'c' => 2, 'd' => 1, 'r' => 2, 'y' => 2, 's' => 1, 't' => 1, 'l' => 1, 'u' => 1}, ) end @@ -1520,7 +1520,7 @@ describe "Enumerable" do words.each(&.chars.tally(hash)) hash.should eq( - {'c' => 1, 'r' => 2, 'y' => 2, 's' => 1, 't' => 1, 'a' => 1, 'l' => 1, 'u' => 1, 'b' => 1} + {'c' => 1, 'r' => 2, 'y' => 2, 's' => 1, 't' => 1, 'a' => 1, 'l' => 1, 'u' => 1, 'b' => 1}, ) end @@ -1530,7 +1530,7 @@ describe "Enumerable" do words.each(&.chars.tally(hash)) hash.should eq( - {'c' => 1, 'r' => 2, 'y' => 2, 's' => 1, 't' => 1, 'a' => 1, 'l' => 1, 'u' => 1, 'b' => 1} + {'c' => 1, 'r' => 2, 'y' => 2, 's' => 1, 't' => 1, 'a' => 1, 'l' => 1, 'u' => 1, 'b' => 1}, ) end diff --git a/spec/std/fiber/execution_context/global_queue_spec.cr b/spec/std/fiber/execution_context/global_queue_spec.cr index f54d183413a0..4b29b5bf486b 100644 --- a/spec/std/fiber/execution_context/global_queue_spec.cr +++ b/spec/std/fiber/execution_context/global_queue_spec.cr @@ -192,7 +192,7 @@ describe Fiber::ExecutionContext::GlobalQueue do queue.bulk_push(pointerof(list)) Thread.sleep(10.nanoseconds) if i % 4 == 3 end - } + }, ) # must have dequeued each fiber exactly X times (no less, no more) diff --git a/spec/std/file/match-fast-glob_spec.cr b/spec/std/file/match-fast-glob_spec.cr index 33e87585e17d..e8cc079bbd00 100644 --- a/spec/std/file/match-fast-glob_spec.cr +++ b/spec/std/file/match-fast-glob_spec.cr @@ -255,15 +255,15 @@ describe "File .match? bash tests" do refute_file_matches "*.txt", "some/big/path/to/the/needle.txt" assert_file_matches( "some/**/needle.{js,tsx,mdx,ts,jsx,txt}", - "some/a/bigger/path/to/the/crazy/needle.txt" + "some/a/bigger/path/to/the/crazy/needle.txt", ) assert_file_matches( "some/**/{a,b,c}/**/needle.txt", - "some/foo/a/bigger/path/to/the/crazy/needle.txt" + "some/foo/a/bigger/path/to/the/crazy/needle.txt", ) refute_file_matches( "some/**/{a,b,c}/**/needle.txt", - "some/foo/d/bigger/path/to/the/crazy/needle.txt" + "some/foo/d/bigger/path/to/the/crazy/needle.txt", ) assert_file_matches "a/{a{a,b},b}", "a/aa" diff --git a/spec/std/file_spec.cr b/spec/std/file_spec.cr index 8f82bf42b8ff..4ed6af1c494d 100644 --- a/spec/std/file_spec.cr +++ b/spec/std/file_spec.cr @@ -1748,14 +1748,14 @@ describe "File" do it "compares two equal files" do File.same_content?( datapath("test_file.txt"), - datapath("test_file.txt") + datapath("test_file.txt"), ).should be_true end it "compares two different files" do File.same_content?( datapath("test_file.txt"), - datapath("test_file.ini") + datapath("test_file.ini"), ).should be_false end end diff --git a/spec/std/http/cookies_spec.cr b/spec/std/http/cookies_spec.cr index 9509df1f45f8..de76f9404ae3 100644 --- a/spec/std/http/cookies_spec.cr +++ b/spec/std/http/cookies_spec.cr @@ -15,7 +15,7 @@ module HTTP it "chops value at the first invalid byte" do HTTP::Cookies.from_client_headers( - HTTP::Headers{"Cookie" => "ginger=snap; cookie=hm🍪delicious; snicker=doodle"} + HTTP::Headers{"Cookie" => "ginger=snap; cookie=hm🍪delicious; snicker=doodle"}, ).should eq HTTP::Cookies{ HTTP::Cookie.new("ginger", "snap"), HTTP::Cookie.new("cookie", "hm"), @@ -26,12 +26,12 @@ module HTTP # FIXME: Should handle both: https://github.com/crystal-lang/crystal/issues/16069 it "takes last one on duplicate keys" do HTTP::Cookies.from_client_headers( - HTTP::Headers{"Cookie" => "foo=bar; foo=baz"} + HTTP::Headers{"Cookie" => "foo=bar; foo=baz"}, ).should eq HTTP::Cookies{ HTTP::Cookie.new("foo", "baz"), } HTTP::Cookies.from_client_headers( - HTTP::Headers{"Cookie" => "foo=baz; foo=bar"} + HTTP::Headers{"Cookie" => "foo=baz; foo=bar"}, ).should eq HTTP::Cookies{ HTTP::Cookie.new("foo", "bar"), } @@ -50,7 +50,7 @@ module HTTP it "drops cookies with invalid byte in value" do HTTP::Cookies.from_server_headers( - HTTP::Headers{"Set-Cookie" => ["ginger=snap", "cookie=hm🍪delicious", "snicker=doodle"]} + HTTP::Headers{"Set-Cookie" => ["ginger=snap", "cookie=hm🍪delicious", "snicker=doodle"]}, ).should eq HTTP::Cookies{ HTTP::Cookie.new("ginger", "snap"), HTTP::Cookie.new("snicker", "doodle"), @@ -60,12 +60,12 @@ module HTTP # FIXME: Should handle both: https://github.com/crystal-lang/crystal/issues/16069 it "takes last one on duplicate keys" do HTTP::Cookies.from_server_headers( - HTTP::Headers{"Set-Cookie" => ["foo=bar", "foo=baz; path=/baz"]} + HTTP::Headers{"Set-Cookie" => ["foo=bar", "foo=baz; path=/baz"]}, ).should eq HTTP::Cookies{ HTTP::Cookie.new("foo", "baz", path: "/baz"), } HTTP::Cookies.from_server_headers( - HTTP::Headers{"Set-Cookie" => ["foo=baz; path=/baz", "foo=bar"]} + HTTP::Headers{"Set-Cookie" => ["foo=baz; path=/baz", "foo=bar"]}, ).should eq HTTP::Cookies{ HTTP::Cookie.new("foo", "bar"), } diff --git a/spec/std/http/web_socket_spec.cr b/spec/std/http/web_socket_spec.cr index 2b48c5b60c2b..af9f206dd1cd 100644 --- a/spec/std/http/web_socket_spec.cr +++ b/spec/std/http/web_socket_spec.cr @@ -585,7 +585,7 @@ describe HTTP::WebSocket do address.address, port: address.port, path: "/", - protocols: ["chat"] + protocols: ["chat"], ) end end @@ -610,7 +610,7 @@ describe HTTP::WebSocket do address.address, port: address.port, path: "/", - protocols: ["chat"] + protocols: ["chat"], ) end end @@ -634,7 +634,7 @@ describe HTTP::WebSocket do address.address, port: address.port, path: "/", - protocols: ["chat", "video"] + protocols: ["chat", "video"], ) ws.protocol.should eq("chat") end @@ -656,7 +656,7 @@ describe HTTP::WebSocket do HTTP::WebSocket::Protocol.new( address.address, port: address.port, - path: "/" + path: "/", ) end end diff --git a/spec/std/openssl/ssl/socket_spec.cr b/spec/std/openssl/ssl/socket_spec.cr index 7fa5c95ab91b..6799da1f774d 100644 --- a/spec/std/openssl/ssl/socket_spec.cr +++ b/spec/std/openssl/ssl/socket_spec.cr @@ -69,7 +69,7 @@ describe OpenSSL::SSL::Socket do server_tests: ->(client : Server) { client.cipher.should_not be_empty }, - client_tests: ->(client : Client) { } + client_tests: ->(client : Client) { }, ) end @@ -78,7 +78,7 @@ describe OpenSSL::SSL::Socket do server_tests: ->(client : Server) { client.tls_version.should contain "TLS" }, - client_tests: ->(client : Client) { } + client_tests: ->(client : Client) { }, ) end @@ -89,7 +89,7 @@ describe OpenSSL::SSL::Socket do }, client_tests: ->(client : Client) { client.peer_certificate.should_not be_nil - } + }, ) end diff --git a/spec/std/regex_spec.cr b/spec/std/regex_spec.cr index b2220959fdb4..dff315db1514 100644 --- a/spec/std/regex_spec.cr +++ b/spec/std/regex_spec.cr @@ -593,7 +593,7 @@ describe "Regex" do "missing closing parenthesis at 8" else "missing ) at 8" - end + end, ) end diff --git a/src/big/lib_gmp.cr b/src/big/lib_gmp.cr index 71bdcabb1d25..51186da31fe8 100644 --- a/src/big/lib_gmp.cr +++ b/src/big/lib_gmp.cr @@ -285,5 +285,5 @@ end LibGMP.set_memory_functions( ->(size) { GC.malloc(size) }, ->(ptr, old_size, new_size) { GC.realloc(ptr, new_size) }, - ->(ptr, size) { GC.free(ptr) } + ->(ptr, size) { GC.free(ptr) }, ) diff --git a/src/compiler/crystal/codegen/class_var.cr b/src/compiler/crystal/codegen/class_var.cr index d3622a0366aa..e0b239b09c88 100644 --- a/src/compiler/crystal/codegen/class_var.cr +++ b/src/compiler/crystal/codegen/class_var.cr @@ -354,7 +354,7 @@ class Crystal::CodeGenVisitor file: file_metadata, line: location.line_number, type: debug_type, - local_to_unit: @single_module + local_to_unit: @single_module, ) global.global_set_metadata("dbg", gv_expr) diff --git a/src/compiler/crystal/codegen/const.cr b/src/compiler/crystal/codegen/const.cr index 855f3aa45e17..c0362721d172 100644 --- a/src/compiler/crystal/codegen/const.cr +++ b/src/compiler/crystal/codegen/const.cr @@ -82,7 +82,7 @@ class Crystal::CodeGenVisitor file: file_metadata, line: location.line_number, type: debug_type, - local_to_unit: @single_module + local_to_unit: @single_module, ) global.global_set_metadata("dbg", gv_expr) diff --git a/src/compiler/crystal/codegen/debug.cr b/src/compiler/crystal/codegen/debug.cr index 9d4dd0be09c2..5fd2563f8341 100644 --- a/src/compiler/crystal/codegen/debug.cr +++ b/src/compiler/crystal/codegen/debug.cr @@ -48,7 +48,7 @@ module Crystal mod.add_flag( LibLLVM::ModuleFlagBehavior::Warning, "Debug Info Version", - LLVM::DEBUG_METADATA_VERSION + LLVM::DEBUG_METADATA_VERSION, ) end @@ -325,7 +325,7 @@ module Crystal element_types << di_builder.create_member_type( nil, "func", nil, 1, size_ptr, size_ptr, 8u64 * offset_func, - LLVM::DIFlags::Zero, func_ptr_type + LLVM::DIFlags::Zero, func_ptr_type, ) void_type = di_builder.create_basic_type("Void", 8, 8, LLVM::DwarfTypeEncoding::Address) @@ -334,14 +334,14 @@ module Crystal element_types << di_builder.create_member_type( nil, "closure_data", nil, 1, size_ptr, size_ptr, 8u64 * offset_ctx, - LLVM::DIFlags::Zero, ctx_ptr_type + LLVM::DIFlags::Zero, ctx_ptr_type, ) total_size = @program.target_machine.data_layout.size_in_bits(struct_type) di_builder.create_struct_type( nil, original_type.to_s, nil, 1, total_size, total_size, - LLVM::DIFlags::Zero, nil, element_types + LLVM::DIFlags::Zero, nil, element_types, ) end diff --git a/src/compiler/crystal/codegen/match.cr b/src/compiler/crystal/codegen/match.cr index 2d321c91b6dd..ef93234c3674 100644 --- a/src/compiler/crystal/codegen/match.cr +++ b/src/compiler/crystal/codegen/match.cr @@ -68,8 +68,8 @@ class Crystal::CodeGenVisitor ret( and( builder.icmp(LLVM::IntPredicate::SGE, type_id, int(min)), - builder.icmp(LLVM::IntPredicate::SLE, type_id, int(max)) - ) + builder.icmp(LLVM::IntPredicate::SLE, type_id, int(max)), + ), ) end diff --git a/src/compiler/crystal/codegen/primitives.cr b/src/compiler/crystal/codegen/primitives.cr index 2fda4fd73c94..f8f12aca60b5 100644 --- a/src/compiler/crystal/codegen/primitives.cr +++ b/src/compiler/crystal/codegen/primitives.cr @@ -247,7 +247,7 @@ class Crystal::CodeGenVisitor def codegen_mul_unsigned_signed_with_overflow(t1, t2, p1, p2) overflow = and( codegen_binary_op_ne(t1, t1, p1, int(0, t1)), # self != 0 - codegen_binary_op_lt(t2, t2, p2, int(0, t2)) # other < 0 + codegen_binary_op_lt(t2, t2, p2, int(0, t2)), # other < 0 ) codegen_raise_overflow_cond overflow @@ -319,7 +319,7 @@ class Crystal::CodeGenVisitor # arg < min_value || arg > max_value or( codegen_binary_op_lt(arg_type, target_type, arg, int(min_value, target_type)), - codegen_binary_op_gt(arg_type, target_type, arg, int(max_value, target_type)) + codegen_binary_op_gt(arg_type, target_type, arg, int(max_value, target_type)), ) end @@ -338,7 +338,7 @@ class Crystal::CodeGenVisitor # !(arg >= min_value) || arg > max_value or( builder.fcmp(LLVM::RealPredicate::ULT, arg, int_to_float(target_type, arg_type, int(min_value, target_type))), - builder.fcmp(LLVM::RealPredicate::OGT, arg, int_to_float(target_type, arg_type, int(max_value, target_type))) + builder.fcmp(LLVM::RealPredicate::OGT, arg, int_to_float(target_type, arg_type, int(max_value, target_type))), ) end @@ -392,9 +392,9 @@ class Crystal::CodeGenVisitor and( or( builder.fcmp(LLVM::RealPredicate::OLT, arg, float(min_value, arg_type)), - builder.fcmp(LLVM::RealPredicate::OGT, arg, float(max_value, arg_type)) + builder.fcmp(LLVM::RealPredicate::OGT, arg, float(max_value, arg_type)), ), - builder.fcmp(LLVM::RealPredicate::ONE, arg, builder.fmul(float(2, arg_type), arg)) + builder.fcmp(LLVM::RealPredicate::ONE, arg, builder.fmul(float(2, arg_type), arg)), ) end @@ -492,13 +492,13 @@ class Crystal::CodeGenVisitor # x < 0 || x < x.class.new(y) or( builder.icmp(LLVM::IntPredicate::SLT, p1, int(0, t1)), - builder.icmp(LLVM::IntPredicate::SLT, p1, extend_int(t2, t1, p2)) + builder.icmp(LLVM::IntPredicate::SLT, p1, extend_int(t2, t1, p2)), ) else # x < 0 || y.class.new(x) < y or( builder.icmp(LLVM::IntPredicate::SLT, p1, int(0, t1)), - builder.icmp(LLVM::IntPredicate::ULT, extend_int(t1, t2, p1), p2) + builder.icmp(LLVM::IntPredicate::ULT, extend_int(t1, t2, p1), p2), ) end else @@ -507,13 +507,13 @@ class Crystal::CodeGenVisitor # y >= 0 && y.class.new(x) < y and( builder.icmp(LLVM::IntPredicate::SGE, p2, int(0, t2)), - builder.icmp(LLVM::IntPredicate::SLT, extend_int(t1, t2, p1), p2) + builder.icmp(LLVM::IntPredicate::SLT, extend_int(t1, t2, p1), p2), ) else # y >= 0 && x < x.class.new(y) and( builder.icmp(LLVM::IntPredicate::SGE, p2, int(0, t2)), - builder.icmp(LLVM::IntPredicate::ULT, p1, extend_int(t2, t1, p2)) + builder.icmp(LLVM::IntPredicate::ULT, p1, extend_int(t2, t1, p2)), ) end end @@ -530,13 +530,13 @@ class Crystal::CodeGenVisitor # x <= 0 || x <= x.class.new(y) or( builder.icmp(LLVM::IntPredicate::SLE, p1, int(0, t1)), - builder.icmp(LLVM::IntPredicate::SLE, p1, extend_int(t2, t1, p2)) + builder.icmp(LLVM::IntPredicate::SLE, p1, extend_int(t2, t1, p2)), ) else # x <= 0 || y.class.new(x) <= y or( builder.icmp(LLVM::IntPredicate::SLE, p1, int(0, t1)), - builder.icmp(LLVM::IntPredicate::ULE, extend_int(t1, t2, p1), p2) + builder.icmp(LLVM::IntPredicate::ULE, extend_int(t1, t2, p1), p2), ) end else @@ -545,13 +545,13 @@ class Crystal::CodeGenVisitor # y >= 0 && y.class.new(x) <= y and( builder.icmp(LLVM::IntPredicate::SGE, p2, int(0, t2)), - builder.icmp(LLVM::IntPredicate::SLE, extend_int(t1, t2, p1), p2) + builder.icmp(LLVM::IntPredicate::SLE, extend_int(t1, t2, p1), p2), ) else # y >= 0 && x <= x.class.new(y) and( builder.icmp(LLVM::IntPredicate::SGE, p2, int(0, t2)), - builder.icmp(LLVM::IntPredicate::ULE, p1, extend_int(t2, t1, p2)) + builder.icmp(LLVM::IntPredicate::ULE, p1, extend_int(t2, t1, p2)), ) end end @@ -568,13 +568,13 @@ class Crystal::CodeGenVisitor # x >= 0 && x > x.class.new(y) and( builder.icmp(LLVM::IntPredicate::SGE, p1, int(0, t1)), - builder.icmp(LLVM::IntPredicate::SGT, p1, extend_int(t2, t1, p2)) + builder.icmp(LLVM::IntPredicate::SGT, p1, extend_int(t2, t1, p2)), ) else # x >= 0 && y.class.new(x) > y and( builder.icmp(LLVM::IntPredicate::SGE, p1, int(0, t1)), - builder.icmp(LLVM::IntPredicate::UGT, extend_int(t1, t2, p1), p2) + builder.icmp(LLVM::IntPredicate::UGT, extend_int(t1, t2, p1), p2), ) end else @@ -583,13 +583,13 @@ class Crystal::CodeGenVisitor # y < 0 || y.class.new(x) > y or( builder.icmp(LLVM::IntPredicate::SLT, p2, int(0, t2)), - builder.icmp(LLVM::IntPredicate::SGT, extend_int(t1, t2, p1), p2) + builder.icmp(LLVM::IntPredicate::SGT, extend_int(t1, t2, p1), p2), ) else # y < 0 || x > x.class.new(y) or( builder.icmp(LLVM::IntPredicate::SLT, p2, int(0, t2)), - builder.icmp(LLVM::IntPredicate::UGT, p1, extend_int(t2, t1, p2)) + builder.icmp(LLVM::IntPredicate::UGT, p1, extend_int(t2, t1, p2)), ) end end @@ -606,13 +606,13 @@ class Crystal::CodeGenVisitor # x >= 0 && x >= x.class.new(y) and( builder.icmp(LLVM::IntPredicate::SGE, p1, int(0, t1)), - builder.icmp(LLVM::IntPredicate::SGE, p1, extend_int(t2, t1, p2)) + builder.icmp(LLVM::IntPredicate::SGE, p1, extend_int(t2, t1, p2)), ) else # x >= 0 && y.class.new(x) >= y and( builder.icmp(LLVM::IntPredicate::SGE, p1, int(0, t1)), - builder.icmp(LLVM::IntPredicate::UGE, extend_int(t1, t2, p1), p2) + builder.icmp(LLVM::IntPredicate::UGE, extend_int(t1, t2, p1), p2), ) end else @@ -621,13 +621,13 @@ class Crystal::CodeGenVisitor # y <= 0 || y.class.new(x) >= y or( builder.icmp(LLVM::IntPredicate::SLE, p2, int(0, t2)), - builder.icmp(LLVM::IntPredicate::SGE, extend_int(t1, t2, p1), p2) + builder.icmp(LLVM::IntPredicate::SGE, extend_int(t1, t2, p1), p2), ) else # y <= 0 || x >= x.class.new(y) or( builder.icmp(LLVM::IntPredicate::SLE, p2, int(0, t2)), - builder.icmp(LLVM::IntPredicate::UGE, p1, extend_int(t2, t1, p2)) + builder.icmp(LLVM::IntPredicate::UGE, p1, extend_int(t2, t1, p2)), ) end end @@ -643,13 +643,13 @@ class Crystal::CodeGenVisitor # x >= 0 && x == y and( builder.icmp(LLVM::IntPredicate::SGE, p1, p1.type.const_int(0)), - builder.icmp(LLVM::IntPredicate::EQ, p1, p2) + builder.icmp(LLVM::IntPredicate::EQ, p1, p2), ) else # t1.unsigned? && t2.signed? # y >= 0 && x == y and( builder.icmp(LLVM::IntPredicate::SGE, p2, p2.type.const_int(0)), - builder.icmp(LLVM::IntPredicate::EQ, p1, p2) + builder.icmp(LLVM::IntPredicate::EQ, p1, p2), ) end end @@ -663,13 +663,13 @@ class Crystal::CodeGenVisitor # x < 0 || x != y or( builder.icmp(LLVM::IntPredicate::SLT, p1, p1.type.const_int(0)), - builder.icmp(LLVM::IntPredicate::NE, p1, p2) + builder.icmp(LLVM::IntPredicate::NE, p1, p2), ) else # t1.unsigned? && t2.signed? # y < 0 || x != y or( builder.icmp(LLVM::IntPredicate::SLT, p2, p2.type.const_int(0)), - builder.icmp(LLVM::IntPredicate::NE, p1, p2) + builder.icmp(LLVM::IntPredicate::NE, p1, p2), ) end end diff --git a/src/compiler/crystal/exception.cr b/src/compiler/crystal/exception.cr index ca2fba6d1981..35f15648d624 100644 --- a/src/compiler/crystal/exception.cr +++ b/src/compiler/crystal/exception.cr @@ -154,7 +154,7 @@ module Crystal lines: lines, line_number: @line_number, column_number: @column_number, - size: @size + size: @size, ) "In #{formatted_error}" end diff --git a/src/compiler/crystal/interpreter/c.cr b/src/compiler/crystal/interpreter/c.cr index 7055b1123bfe..dc4aa93ebfaa 100644 --- a/src/compiler/crystal/interpreter/c.cr +++ b/src/compiler/crystal/interpreter/c.cr @@ -73,7 +73,7 @@ module Crystal getter(ffi_call_interface : FFI::CallInterface) do FFI::CallInterface.new( return_type.ffi_type, - arg_types.map(&.ffi_arg_type) + arg_types.map(&.ffi_arg_type), ) end end @@ -109,7 +109,7 @@ module Crystal def ffi_type : FFI::Type element_ffi_type = element_type.ffi_type FFI::Type.struct( - Array.new(size.as(NumberLiteral).value.to_i, element_ffi_type) + Array.new(size.as(NumberLiteral).value.to_i, element_ffi_type), ) end diff --git a/src/compiler/crystal/interpreter/compiler.cr b/src/compiler/crystal/interpreter/compiler.cr index bba9d5093415..14576e482db4 100644 --- a/src/compiler/crystal/interpreter/compiler.cr +++ b/src/compiler/crystal/interpreter/compiler.cr @@ -2065,7 +2065,7 @@ class Crystal::Repl::Compiler < Crystal::Visitor call_interface: FFI::CallInterface.variadic( external.type.ffi_type, args_ffi_types, - fixed_args: external.args.size + fixed_args: external.args.size, ), args_bytesizes: args_bytesizes, return_bytesize: return_bytesize, @@ -2077,7 +2077,7 @@ class Crystal::Repl::Compiler < Crystal::Visitor symbol: symbol, call_interface: FFI::CallInterface.new( external.type.ffi_type, - args_ffi_types + args_ffi_types, ), args_bytesizes: args_bytesizes, return_bytesize: return_bytesize, diff --git a/src/compiler/crystal/interpreter/multidispatch.cr b/src/compiler/crystal/interpreter/multidispatch.cr index d113dcabfd97..9d5c9afb23fb 100644 --- a/src/compiler/crystal/interpreter/multidispatch.cr +++ b/src/compiler/crystal/interpreter/multidispatch.cr @@ -280,7 +280,7 @@ module Crystal::Repl::Multidispatch node.args.each_with_index do |arg, arg_index| def_args["arg#{i}"] = MetaVar.new( "arg#{i}", - autocast_types.try &.[arg_index]? || arg.type + autocast_types.try &.[arg_index]? || arg.type, ) i += 1 end diff --git a/src/compiler/crystal/interpreter/repl.cr b/src/compiler/crystal/interpreter/repl.cr index 3be67ffc605f..3993da07fb09 100644 --- a/src/compiler/crystal/interpreter/repl.cr +++ b/src/compiler/crystal/interpreter/repl.cr @@ -152,7 +152,7 @@ class Crystal::Repl Parser.new( source, string_pool: @context.program.string_pool, - var_scopes: [@interpreter.local_vars.names_at_block_level_zero.to_set] + var_scopes: [@interpreter.local_vars.names_at_block_level_zero.to_set], ) end end diff --git a/src/compiler/crystal/macros/methods.cr b/src/compiler/crystal/macros/methods.cr index 7194c757e0f2..ad9ba1df770d 100644 --- a/src/compiler/crystal/macros/methods.cr +++ b/src/compiler/crystal/macros/methods.cr @@ -819,8 +819,8 @@ module Crystal [ Union.new([Path.global("Int32"), Path.global("String")] of ASTNode), Union.new([Path.global("String"), Path.global("Nil")] of ASTNode), - ] of ASTNode - ) + ] of ASTNode, + ), ) @value.scan(regex) do |match_data| @@ -3496,7 +3496,7 @@ private def regex_captures_hash(match_data : Regex::MatchData) of: Crystal::HashLiteral::Entry.new( Crystal::Union.new([Crystal::Path.global("Int32"), Crystal::Path.global("String")] of Crystal::ASTNode), Crystal::Union.new([Crystal::Path.global("String"), Crystal::Path.global("Nil")] of Crystal::ASTNode), - ) + ), ) match_data.to_h.each do |capture, substr| diff --git a/src/compiler/crystal/semantic/bindings.cr b/src/compiler/crystal/semantic/bindings.cr index ef2b62e554da..8b995dbc4ffb 100644 --- a/src/compiler/crystal/semantic/bindings.cr +++ b/src/compiler/crystal/semantic/bindings.cr @@ -815,7 +815,7 @@ module Crystal obj_type.program.type_merge( obj_type.union_types.map do |union_type| lookup_instance_var(union_type).type - end + end, ) else lookup_instance_var(obj_type).type diff --git a/src/compiler/crystal/semantic/semantic_visitor.cr b/src/compiler/crystal/semantic/semantic_visitor.cr index 11f8de9d08bd..3c4cf035bb2f 100644 --- a/src/compiler/crystal/semantic/semantic_visitor.cr +++ b/src/compiler/crystal/semantic/semantic_visitor.cr @@ -272,7 +272,7 @@ abstract class Crystal::SemanticVisitor < Crystal::Visitor node, free_vars: free_vars, allow_typeof: false, - find_root_generic_type_parameters: find_root_generic_type_parameters + find_root_generic_type_parameters: find_root_generic_type_parameters, ) end diff --git a/src/compiler/crystal/semantic/type_declaration_visitor.cr b/src/compiler/crystal/semantic/type_declaration_visitor.cr index 53952ce353e9..bc30d5ac676c 100644 --- a/src/compiler/crystal/semantic/type_declaration_visitor.cr +++ b/src/compiler/crystal/semantic/type_declaration_visitor.cr @@ -102,7 +102,7 @@ class Crystal::TypeDeclarationVisitor < Crystal::SemanticVisitor setter = External.new( "#{node.name}=", [Arg.new("value", type: var_type)], - Primitive.new("external_var_set", var_type), node.real_name || node.name + Primitive.new("external_var_set", var_type), node.real_name || node.name, ).at(node.location) setter.set_type(var_type) setter.external_var = true @@ -111,7 +111,7 @@ class Crystal::TypeDeclarationVisitor < Crystal::SemanticVisitor getter = External.new( "#{node.name}", [] of Arg, - Primitive.new("external_var_get", var_type), node.real_name || node.name + Primitive.new("external_var_get", var_type), node.real_name || node.name, ).at(node.location) getter.set_type(var_type) getter.external_var = true diff --git a/src/compiler/crystal/semantic/type_guess_visitor.cr b/src/compiler/crystal/semantic/type_guess_visitor.cr index 97b421a9c25e..f4f3f79eef28 100644 --- a/src/compiler/crystal/semantic/type_guess_visitor.cr +++ b/src/compiler/crystal/semantic/type_guess_visitor.cr @@ -1168,7 +1168,7 @@ module Crystal node, self_type: self_type || root.instance_type, allow_typeof: false, - find_root_generic_type_parameters: find_root_generic_type_parameters + find_root_generic_type_parameters: find_root_generic_type_parameters, ) check_can_be_stored(node, type) end diff --git a/src/compiler/crystal/semantic/type_to_restriction.cr b/src/compiler/crystal/semantic/type_to_restriction.cr index 910d31f44ea1..23119ac19008 100644 --- a/src/compiler/crystal/semantic/type_to_restriction.cr +++ b/src/compiler/crystal/semantic/type_to_restriction.cr @@ -57,7 +57,7 @@ module Crystal Path.global("Tuple"), type.tuple_types.map do |tuple_type| convert(tuple_type) || Underscore.new - end + end, ) end @@ -70,7 +70,7 @@ module Crystal entry.name, convert(entry.type) || Underscore.new, ) - end + end, ) end diff --git a/src/compiler/crystal/tools/macro_code_coverage.cr b/src/compiler/crystal/tools/macro_code_coverage.cr index 08bbd087120a..5e97113a8a47 100644 --- a/src/compiler/crystal/tools/macro_code_coverage.cr +++ b/src/compiler/crystal/tools/macro_code_coverage.cr @@ -55,7 +55,7 @@ module Crystal location = Location.new( macro_location.filename, location.line_number + macro_location.line_number, - location.column_number + location.column_number, ) end @@ -276,7 +276,7 @@ module Crystal Location.new( ::Path[location.filename.as(String)].relative_to(CURRENT_DIR).to_s, location.line_number, - location.column_number + location.column_number, ) end diff --git a/src/crystal/dwarf/line_numbers.cr b/src/crystal/dwarf/line_numbers.cr index eb3516d529c3..e91bab4f9985 100644 --- a/src/crystal/dwarf/line_numbers.cr +++ b/src/crystal/dwarf/line_numbers.cr @@ -273,7 +273,7 @@ module Crystal Array(LNCTFormat).new(count) do LNCTFormat.new( lnct: LNCT.new(DWARF.read_unsigned_leb128(@io)), - format: FORM.new(DWARF.read_unsigned_leb128(@io)) + format: FORM.new(DWARF.read_unsigned_leb128(@io)), ) end end diff --git a/src/crystal/event_loop/io_uring.cr b/src/crystal/event_loop/io_uring.cr index a92b212db2fb..8c6ccb9e65b6 100644 --- a/src/crystal/event_loop/io_uring.cr +++ b/src/crystal/event_loop/io_uring.cr @@ -188,7 +188,7 @@ class Crystal::EventLoop::IoUring < Crystal::EventLoop sq_entries: DEFAULT_SQ_ENTRIES, cq_entries: DEFAULT_CQ_ENTRIES, sq_thread_idle: (DEFAULT_SQ_THREAD_IDLE if System::IoUring.supports_feature?(LibC::IORING_FEAT_SQPOLL_NONFIXED)), - wq_fd: ring.try(&.fd) + wq_fd: ring.try(&.fd), ) end diff --git a/src/crystal/event_loop/iocp.cr b/src/crystal/event_loop/iocp.cr index ec02a814f4eb..d9423e2832f7 100644 --- a/src/crystal/event_loop/iocp.cr +++ b/src/crystal/event_loop/iocp.cr @@ -293,7 +293,7 @@ class Crystal::EventLoop::IOCP < Crystal::EventLoop nil, disposition, attributes, - LibC::HANDLE.null + LibC::HANDLE.null, ) if handle == LibC::INVALID_HANDLE_VALUE diff --git a/src/crystal/event_loop/libevent/event.cr b/src/crystal/event_loop/libevent/event.cr index 084ba30bb1d2..62fa14ce591b 100644 --- a/src/crystal/event_loop/libevent/event.cr +++ b/src/crystal/event_loop/libevent/event.cr @@ -22,7 +22,7 @@ class Crystal::EventLoop::LibEvent < Crystal::EventLoop def add(timeout : Time::Span) : Nil timeval = LibC::Timeval.new( tv_sec: LibC::TimeT.new(timeout.total_seconds), - tv_usec: timeout.nanoseconds // 1_000 + tv_usec: timeout.nanoseconds // 1_000, ) LibEvent2.event_add(@event, pointerof(timeval)) end diff --git a/src/crystal/system/win32/file.cr b/src/crystal/system/win32/file.cr index 3a0b3d4e8c1a..380c0e0b4ba4 100644 --- a/src/crystal/system/win32/file.cr +++ b/src/crystal/system/win32/file.cr @@ -114,7 +114,7 @@ module Crystal::System::File ret = LibC.GetFileAttributesExW( winpath, LibC::GET_FILEEX_INFO_LEVELS::GetFileExInfoStandard, - pointerof(file_attributes) + pointerof(file_attributes), ) if ret != 0 if file_attributes.dwFileAttributes.bits_set? LibC::FILE_ATTRIBUTE_REPARSE_POINT @@ -142,7 +142,7 @@ module Crystal::System::File nil, LibC::OPEN_EXISTING, LibC::FILE_FLAG_BACKUP_SEMANTICS, - LibC::HANDLE.null + LibC::HANDLE.null, ) return check_not_found_error("Unable to get file info", path) if handle == LibC::INVALID_HANDLE_VALUE @@ -367,7 +367,7 @@ module Crystal::System::File nil, LibC::OPEN_EXISTING, LibC::FILE_FLAG_BACKUP_SEMANTICS | LibC::FILE_FLAG_OPEN_REPARSE_POINT, - LibC::HANDLE.null + LibC::HANDLE.null, ) return nil if handle == LibC::INVALID_HANDLE_VALUE @@ -445,7 +445,7 @@ module Crystal::System::File nil, LibC::OPEN_EXISTING, LibC::FILE_FLAG_BACKUP_SEMANTICS, - LibC::HANDLE.null + LibC::HANDLE.null, ) if handle == LibC::INVALID_HANDLE_VALUE raise ::File::Error.from_winerror("Error setting time on file", file: path) diff --git a/src/crystal/system/win32/file_info.cr b/src/crystal/system/win32/file_info.cr index e30f6835a320..3a4c69a18a13 100644 --- a/src/crystal/system/win32/file_info.cr +++ b/src/crystal/system/win32/file_info.cr @@ -16,7 +16,7 @@ module Crystal::System::FileInfo nFileSizeLow: file_attributes.nFileSizeLow, nNumberOfLinks: 1, nFileIndexHigh: 0, - nFileIndexLow: 0 + nFileIndexLow: 0, ) @file_type = LibC::FILE_TYPE_DISK @reparse_tag = file_attributes.dwReserved0 diff --git a/src/crystal/system/win32/process.cr b/src/crystal/system/win32/process.cr index ffae00178fe3..6bb26006246b 100644 --- a/src/crystal/system/win32/process.cr +++ b/src/crystal/system/win32/process.cr @@ -310,7 +310,7 @@ struct Crystal::System::Process if LibC.CreateProcessW( nil, System.to_wstr(prepared_args), nil, nil, true, LibC::CREATE_SUSPENDED | LibC::CREATE_UNICODE_ENVIRONMENT, Env.make_env_block(env, clear_env), chdir.try { |str| System.to_wstr(str) } || Pointer(UInt16).null, - pointerof(startup_info), pointerof(process_info) + pointerof(startup_info), pointerof(process_info), ) == 0 error = WinError.value if ::File::NotFoundError.os_error?(error) || ::File::AccessDeniedError.os_error?(error) || error.in?(WinError::ERROR_BAD_EXE_FORMAT, WinError::ERROR_INVALID_PARAMETER) diff --git a/src/crystal/system/win32/socket.cr b/src/crystal/system/win32/socket.cr index 5c92bfacc253..701225f9e308 100644 --- a/src/crystal/system/win32/socket.cr +++ b/src/crystal/system/win32/socket.cr @@ -30,7 +30,7 @@ module Crystal::System::Socket sizeof(Pointer(Void)), out bytes, nil, - nil + nil, ) if result == LibC::SOCKET_ERROR raise ::Socket::Error.from_wsa_error("WSAIoctl") diff --git a/src/exception/call_stack/stackwalk.cr b/src/exception/call_stack/stackwalk.cr index 63e2eff06236..9d4ca59bf056 100644 --- a/src/exception/call_stack/stackwalk.cr +++ b/src/exception/call_stack/stackwalk.cr @@ -92,7 +92,7 @@ struct Exception::CallStack nil, nil, # ->LibC.SymFunctionTableAccess64, nil, # ->LibC.SymGetModuleBase64, - nil + nil, ) break if ret == 0 diff --git a/src/file/match.cr b/src/file/match.cr index 626e142ee9a1..1d9af0f7f53d 100644 --- a/src/file/match.cr +++ b/src/file/match.cr @@ -188,7 +188,7 @@ class File < IO::FileDescriptor branch_state = self.copy_with( glob_index: branch_index.to_u64, - brace_depth: brace_stack.size.to_u64 + brace_depth: brace_stack.size.to_u64, ) matched = branch_state.match_from(glob, path, branch_index, brace_stack) @@ -250,7 +250,7 @@ class File < IO::FileDescriptor @wildcard = Wildcard.new( @glob_index.to_u32!, @path_index.to_u32! + 1, - @brace_depth.to_u32! + @brace_depth.to_u32!, ) in_globstar = false diff --git a/src/float/printer/dragonbox.cr b/src/float/printer/dragonbox.cr index 65e090e5d0cc..aec9b464c6fe 100644 --- a/src/float/printer/dragonbox.cr +++ b/src/float/printer/dragonbox.cr @@ -481,7 +481,7 @@ module Float::Printer::Dragonbox {% else %} # F == Float64 (cache.high - (cache.high >> (significand_bits + 2))) >> (ImplInfo::CARRIER_BITS - significand_bits - 1 - beta) - {% end %} + {% end %}, ) end @@ -494,7 +494,7 @@ module Float::Printer::Dragonbox {% else %} # F == Float64 (cache.high + (cache.high >> (significand_bits + 1))) >> (ImplInfo::CARRIER_BITS - significand_bits - 1 - beta) - {% end %} + {% end %}, ) end diff --git a/src/gc/boehm.cr b/src/gc/boehm.cr index 3541359b39a9..226112e70a2d 100644 --- a/src/gc/boehm.cr +++ b/src/gc/boehm.cr @@ -368,7 +368,7 @@ module GC free_bytes: free_bytes.to_u64!, unmapped_bytes: unmapped_bytes.to_u64!, bytes_since_gc: bytes_since_gc.to_u64!, - total_bytes: total_bytes.to_u64! + total_bytes: total_bytes.to_u64!, ) end diff --git a/src/http/web_socket/protocol.cr b/src/http/web_socket/protocol.cr index 278835fc791d..2263d1e12fac 100644 --- a/src/http/web_socket/protocol.cr +++ b/src/http/web_socket/protocol.cr @@ -84,7 +84,7 @@ class HTTP::WebSocket::Protocol @buffer[0...@pos], @opcode, flags: final ? Flags::FINAL : Flags::None, - flush: final + flush: final, ) @opcode = Opcode::CONTINUATION @pos = 0 diff --git a/src/llvm/di_builder.cr b/src/llvm/di_builder.cr index eb77f7b63243..695a07f9c667 100644 --- a/src/llvm/di_builder.cr +++ b/src/llvm/di_builder.cr @@ -96,7 +96,7 @@ struct LLVM::DIBuilder LibLLVM.di_builder_create_global_variable_expression( self, scope, name, name.bytesize, linkage_name, linkage_name.bytesize, file, line, - type, local_to_unit, expr, decl, align_in_bits + type, local_to_unit, expr, decl, align_in_bits, ) end diff --git a/src/llvm/module.cr b/src/llvm/module.cr index 0e73e983358a..375b727d2379 100644 --- a/src/llvm/module.cr +++ b/src/llvm/module.cr @@ -55,7 +55,7 @@ class LLVM::Module module_flag, key, key.bytesize, - LibLLVM.value_as_metadata(val.to_unsafe) + LibLLVM.value_as_metadata(val.to_unsafe), ) end diff --git a/src/llvm/type.cr b/src/llvm/type.cr index fb7667a8af5e..98b5ffd8c895 100644 --- a/src/llvm/type.cr +++ b/src/llvm/type.cr @@ -204,7 +204,7 @@ struct LLVM::Type (has_side_effects ? 1 : 0), (is_align_stack ? 1 : 0), dialect, - (can_throw ? 1 : 0) + (can_throw ? 1 : 0), ) {% end %} Value.new value diff --git a/src/oauth2/client.cr b/src/oauth2/client.cr index e5dc8ab99c87..5ebfd7b58a84 100644 --- a/src/oauth2/client.cr +++ b/src/oauth2/client.cr @@ -180,7 +180,7 @@ class OAuth2::Client when .http_basic? headers.add( "Authorization", - "Basic #{Base64.strict_encode("#{@client_id}:#{@client_secret}")}" + "Basic #{Base64.strict_encode("#{@client_id}:#{@client_secret}")}", ) end yield form, headers diff --git a/src/openssl/ssl/context.cr b/src/openssl/ssl/context.cr index ce0293b0bbb7..b2aad62dde08 100644 --- a/src/openssl/ssl/context.cr +++ b/src/openssl/ssl/context.cr @@ -459,7 +459,7 @@ abstract class OpenSSL::SSL::Context # context.add_options( # OpenSSL::SSL::Options::ALL | # various workarounds # OpenSSL::SSL::Options::NO_SSL_V2 | # disable overly deprecated SSLv2 - # OpenSSL::SSL::Options::NO_SSL_V3 # disable deprecated SSLv3 + # OpenSSL::SSL::Options::NO_SSL_V3, # disable deprecated SSLv3 # ) # ``` def add_options(options : OpenSSL::SSL::Options) diff --git a/src/openssl/ssl/socket.cr b/src/openssl/ssl/socket.cr index 788762a90407..0c4ffe99ffbb 100644 --- a/src/openssl/ssl/socket.cr +++ b/src/openssl/ssl/socket.cr @@ -9,7 +9,7 @@ abstract class OpenSSL::SSL::Socket < IO @ssl, LibSSL::SSLCtrl::SET_TLSEXT_HOSTNAME, LibSSL::TLSExt::NAMETYPE_host_name, - hostname.to_unsafe.as(Pointer(Void)) + hostname.to_unsafe.as(Pointer(Void)), ) param = LibSSL.ssl_get0_param(@ssl) diff --git a/src/spec/context.cr b/src/spec/context.cr index f5d06b2da3d3..998681c4361b 100644 --- a/src/spec/context.cr +++ b/src/spec/context.cr @@ -79,7 +79,7 @@ module Spec Example::Procsy.new(procsy.example) do run_around_each_hook(around_each, procsy, index + 1) end - end + end, ) end @@ -105,7 +105,7 @@ module Spec ExampleGroup::Procsy.new(procsy.example_group) do run_around_all_hook(around_all, procsy, index + 1) end - end + end, ) end end diff --git a/src/time.cr b/src/time.cr index 46d314faaa2c..cfda19550440 100644 --- a/src/time.cr +++ b/src/time.cr @@ -1383,7 +1383,7 @@ struct Time Time.new( seconds: total_seconds, nanoseconds: nanosecond, - location: location + location: location, ) end @@ -1397,7 +1397,7 @@ struct Time else Time.utc( seconds: total_seconds, - nanoseconds: nanosecond + nanoseconds: nanosecond, ) end end diff --git a/src/xml/builder.cr b/src/xml/builder.cr index 0669821d3276..669511b16c7a 100644 --- a/src/xml/builder.cr +++ b/src/xml/builder.cr @@ -23,7 +23,7 @@ class XML::Builder 0 }, @box, - nil + nil, ) @writer = LibXML.xmlNewTextWriter(buffer) end