bug report
This is a really great tool!
I think I ran into a couple errors: running Vimes.go(".") on https://github.com/ericphanson/MajorizationExtrema.jl yielded the following error (after 9 tests):
ERROR: MethodError: no method matching separator(::CSTParser.EXPR{CSTParser.FileH}, ::CSTParser.Location, ::CSTParser.BinarySyntaxOpCall, ::Symbol)
Closest candidates are:
separator(::Any, ::Any, ::CSTParser.EXPR{CSTParser.Call}, ::Any) at /home/eric/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:29
separator(::Any, ::Any, ::CSTParser.EXPR{CSTParser.MacroCall}, ::Any) at /home/eric/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:35
separator(::Any, ::Any, ::CSTParser.EXPR{CSTParser.TupleH}, ::Any) at /home/eric/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:47
...
separator(::CSTParser.EXPR{CSTParser.FileH}, ::CSTParser.Location) at /home/eric/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:70
replacement(::MacroTools.SourceFile, ::MacroTools.Insert) at /home/eric/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:104
(::getfield(MacroTools, Symbol("##61#63")){MacroTools.SourceFile})(::MacroTools.Insert) at ./none:0
collect_to!(::Array{Pair{UnitRange{Int64},String},1}, ::Base.Generator{Array{Any,1},getfield(MacroTools, Symbol("##61#63")){MacroTools.SourceFile}}, ::Int64, ::Int64) at ./generator.jl:47
collect_to_with_first!(::Array{Pair{UnitRange{Int64},String},1}, ::Pair{UnitRange{Int64},String}, ::Base.Generator{Array{Any,1},getfield(MacroTools, Symbol("##61#63")){MacroTools.SourceFile}}, ::Int64) at ./array.jl:630
collect(::Base.Generator{Array{Any,1},getfield(MacroTools, Symbol("##61#63")){MacroTools.SourceFile}}) at ./array.jl:611
replacement(::MacroTools.SourceFile, ::MacroTools.Patch) at /home/eric/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:122
patch(::IOStream, ::MacroTools.SourceFile, ::MacroTools.Patch) at /home/eric/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:136
(::getfield(MacroTools, Symbol("##66#67")){MacroTools.SourceFile,MacroTools.Patch,Array{UInt8,1}})(::IOStream) at /home/eric/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:144
#open#310(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::getfield(MacroTools, Symbol("##66#67")){MacroTools.SourceFile,MacroTools.Patch,Array{UInt8,1}}, ::String, ::Vararg{String,N} where N) at ./iostream.jl:375
patch! at ./iostream.jl:373 [inlined]
sourcemap(::getfield(Vimes, Symbol("##7#9")){Array{Int64,1},typeof(Vimes.swapline)}, ::String) at /home/eric/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:165
apply!(::String, ::Array{Int64,1}, ::typeof(Vimes.swapline)) at /home/eric/.julia/packages/Vimes/ZKdxl/src/patch.jl:10
pick!(::Array{Any,1}) at /home/eric/.julia/packages/Vimes/ZKdxl/src/patch.jl:51
mutate at /home/eric/.julia/packages/Vimes/ZKdxl/src/run.jl:30 [inlined]
#test#17(::Bool, ::Function, ::String, ::String, ::Array{Any,1}) at /home/eric/.julia/packages/Vimes/ZKdxl/src/run.jl:58
#test at ./none:0 [inlined]
macro expansion at /home/eric/.julia/packages/Vimes/ZKdxl/src/run.jl:81 [inlined]
(::getfield(Vimes, Symbol("##19#21")){Bool,String,getfield(Vimes, Symbol("#run#20")),Int64,String,Array{Any,1}})() at ./task.jl:259
Stacktrace:
[1] sync_end(::Array{Any,1}) at ./task.jl:226
[2] macro expansion at ./task.jl:245 [inlined]
[3] #go#18(::Int64, ::Bool, ::Function, ::String, ::Array{Any,1}) at /home/eric/.julia/packages/Vimes/ZKdxl/src/run.jl:78
[4] go at /home/eric/.julia/packages/Vimes/ZKdxl/src/run.jl:68 [inlined] (repeats 2 times)
[5] top-level scope at none:0
and this one I saw a few times (on Convex and MajorizationExtrema, after 40-60 tests):
ERROR: BoundsError: attempt to access 0-element UnitRange{Int64} at index [1]
throw_boundserror(::UnitRange{Int64}, ::Int64) at ./abstractarray.jl:484
getindex(::UnitRange{Int64}, ::Int64) at ./range.jl:616
replacement(::MacroTools.SourceFile, ::MacroTools.Delete) at /home/eric/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:118
(::getfield(MacroTools, Symbol("##61#63")){MacroTools.SourceFile})(::MacroTools.Delete) at ./none:0
iterate(::Base.Generator{Array{Any,1},getfield(MacroTools, Symbol("##61#63")){MacroTools.SourceFile}}) at ./generator.jl:47
collect(::Base.Generator{Array{Any,1},getfield(MacroTools, Symbol("##61#63")){MacroTools.SourceFile}}) at ./array.jl:606
replacement(::MacroTools.SourceFile, ::MacroTools.Patch) at /home/eric/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:122
patch(::IOStream, ::MacroTools.SourceFile, ::MacroTools.Patch) at /home/eric/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:136
(::getfield(MacroTools, Symbol("##66#67")){MacroTools.SourceFile,MacroTools.Patch,Array{UInt8,1}})(::IOStream) at /home/eric/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:144
#open#310(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::getfield(MacroTools, Symbol("##66#67")){MacroTools.SourceFile,MacroTools.Patch,Array{UInt8,1}}, ::String, ::Vararg{String,N} where N) at ./iostream.jl:375
patch! at ./iostream.jl:373 [inlined]
sourcemap(::getfield(Vimes, Symbol("##7#9")){Array{Int64,1},typeof(Vimes.rmline)}, ::String) at /home/eric/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:165
apply!(::String, ::Array{Int64,1}, ::typeof(Vimes.rmline)) at /home/eric/.julia/packages/Vimes/ZKdxl/src/patch.jl:10
pick!(::Array{Any,1}) at /home/eric/.julia/packages/Vimes/ZKdxl/src/patch.jl:51
mutate at /home/eric/.julia/packages/Vimes/ZKdxl/src/run.jl:30 [inlined]
#test#17(::Bool, ::Function, ::String, ::String, ::Array{Any,1}) at /home/eric/.julia/packages/Vimes/ZKdxl/src/run.jl:58
#test at ./none:0 [inlined]
macro expansion at /home/eric/.julia/packages/Vimes/ZKdxl/src/run.jl:81 [inlined]
(::getfield(Vimes, Symbol("##19#21")){Bool,String,getfield(Vimes, Symbol("#run#20")),Int64,String,Array{Any,1}})() at ./task.jl:259
Stacktrace:
[1] sync_end(::Array{Any,1}) at ./task.jl:226
[2] macro expansion at ./task.jl:245 [inlined]
[3] #go#18(::Int64, ::Bool, ::Function, ::String, ::Array{Any,1}) at /home/eric/.julia/packages/Vimes/ZKdxl/src/run.jl:78
[4] go at /home/eric/.julia/packages/Vimes/ZKdxl/src/run.jl:68 [inlined] (repeats 2 times)
[5] top-level scope at none:0
on Ubuntu via Windows Subsystem for Linux,
julia> versioninfo()
Julia Version 1.1.1
Commit 55e36cc308 (2019-05-16 04:10 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
(v1.1) pkg> st
Status `~/.julia/environments/v1.1/Project.toml`
[00ebfdb7] CSTParser v0.5.2+ #location (https://github.com/MikeInnes/CSTParser.jl)
[f65535da] Convex v0.12.0 [`~/.julia/dev/Convex`]
[42adfb1e] MajorizationExtrema v0.2.0 [`~/.julia/dev/MajorizationExtrema`]
[85f4b15a] Vimes v0.1.0 #master (https://github.com/MikeInnes/Vimes.jl)
I'm not really sure how to make a minimal example for this but let me know if there's something I can do.
I am able to replicate the BoundsError when running Vimes.go(".") on MajorizationExtrema:
julia> import Vimes
julia> pwd()
"/Users/dilum/.julia/dev/MajorizationExtrema"
julia> Vimes.go(".")
[ Info: (1) Ran 1 tests, precision 100.00%
[ Info: (1) Ran 2 tests, precision 100.00%
[ Info: (1) Ran 3 tests, precision 100.00%
[ Info: (1) Ran 4 tests, precision 100.00%
[ Info: (1) Ran 5 tests, precision 100.00%
[ Info: (1) Ran 6 tests, precision 100.00%
[ Info: (1) Ran 7 tests, precision 100.00%
[ Info: (1) Ran 8 tests, precision 100.00%
[ Info: (1) Ran 9 tests, precision 100.00%
[ Info: (1) Ran 10 tests, precision 90.00%
ERROR: BoundsError: attempt to access 0-element UnitRange{Int64} at index [1]
throw_boundserror(::UnitRange{Int64}, ::Int64) at ./abstractarray.jl:484
getindex(::UnitRange{Int64}, ::Int64) at ./range.jl:616
replacement(::MacroTools.SourceFile, ::MacroTools.Delete) at /Users/dilum/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:118
(::getfield(MacroTools, Symbol("##61#63")){MacroTools.SourceFile})(::MacroTools.Delete) at ./none:0
iterate(::Base.Generator{Array{Any,1},getfield(MacroTools, Symbol("##61#63")){MacroTools.SourceFile}}) at ./generator.jl:47
collect(::Base.Generator{Array{Any,1},getfield(MacroTools, Symbol("##61#63")){MacroTools.SourceFile}}) at ./array.jl:606
replacement(::MacroTools.SourceFile, ::MacroTools.Patch) at /Users/dilum/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:122
patch(::IOStream, ::MacroTools.SourceFile, ::MacroTools.Patch) at /Users/dilum/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:136
(::getfield(MacroTools, Symbol("##66#67")){MacroTools.SourceFile,MacroTools.Patch,Array{UInt8,1}})(::IOStream) at /Users/dilum/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:144
#open#310(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::getfield(MacroTools, Symbol("##66#67")){MacroTools.SourceFile,MacroTools.Patch,Array{UInt8,1}}, ::String, ::Vararg{String,N} where N) at ./iostream.jl:375
patch! at ./iostream.jl:373 [inlined]
sourcemap(::getfield(Vimes, Symbol("##7#9")){Array{Int64,1},typeof(Vimes.rmline)}, ::String) at /Users/dilum/.julia/packages/MacroTools/AXAbb/src/patch/cst.jl:165
apply!(::String, ::Array{Int64,1}, ::typeof(Vimes.rmline)) at /Users/dilum/.julia/packages/Vimes/ZKdxl/src/patch.jl:10
pick!(::Array{Any,1}) at /Users/dilum/.julia/packages/Vimes/ZKdxl/src/patch.jl:51
mutate at /Users/dilum/.julia/packages/Vimes/ZKdxl/src/run.jl:30 [inlined]
#test#17(::Bool, ::Function, ::String, ::String, ::Array{Any,1}) at /Users/dilum/.julia/packages/Vimes/ZKdxl/src/run.jl:58
#test at ./none:0 [inlined]
macro expansion at /Users/dilum/.julia/packages/Vimes/ZKdxl/src/run.jl:81 [inlined]
(::getfield(Vimes, Symbol("##19#21")){Bool,String,getfield(Vimes, Symbol("#run#20")),Int64,String,Array{Any,1}})() at ./task.jl:259
Stacktrace:
[1] sync_end(::Array{Any,1}) at ./task.jl:226
[2] macro expansion at ./task.jl:245 [inlined]
[3] #go#18(::Int64, ::Bool, ::Function, ::String, ::Array{Any,1}) at /Users/dilum/.julia/packages/Vimes/ZKdxl/src/run.jl:78
[4] go at /Users/dilum/.julia/packages/Vimes/ZKdxl/src/run.jl:68 [inlined] (repeats 2 times)
[5] top-level scope at none:0
julia> versioninfo(verbose=true)
Julia Version 1.1.1
Commit 55e36cc (2019-05-16 04:10 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin15.6.0)
uname: Darwin 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64 i386
CPU: Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz:
speed user nice sys idle irq
#1 2600 MHz 4265 s 0 s 2176 s 8246 s 0 s
#2 2600 MHz 2486 s 0 s 879 s 11316 s 0 s
#3 2600 MHz 4657 s 0 s 1935 s 8090 s 0 s
#4 2600 MHz 2429 s 0 s 829 s 11423 s 0 s
Memory: 8.0 GB (369.234375 MB free)
Uptime: 1468.0 sec
Load Avg: 5.01611328125 5.24658203125 5.8916015625
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, haswell)
Environment:
JULIA_DEBUG = all
GEM_HOME = /Users/dilum/.rvm/gems/ruby-2.4.1
TERM = xterm-256color
MY_RUBY_HOME = /Users/dilum/.rvm/rubies/ruby-2.4.1
PATH = /Users/dilum/.rvm/gems/ruby-2.4.1/bin:/Users/dilum/.rvm/gems/ruby-2.4.1@global/bin:/Users/dilum/.rvm/rubies/ruby-2.4.1/bin:/Users/dilum/.rvm/bin:/Users/dilum/.cargo/bin:/Applications/Julia-1.1.app/Contents/Resources/julia/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/go/bin:/usr/local/MacGPG2/bin:/opt/X11/bin
XPC_FLAGS = 0x0
HOME = /Users/dilum
GEM_PATH = /Users/dilum/.rvm/gems/ruby-2.4.1:/Users/dilum/.rvm/gems/ruby-2.4.1@global
julia> import Pkg
julia> Pkg.status()
Status `~/.julia/environments/v1.1/Project.toml`
[00ebfdb7] CSTParser v0.5.2+ #location (https://github.com/MikeInnes/CSTParser.jl)
[f65535da] Convex v0.12.0 [`~/.julia/dev/Convex`]
[42adfb1e] MajorizationExtrema v0.2.0 [`~/.julia/dev/MajorizationExtrema`]
[85f4b15a] Vimes v0.1.0 #master (https://github.com/MikeInnes/Vimes.jl)
Thanks for the report. We should really add some logging so that we can see what patch failed where; you might be interested to add some logging to this line to catch that. Then you can probably reduce this to a MacroTools issue, which we can fix more easily over there.