Skip to content

Commit

Permalink
Merge pull request #3546 from CliMA/gb/dev
Browse files Browse the repository at this point in the history
Remove .dev
  • Loading branch information
charleskawczynski authored Jan 28, 2025
2 parents 7f716b2 + 45855b0 commit 4ae80c6
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 439 deletions.
5 changes: 5 additions & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
margin = 80
indent = 4
always_for_in = true
whitespace_typedefs = true
whitespace_ops_in_indices = true
121 changes: 0 additions & 121 deletions .dev/Manifest-v1.11.toml

This file was deleted.

113 changes: 0 additions & 113 deletions .dev/Manifest.toml

This file was deleted.

5 changes: 0 additions & 5 deletions .dev/Project.toml

This file was deleted.

8 changes: 0 additions & 8 deletions .dev/clima_formatter_options.jl

This file was deleted.

95 changes: 12 additions & 83 deletions .dev/climaformat.jl
Original file line number Diff line number Diff line change
@@ -1,85 +1,14 @@
#!/usr/bin/env julia
#
# This is an adapted version of format.jl from JuliaFormatter with the
# following license:
#
# MIT License
# Copyright (c) 2019 Dominique Luna
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the
# following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
# USE OR OTHER DEALINGS IN THE SOFTWARE.
#
using Pkg
Pkg.activate(@__DIR__)
Pkg.instantiate()

using JuliaFormatter

include("clima_formatter_options.jl")

help = """
Usage: climaformat.jl [flags] [FILE/PATH]...
Formats the given julia files using the CLIMA formatting options. If paths
are given it will format the julia files in the paths. Otherwise, it will
format all changed julia files.
-v, --verbose
Print the name of the files being formatted with relevant details.
-h, --help
Print this message.
"""

function parse_opts!(args::Vector{String})
i = 1
opts = Dict{Symbol, Union{Int, Bool}}()
while i length(args)
arg = args[i]
if arg[1] != '-'
i += 1
continue
end
if arg == "-v" || arg == "--verbose"
opt = :verbose
elseif arg == "-h" || arg == "--help"
opt = :help
else
error("invalid option $arg")
end
if opt in (:verbose, :help)
opts[opt] = true
deleteat!(args, i)
end
end
return opts
end

opts = parse_opts!(ARGS)
if haskey(opts, :help)
write(stdout, help)
exit(0)
end
if isempty(ARGS)
filenames = readlines(`git ls-files "*.jl"`)
else
filenames = ARGS
end

format(filenames; clima_formatter_options..., opts...)
println("climaformat.jl has been discontinued in favor of JuliaFormatter")
println("To use JuliaFormatter, add it to your base environment with: ")
println()
println("julia -e 'using Pkg. Pkg.add(\"JuliaFormatter\")'")
println()
println("Then, format your current package with")
println()
println("using JuliaFormatter; format(\".\")")
println()
println("in a Julia REPL.")
println("See documentation to read more about this change")
println("This file will be removed in future releases")
41 changes: 0 additions & 41 deletions .dev/pre-commit

This file was deleted.

Loading

0 comments on commit 4ae80c6

Please sign in to comment.