From f1ee9b37532adcccbb8aa0249948d05b31a4d9ef Mon Sep 17 00:00:00 2001 From: Sukera Date: Sat, 24 Feb 2024 14:55:34 +0100 Subject: [PATCH] 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")