Skip to content

Commit 793bbe6

Browse files
author
José Valim
committed
Move some runtime deprecations to compile time
1 parent 3318d33 commit 793bbe6

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

lib/elixir/lib/option_parser.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ defmodule OptionParser do
559559

560560
true ->
561561
# TODO: Remove this in Elixir v2.0
562-
IO.warn("Not passing the :switches or :strict option to OptionParser is deprecated")
562+
IO.warn("not passing the :switches or :strict option to OptionParser is deprecated")
563563
{[], false}
564564
end
565565

lib/elixir/test/elixir/option_parser_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ end
376376
defmodule OptionsParserDeprecationsTest do
377377
use ExUnit.Case, async: false
378378

379-
@warning ~r[Not passing the :switches or :strict option to OptionParser is deprecated]
379+
@warning ~r[not passing the :switches or :strict option to OptionParser is deprecated]
380380

381381
def assert_deprecated(fun) do
382382
assert ExUnit.CaptureIO.capture_io(:stderr, fun) =~ @warning

lib/iex/lib/iex/helpers.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,8 +1095,8 @@ defmodule IEx.Helpers do
10951095
end
10961096

10971097
@doc false
1098+
@deprecated "Use import_file_if_available/1 instead"
10981099
defmacro import_file(path, opts) when is_binary(path) and is_list(opts) do
1099-
IO.warn("import_file/2 is deprecated, please use import_file_if_available/1 instead")
11001100
import_file_if_available(path, Keyword.get(opts, :optional, false))
11011101
end
11021102

lib/mix/lib/mix/utils.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,14 +350,14 @@ defmodule Mix.Utils do
350350
defp quoted(data), do: [?", to_string(data), ?"]
351351

352352
@doc false
353+
@deprecated "Use Macro.underscore/1 instead"
353354
def underscore(value) do
354-
IO.warn("Mix.Utils.underscore/1 is deprecated, use Macro.underscore/1 instead")
355355
Macro.underscore(value)
356356
end
357357

358358
@doc false
359+
@deprecated "Use Macro.camelize/1 instead"
359360
def camelize(value) do
360-
IO.warn("Mix.Utils.camelize/1 is deprecated, use Macro.camelize/1 instead")
361361
Macro.camelize(value)
362362
end
363363

0 commit comments

Comments
 (0)