Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix for #785 #786

Merged
merged 1 commit into from
Nov 29, 2023
Merged

Hotfix for #785 #786

merged 1 commit into from
Nov 29, 2023

Conversation

efaulhaber
Copy link
Contributor

I don't know why this wasn't failing the tests in #785, but I think this is what's failing JuliaRegistries/General#96136.

@domluna
Copy link
Owner

domluna commented Nov 29, 2023

there is no format check in the CI so I don't know why that would cause registration to fail. either way we'll see if this works

@efaulhaber
Copy link
Contributor Author

Failed to precompile JuliaFormatter [98e50ef6-434e-11e9-1051-2b60c6c9e899] to "/tmp/jl_dBrbRZ/compiled/v1.9/JuliaFormatter/jl_q3BnuY".
[ Info: Error in formatting file /tmp/jl_dBrbRZ/packages/JuliaFormatter/O48b1/test/sciml_style.jl
ERROR: LoadError: TaskFailedException

    nested task error: TaskFailedException
    
        nested task error: SystemError: opening file "/tmp/jl_dBrbRZ/packages/JuliaFormatter/O48b1/test/sciml_style.jl": Permission denied

I have absolutely no idea why it can't read this file, so my only guess is that it might be related to

[ Info: Error in formatting file /tmp/jl_dBrbRZ/packages/JuliaFormatter/O48b1/test/sciml_style.jl

@domluna domluna merged commit 4152c35 into domluna:master Nov 29, 2023
56 checks passed
@efaulhaber efaulhaber deleted the fix-format branch November 29, 2023 16:20
@domluna
Copy link
Owner

domluna commented Nov 29, 2023

maybe it's that the file gets modified during the test due to the format call. but the format test should have failed then so that's a bit weird

@domluna
Copy link
Owner

domluna commented Nov 29, 2023

running locally it said

julia> format(".")
true

which is incorrect since there was a diff

λ ~/.julia/dev/JuliaFormatter: git diff
diff --git a/test/sciml_style.jl b/test/sciml_style.jl
index 3fe09c60..3d89595b 100644
--- a/test/sciml_style.jl
+++ b/test/sciml_style.jl
@@ -372,5 +372,5 @@
# xxxxx::SomePrettyLongTypeName{
# Foo
# }

  • @test format_text(str, SciMLStyle(), yas_style_nesting=true) == str
  • @test format_text(str, SciMLStyle(), yas_style_nesting = true) == str
    end

@efaulhaber
Copy link
Contributor Author

That explains why I didn't catch it. But shouldn't format(".") return true if and only if there is no diff? I rely on this return value in the CI checks in my code.

@domluna
Copy link
Owner

domluna commented Nov 29, 2023

yeah this is the only time I've seen it fail

@domluna
Copy link
Owner

domluna commented Nov 29, 2023

ok weird now it works

julia> format_file("test/sciml_style.jl")
false

julia> format("test/")

false

julia>

julia> format(".")
false

julia> format(".")
true

I checkout the diff on each format call except the last format(".")

So it seems it works

julia> using JuliaFormatter

julia> format(".")
false

julia> ^C

julia> format(".")
true

on a new repl session

and from the CLI

λ ~/.julia/dev/JuliaFormatter: j --project=. -e 'using JuliaFormatter; println(format("."))'
false

@domluna
Copy link
Owner

domluna commented Nov 29, 2023

with -t auto (threads) it seems to work as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants