Just a heads up. In my estimation, this could very well be the single biggest source of deprecation warnings ever, and that’s saying something. If anyone has any final thoughts, now is the time.
Yeah, this is going to be a bit painful. Apologies in advance, for not having a better syntax for this in the first place and thereby inflicting this on everyone. I posted over here about the motivation for the change:
Yes, I know CSTParser (@zacln) used to have a deprecation warning for that so at least CSTParser can detect it. Maaaybe writing a small script to do the transformation wouldnt be so hard.
The julia-vscode plugin detects this and has an automatic fix (click on hint region then on the lightbulb that pops up) for either single instances, or all within a file.
I’m not convinced of this idea myself, but I thought I’d throw it out there.
To ease this exceptional deprecatastrophe, perhaps it would make sense to have a special 0.6.1 release halfway through the 0.6 life-cycle in which the only change is this deprecation. This might make the transition easier on people since it won’t be accompanied by lots of other deprecations and errors. The alternative thinking is that it is better to resolve deprecations all at once, but in practice I’ve noticed that it sometimes takes them a long time to get fixed, so perhaps a staged approach is better.
I don’t think that making people update deprecations more times is helpful. It’s not all that hard to do, it’s just kind of annoying, so doing it fewer times is generally better.
function fixpkg(pkg::String, overwrite = false)
!isdir(Pkg.dir(pkg)) && error("Did not find package directory")
repo = LibGit2.GitRepo(Pkg.dir(pkg))
LibGit2.isdirty(repo) && error("Package repo is dirty")
if overwrite
info("Checking out branch fix_where")
LibGit2.branch!(repo, "fix_where")
end
for (root, dirs, files) in walkdir(Pkg.dir(pkg))
for file in files
if endswith(file, ".jl")
FixParameterisedFunctionDeprecation.fixdep(joinpath(root, file), overwrite)
if overwrite
LibGit2.add!(repo, joinpath(root, split(root, Pkg.dir(pkg))[2]))
end
end
end
end
overwrite && LibGit2.commit(repo, "fix deprecation warnings for new where syntax")
return
end
Is it possible to be consistent with the spaces, i.e. I would like it to remove spaces? E.g. f{T<:Float32}(x::T) = T(2.0) gets transformed to f(x::T) where {T <: Float32} = x instead of f(x::T) where {T<:Float32} = x