From 7b39dbc85e0e123464dc467f83625431b24fec27 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Thu, 22 May 2025 16:41:08 +0900 Subject: [PATCH 1/2] remove support for non jl file support xref: timholy/Revise.jl#921 --- src/pkgfiles.jl | 6 +++--- test/runtests.jl | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pkgfiles.jl b/src/pkgfiles.jl index 4854066..3553e28 100644 --- a/src/pkgfiles.jl +++ b/src/pkgfiles.jl @@ -10,13 +10,13 @@ Note that `basedir` may be subsequently updated by Pkg operations such as `add` mutable struct PkgFiles id::PkgId basedir::String - files::Vector{Any} + files::Vector{String} end -PkgFiles(id::PkgId, path::AbstractString) = PkgFiles(id, path, Any[]) +PkgFiles(id::PkgId, path::AbstractString) = PkgFiles(id, path, String[]) PkgFiles(id::PkgId, ::Nothing) = PkgFiles(id, "") PkgFiles(id::PkgId) = PkgFiles(id, normpath(basepath(id))) -PkgFiles(id::PkgId, files::Vector{Any}) = +PkgFiles(id::PkgId, files::AbstractVector{<:AbstractString}) = PkgFiles(id, normpath(basepath(id)), files) # Abstraction interface diff --git a/test/runtests.jl b/test/runtests.jl index c448802..40655e0 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -72,7 +72,7 @@ isdefined(Main, :Revise) ? Main.Revise.includet("script.jl") : include("script.j info = CodeTracking.PkgFiles(Base.PkgId(CodeTracking), nothing) @test isempty(CodeTracking.basedir(info)) - info = CodeTracking.PkgFiles(Base.PkgId(CodeTracking), []) + info = CodeTracking.PkgFiles(Base.PkgId(CodeTracking), String[]) @test length(CodeTracking.srcfiles(info)) == 0 info = CodeTracking.PkgFiles(Base.PkgId(CodeTracking)) @@ -87,7 +87,7 @@ isdefined(Main, :Revise) ? Main.Revise.includet("script.jl") : include("script.j ioctx = IOContext(io, :compact=>true) show(ioctx, info) str = read(io, String) - @test match(r"PkgFiles\(CodeTracking, .*CodeTracking(\.jl)?, Any\[\]\)", str) !== nothing + @test match(r"PkgFiles\(CodeTracking, .*CodeTracking(\.jl)?, String\[\]\)", str) !== nothing @test pkgfiles("ColorTypes") === nothing @test_throws ErrorException pkgfiles("NotAPkg") From d1d4d38c543d89859328e686e3606da3464ef586 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Tue, 10 Jun 2025 23:16:07 +0900 Subject: [PATCH 2/2] adjust argument type declaration --- src/pkgfiles.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkgfiles.jl b/src/pkgfiles.jl index 3553e28..fa91be1 100644 --- a/src/pkgfiles.jl +++ b/src/pkgfiles.jl @@ -16,7 +16,7 @@ end PkgFiles(id::PkgId, path::AbstractString) = PkgFiles(id, path, String[]) PkgFiles(id::PkgId, ::Nothing) = PkgFiles(id, "") PkgFiles(id::PkgId) = PkgFiles(id, normpath(basepath(id))) -PkgFiles(id::PkgId, files::AbstractVector{<:AbstractString}) = +PkgFiles(id::PkgId, files::AbstractVector) = PkgFiles(id, normpath(basepath(id)), files) # Abstraction interface