diff --git a/spec/compiler/formatter/formatter_spec.cr b/spec/compiler/formatter/formatter_spec.cr index 87faba752fa2..02d140088c2d 100644 --- a/spec/compiler/formatter/formatter_spec.cr +++ b/spec/compiler/formatter/formatter_spec.cr @@ -747,15 +747,6 @@ describe Crystal::Formatter do assert_format "macro f\n yield\n {{ yield }}\nend" end - # Allows trailing commas, but doesn't enforce them - assert_format <<-CRYSTAL - def foo( - a, - b - ) - end - CRYSTAL - assert_format <<-CRYSTAL def foo( a, @@ -1580,7 +1571,7 @@ describe Crystal::Formatter do assert_format "-> : Int32 { }" assert_format "-> do\nend" - assert_format "-> : Int32 {}" + assert_format "-> : Int32 { }" assert_format "-> : Int32 | String { 1 }" assert_format "-> : Array(Int32) {}", "-> : Array(Int32) { }" assert_format "-> : Int32? {}", "-> : Int32? { }" diff --git a/src/compiler/crystal/tools/formatter.cr b/src/compiler/crystal/tools/formatter.cr index 118152de7b56..7ea32627078e 100644 --- a/src/compiler/crystal/tools/formatter.cr +++ b/src/compiler/crystal/tools/formatter.cr @@ -4273,7 +4273,7 @@ module Crystal skip_space_or_newline end - write " " if a_def.args.present? || return_type || whitespace_after_op_minus_gt + write " " is_do = false if @token.keyword?(:do) @@ -4281,7 +4281,7 @@ module Crystal is_do = true else write_token :OP_LCURLY - write " " if a_def.body.is_a?(Nop) && @token.type.space? + write " " if a_def.body.is_a?(Nop) end skip_space diff --git a/src/kernel.cr b/src/kernel.cr index 16c4a770309a..ac241161c16d 100644 --- a/src/kernel.cr +++ b/src/kernel.cr @@ -585,7 +585,7 @@ end def self.after_fork_child_callbacks @@after_fork_child_callbacks ||= [ # reinit event loop first: - ->{ Crystal::EventLoop.current.after_fork }, + -> { Crystal::EventLoop.current.after_fork }, # reinit signal handling: ->Crystal::System::Signal.after_fork,