Repository: fredrikekre/Runic.jl
Pull request #105 (2024-11-20 12:12:11)

Fix extra space in export/public/global/local multiline lists
Same issue as in #78, with same fix as in #83, but for a different
edgecase.


codecov[bot]: ## [Codecov](https://app.codecov.io/gh/fredrikekre/Runic.jl/pull/105?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fredrik+Ekre) Report
Attention: Patch coverage is `0%` with `1 line` in your changes missing coverage. Please review.
> Project coverage is 56.21%. Comparing base [(`c72cfb4`)](https://app.codecov.io/gh/fredrikekre/Runic.jl/commit/c72cfb4a5966b0a553dc2dd78f4cbfb3beaf5902?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fredrik+Ekre) to head [(`c0654ea`)](https://app.codecov.io/gh/fredrikekre/Runic.jl/commit/c0654eaed092994dc46aa2ba50bb59680b852d4f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fredrik+Ekre).

| [Files with missing lines](https://app.codecov.io/gh/fredrikekre/Runic.jl/pull/105?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fredrik+Ekre) | Patch % | Lines |
|---|---|---|
| [src/runestone.jl](https://app.codecov.io/gh/fredrikekre/Runic.jl/pull/105?src=pr&el=tree&filepath=src%2Frunestone.jl&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fredrik+Ekre#diff-c3JjL3J1bmVzdG9uZS5qbA==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/fredrikekre/Runic.jl/pull/105?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fredrik+Ekre) |

> :exclamation:  There is a different number of reports uploaded between BASE (c72cfb4) and HEAD (c0654ea). Click for more details.
> 
> <details><summary>HEAD has 7 uploads less than BASE</summary>
>
>| Flag | BASE (c72cfb4) | HEAD (c0654ea) |
>|------|------|------|
>||8|1|
></details>

<details><summary>Additional details and impacted files</summary>


```diff
@@             Coverage Diff             @@
##           master     #105       +/-   ##
===========================================
- Coverage   93.42%   56.21%   -37.22%     
===========================================
  Files           9        8        -1     
  Lines        3712     3700       -12     
===========================================
- Hits         3468     2080     -1388     
- Misses        244     1620     +1376     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/fredrikekre/Runic.jl/pull/105?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fredrik+Ekre).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fredrik+Ekre).

----
🚨 Try these New Features:

- [Flaky Tests Detection](https://docs.codecov.com/docs/test-result-ingestion-beta) - Detect and resolve failed and flaky tests

Patch:
diff --git a/src/runestone.jl b/src/runestone.jl
index 3c028c3..a6e7874 100644
--- a/src/runestone.jl
+++ b/src/runestone.jl
@@ -992,7 +992,7 @@ function spaces_in_export_public(ctx::Context, node::Node)
             elseif kind(kid) in KSet"Comment NewlineWs"
                 any_changes && push!(kids′, kid)
                 accept_node!(ctx, kid)
-                state = :expect_space
+                state = kind(kid) === K"Comment" ? (:expect_space) : (:expect_identifier)
             else
                 unreachable()
             end


Test patch:
diff --git a/test/runtests.jl b/test/runtests.jl
index 8864066..f1b08dc 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -993,6 +993,7 @@ end
         @test format_string("$(verb) a$(sp),$(sp)#= b, =#$(sp)c") == "$(verb) a, #= b, =# c"
         # https://github.com/fredrikekre/Runic.jl/issues/78
         @test format_string("$(verb)\n    #a\n    a,\n\n    #b\nb") == "$(verb)\n    #a\n    a,\n\n    #b\n    b"
+        @test format_string("$(verb) $(sp)a,$(sp)\n\n$(sp)b") == "$(verb) a,\n\n    b"
     end
     # Interpolated identifiers (currently only expected in K"quote" and K"macrocall")
     @test format_string(":(export \$a)") == ":(export \$a)"