From f1ee9b37532adcccbb8aa0249948d05b31a4d9ef Mon Sep 17 00:00:00 2001 From: Sukera Date: Sat, 24 Feb 2024 14:55:34 +0100 Subject: [PATCH 1/4] Add deprecation notice on `using` This adds a deprecation notice that will be printed on `using Formatting`, to inform users that the package has been deprecated and that they should consider using a different package. --- Project.toml | 4 +++- src/Formatting.jl | 13 ++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 3a697f4..53e2ed7 100644 --- a/Project.toml +++ b/Project.toml @@ -1,11 +1,13 @@ name = "Formatting" uuid = "59287772-0a20-5a39-b81b-1366585eb4c0" -version = "0.4.2" +version = "0.4.3" [deps] +Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" [compat] +Logging = "1" julia = "1" [extras] diff --git a/src/Formatting.jl b/src/Formatting.jl index e073b29..f39a7f7 100644 --- a/src/Formatting.jl +++ b/src/Formatting.jl @@ -1,13 +1,24 @@ module Formatting import Base.show - using Printf + using Printf, Logging export FormatSpec, FormatExpr, printfmt, printfmtln, fmt, format, sprintf1, generate_formatter + function __init__() + @warn """ + DEPRECATION NOTICE + + This package has been unmaintained for a while, with some serious + bugs comprimising the original purpose of the package. As a result, + it has been deprecated - consider using an alternative, such as + `Format.jl` (https://github.com/JuliaString/Format.jl) or the `Printf` stdlib directly. + """ + end + include("cformat.jl" ) include("fmtspec.jl") include("fmtcore.jl") From bf5ba6f08f0c43b81b64adbaf61dc9832f085df2 Mon Sep 17 00:00:00 2001 From: Sukera Date: Sat, 24 Feb 2024 16:03:48 +0100 Subject: [PATCH 2/4] Incorporate PR feedback --- src/Formatting.jl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Formatting.jl b/src/Formatting.jl index f39a7f7..c30b75b 100644 --- a/src/Formatting.jl +++ b/src/Formatting.jl @@ -12,10 +12,15 @@ module Formatting @warn """ DEPRECATION NOTICE - This package has been unmaintained for a while, with some serious - bugs comprimising the original purpose of the package. As a result, + Formatting.jl has been unmaintained for a while, with some serious + correctness bugs compromising the original purpose of the package. As a result, it has been deprecated - consider using an alternative, such as `Format.jl` (https://github.com/JuliaString/Format.jl) or the `Printf` stdlib directly. + + If your are not using Formatting.jl as a direct dependency, please consider + opening an issue on any packages your are using that do use it as a dependency. + From Julia 1.9 onwards, you can query `]why Formatting` to figure out which + package originally brings it in as a dependency. """ end From 9c18b3ef4c2e3a99eed6ee3b7b5dc6a025e58144 Mon Sep 17 00:00:00 2001 From: Sukera Date: Sat, 24 Feb 2024 16:56:28 +0100 Subject: [PATCH 3/4] Move deprecation notice behind jl_generating_output check --- src/Formatting.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Formatting.jl b/src/Formatting.jl index c30b75b..7ed7235 100644 --- a/src/Formatting.jl +++ b/src/Formatting.jl @@ -8,7 +8,7 @@ module Formatting printfmt, printfmtln, fmt, format, sprintf1, generate_formatter - function __init__() + if ccall(:jl_generating_output, Cint, ()) == 1 @warn """ DEPRECATION NOTICE From 5888010af809d6ae40cb17c78400e1b435ae2bdf Mon Sep 17 00:00:00 2001 From: Sukera Date: Sat, 24 Feb 2024 21:28:25 +0100 Subject: [PATCH 4/4] Fix typos mentioned in code review --- src/Formatting.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Formatting.jl b/src/Formatting.jl index 7ed7235..b57545b 100644 --- a/src/Formatting.jl +++ b/src/Formatting.jl @@ -17,8 +17,8 @@ module Formatting it has been deprecated - consider using an alternative, such as `Format.jl` (https://github.com/JuliaString/Format.jl) or the `Printf` stdlib directly. - If your are not using Formatting.jl as a direct dependency, please consider - opening an issue on any packages your are using that do use it as a dependency. + If you are not using Formatting.jl as a direct dependency, please consider + opening an issue on any packages you are using that do use it as a dependency. From Julia 1.9 onwards, you can query `]why Formatting` to figure out which package originally brings it in as a dependency. """