-
Notifications
You must be signed in to change notification settings - Fork 70
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
error formatting stdlib
of Julia
#644
Comments
@Moelf can you post the commit of the Julia repo so I can debug also verbose=true will help a bit |
the commit is JuliaLang/julia@f927d25 [ Info: Error in formatting file stdlib/InteractiveUtils/test/runtests.jl
Formatting stdlib/InteractiveUtils/test/runtests.jl
ERROR: ArgumentError: invalid index: nothing of type Nothing
Stacktrace:
[1] to_index(i::Nothing)
@ Base ./indices.jl:300
[2] to_index(A::Vector{JuliaFormatter.FST}, i::Nothing)
@ Base ./indices.jl:277
[3] to_indices
@ ./indices.jl:333 [inlined]
[4] to_indices
@ ./indices.jl:325 [inlined]
[5] getindex
@ ./abstractarray.jl:1241 [inlined]
[6] getindex
@ ~/.julia/packages/JuliaFormatter/xKNsr/src/fst.jl:182 [inlined]
[7] align_binaryopcalls!(fst::JuliaFormatter.FST, op_idxs::Vector{Int64})
@ JuliaFormatter ~/.julia/packages/JuliaFormatter/xKNsr/src/align.jl:124
[8] align_fst!(fst::JuliaFormatter.FST, opts::JuliaFormatter.Options)
@ JuliaFormatter ~/.julia/packages/JuliaFormatter/xKNsr/src/align.jl:31
[9] format_text(cst::CSTParser.EXPR, style::MinimalStyle, s::JuliaFormatter.State)
@ JuliaFormatter ~/.julia/packages/JuliaFormatter/xKNsr/src/JuliaFormatter.jl:649
[10] format_text(text::String, style::MinimalStyle, opts::JuliaFormatter.Options)
@ JuliaFormatter ~/.julia/packages/JuliaFormatter/xKNsr/src/JuliaFormatter.jl:632
[11] #format_text#238
@ ~/.julia/packages/JuliaFormatter/xKNsr/src/JuliaFormatter.jl:604 [inlined]
[12] #format_text#237
@ ~/.julia/packages/JuliaFormatter/xKNsr/src/JuliaFormatter.jl:598 [inlined]
[13] _format_file(filename::String; overwrite::Bool, verbose::Bool, format_markdown::Bool, format_options::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:style, :normalize_line_endings, :align_assignment), Tuple{MinimalStyle, String, Bool}}})
@ JuliaFormatter ~/.julia/packages/JuliaFormatter/xKNsr/src/JuliaFormatter.jl:723
[14] (::JuliaFormatter.var"#246#249"{Base.Pairs{Symbol, Any, NTuple{4, Symbol}, NamedTuple{(:style, :normalize_line_endings, :align_assignment, :verbose), Tuple{MinimalStyle, String, Bool, Bool}}}})(formatted_file::Bool, file::String)
@ JuliaFormatter ~/.julia/packages/JuliaFormatter/xKNsr/src/JuliaFormatter.jl:878
... |
yeah that's fine, it's mainly to just track down the file that's causing issues |
right, that information is already available though, there's a |
😅 - forgot that was recently added lol |
A good start might be to add a more informative error if JuliaFormatter.jl/src/align.jl Line 123 in 6c0f944
|
formats fine if binop_idx === nothing is skipped Seems to be something to do with a macroblock for this particular error |
ok I have a PR which fixes the |
The text was updated successfully, but these errors were encountered: