Skip to content

Commit

Permalink
fix insane Well Done output
Browse files Browse the repository at this point in the history
  • Loading branch information
domluna committed Oct 7, 2024
1 parent 6f9efe7 commit bd653ed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "JuliaFormatter"
uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
authors = ["Dominique Luna <[email protected]>"]
version = "1.0.61"
version = "1.0.62"

[deps]
CSTParser = "00ebfdb7-1f24-5e51-bd34-a7502290713f"
Expand Down
21 changes: 12 additions & 9 deletions src/JuliaFormatter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,14 @@ function format(paths, options::Configuration)::Bool
return already_formatted
end

format(path::AbstractString; options...) =
format(path, Configuration(Dict{String,Any}(String(k) => v for (k, v) in options)))
function format(path::AbstractString; options...)
formatted =
format(path, Configuration(Dict{String,Any}(String(k) => v for (k, v) in options)))
if formatted
println("Well done! ✨ 🍰 ✨")
end
return formatted
end
function format(path::AbstractString, options::Configuration)
path = realpath(path)
if !get(options, "config_applied", false)
Expand All @@ -458,9 +464,6 @@ function format(path::AbstractString, options::Configuration)
is_formatted = format(subpath, options)
Threads.atomic_and!(formatted, is_formatted)
end
if formatted.value
println("Well done! ✨ 🍰 ✨")
end
return formatted.value
end
# `path` is not a directory but a file
Expand All @@ -470,9 +473,6 @@ function format(path::AbstractString, options::Configuration)
end
try
formatted = _format_file(path; [Symbol(k) => v for (k, v) in pairs(options)]...)
if formatted
println("Well done! ✨ 🍰 ✨")
end
return formatted
catch err
@info "Error in formatting file $path"
Expand All @@ -484,7 +484,10 @@ end
"""
format(path, style::AbstractStyle; options...)::Bool
"""
format(path, style::AbstractStyle; options...) = format(path; style = style, options...)
function format(path, style::AbstractStyle; options...)
formatted = format(path; style = style, options...)
formatted
end

"""
format(mod::Module, args...; options...)
Expand Down

0 comments on commit bd653ed

Please sign in to comment.