Repository: domluna/JuliaFormatter.jl (julia)

Issue:
[regression] Invalid formatting change with macros in 1.0.23
With default settings, in the new `1.0.23`

```julia
x = @show @show "bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar"
```

becomes

```julia
x = @show
@show "bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar"
```

which changes the meaning of the code.

For reference, with `1.0.22` it changes to

```julia
x =
    @show @show "bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar-bar"

```

Pull request description:
close https://github.com/domluna/JuliaFormatter.jl/issues/693

Patch:
diff --git a/Project.toml b/Project.toml
index 1e3b24ea1..5f7f8dff0 100644
--- a/Project.toml
+++ b/Project.toml
@@ -1,7 +1,7 @@
 name = "JuliaFormatter"
 uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
 authors = ["Dominique Luna <dluna132@gmail.com>"]
-version = "1.0.23"
+version = "1.0.24"
 
 [deps]
 CSTParser = "00ebfdb7-1f24-5e51-bd34-a7502290713f"
diff --git a/src/styles/default/nest.jl b/src/styles/default/nest.jl
index 2a5f29216..44cc7728d 100644
--- a/src/styles/default/nest.jl
+++ b/src/styles/default/nest.jl
@@ -98,8 +98,6 @@ function nest!(ds::DefaultStyle, fst::FST, s::State)
         n_call!(style, fst, s)
     elseif fst.typ === MacroCall
         n_macrocall!(style, fst, s)
-    elseif fst.typ === MacroBlock
-        n_block!(style, fst, s)
     elseif fst.typ === RefN
         n_ref!(style, fst, s)
     elseif fst.typ === TypedVcat


Test patch:
diff --git a/test/issues.jl b/test/issues.jl
index ecab8f71a..0a9e07c9f 100644
--- a/test/issues.jl
+++ b/test/issues.jl
@@ -316,26 +316,16 @@
         end"""
 
         # NOTE: this looks slightly off because we're compensating for escaping quotes
-        # NOTE: updated test in light of fixing #663 which allows breaking on consecutive macrocalls
-        # Meaning "@macro1 @macro2"
-        #
-        # can be
-        #
-        # """
-        # @macro1
-        # @macro2
-        # """
         str = """
         begin
             f() do
-                @info
-                @sprintf \"\"\"
-          Δmass   = %.16e\"\"\" abs(weightedsum(Q) - weightedsum(Qe)) / weightedsum(Qe)
+                @info @sprintf \"\"\"
+                Δmass   = %.16e\"\"\" abs(weightedsum(Q) - weightedsum(Qe)) /
+                                   weightedsum(Qe)
             end
         end"""
         @test fmt(str_, m = 81) == str
-        @test fmt(str_, m = 82) == str_
-        @test fmt(str, m = 200) == str
+        @test fmt(str, m = 82) == str_
     end
 
     @testset "issue #202" begin
@@ -1537,17 +1527,6 @@
         @test fmt(s, 4, 92) == s
     end
 
-    @testset "663" begin
-        s1 = """
-        @macro1 foo @macro2 bar(a=10)
-        """
-        s2 = """
-        @macro1 foo
-        @macro2 bar(a = 10)
-        """
-        @test fmt(s1, 4, 19) == s2
-    end
-
     @testset "667" begin
         s = raw"""
         \"""