File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -560,7 +560,7 @@ function main(argv::Vector{String})
560560 print_progress = verbose && ! (input_is_stdin || output_is_stdout)
561561
562562 nfiles_str = string (length (inputfiles))
563- options_list = (
563+ options_list = [
564564 ProcessFileArgs (
565565 inputfile,
566566 file_counter,
@@ -577,7 +577,7 @@ function main(argv::Vector{String})
577577 format_markdown,
578578 config_priority,
579579 ) for (file_counter, inputfile) in enumerate (inputfiles)
580- )
580+ ]
581581
582582 # Use multithreading for multiple files (only if multiple threads available)
583583 # Single file or stdin or single thread: process sequentially
Original file line number Diff line number Diff line change 1+ @testset " Test jlfmt app" begin
2+ @testset " Test app with threads" begin
3+ mktempdir (; prefix = " jlfmt_threads_" ) do sandbox_dir
4+ write (
5+ joinpath (sandbox_dir, " spacing_and_call.jl" ),
6+ """
7+ f( x,y )=x+y
8+ z=f( 1,2 )
9+ """ ,
10+ )
11+
12+ write (
13+ joinpath (sandbox_dir, " control_flow_and_collection.jl" ),
14+ """
15+ function g(xs)
16+ ys=[ x*2 for x in xs if x>0 ]
17+ return ys
18+ end
19+ """ ,
20+ )
21+
22+ write (
23+ joinpath (sandbox_dir, " struct_and_keywords.jl" ),
24+ """
25+ struct Foo
26+ x::Int
27+ y::String
28+ end
29+
30+ h(;a=1,b=2)=a+b
31+ """ ,
32+ )
33+
34+ project = dirname (Base. active_project ())
35+
36+ check_before_cmd = ` $(Base. julia_cmd ()) --threads=3 --project=$project -m JuliaFormatter --check $sandbox_dir `
37+ @test ! success (check_before_cmd)
38+
39+ format_cmd = ` $(Base. julia_cmd ()) --threads=3 --project=$project -m JuliaFormatter --inplace $sandbox_dir `
40+ @test success (format_cmd)
41+
42+ check_after_cmd = ` $(Base. julia_cmd ()) --threads=3 --project=$project -m JuliaFormatter --check $sandbox_dir `
43+ @test success (check_after_cmd)
44+ end
45+ end
46+ end
Original file line number Diff line number Diff line change 7777 include (" interface.jl" )
7878 include (" config.jl" )
7979 include (" format_repo.jl" )
80+ include (" jlfmt_app.jl" )
8081end
You can’t perform that action at this time.
0 commit comments