diff --git a/lib/elixir/lib/application.ex b/lib/elixir/lib/application.ex index 66af083f342..de8fe127fa6 100644 --- a/lib/elixir/lib/application.ex +++ b/lib/elixir/lib/application.ex @@ -696,7 +696,7 @@ defmodule Application do config :my_app, Databases.RepoTwo, # Another database configuration (for the same OTP app) ip: "localhost", - port: 20717 + port: 20_717 config :my_app, my_app_databases: [Databases.RepoOne, Databases.RepoTwo] diff --git a/lib/elixir/lib/calendar/date.ex b/lib/elixir/lib/calendar/date.ex index b4e365bea46..df7d07569b3 100644 --- a/lib/elixir/lib/calendar/date.ex +++ b/lib/elixir/lib/calendar/date.ex @@ -53,7 +53,7 @@ defmodule Date do iex> Date.diff(~D[2010-04-17], ~D[1970-01-01]) 14716 - iex> Date.add(~D[1970-01-01], 14716) + iex> Date.add(~D[1970-01-01], 14_716) ~D[2010-04-17] iex> Date.shift(~D[1970-01-01], year: 40, month: 3, week: 2, day: 2) diff --git a/lib/elixir/lib/calendar/iso.ex b/lib/elixir/lib/calendar/iso.ex index 3cd9095b618..63304ef7ad3 100644 --- a/lib/elixir/lib/calendar/iso.ex +++ b/lib/elixir/lib/calendar/iso.ex @@ -182,7 +182,7 @@ defmodule Calendar.ISO do @type day_of_year :: 1..366 @type quarter_of_year :: 1..4 - @type year_of_era :: {1..10000, era} + @type year_of_era :: {1..10_000, era} @seconds_per_minute 60 @seconds_per_hour 60 * 60 @@ -652,7 +652,7 @@ defmodule Calendar.ISO do day_fraction = time_to_day_fraction(hour, minute, second, {0, 0}) {{year, month, day}, {hour, minute, second, _}} = - case add_day_fraction_to_iso_days({0, day_fraction}, -offset, 86400) do + case add_day_fraction_to_iso_days({0, day_fraction}, -offset, 86_400) do {0, day_fraction} -> {{year, month, day}, time_from_day_fraction(day_fraction)} @@ -784,13 +784,13 @@ defmodule Calendar.ISO do ## Examples - iex> Calendar.ISO.naive_datetime_from_iso_days({0, {0, 86400}}) + iex> Calendar.ISO.naive_datetime_from_iso_days({0, {0, 86_400}}) {0, 1, 1, 0, 0, 0, {0, 6}} - iex> Calendar.ISO.naive_datetime_from_iso_days({730_485, {0, 86400}}) + iex> Calendar.ISO.naive_datetime_from_iso_days({730_485, {0, 86_400}}) {2000, 1, 1, 0, 0, 0, {0, 6}} - iex> Calendar.ISO.naive_datetime_from_iso_days({730_485, {43200, 86400}}) + iex> Calendar.ISO.naive_datetime_from_iso_days({730_485, {43_200, 86_400}}) {2000, 1, 1, 12, 0, 0, {0, 6}} - iex> Calendar.ISO.naive_datetime_from_iso_days({-365, {0, 86400000000}}) + iex> Calendar.ISO.naive_datetime_from_iso_days({-365, {0, 86_400_000_000}}) {-1, 1, 1, 0, 0, 0, {0, 6}} """ @@ -1133,7 +1133,7 @@ defmodule Calendar.ISO do """ @doc since: "1.8.0" - @spec year_of_era(year) :: {1..10000, era} + @spec year_of_era(year) :: {1..10_000, era} def year_of_era(year) when is_year_CE(year), do: {year, 1} def year_of_era(year) when is_year_BCE(year), do: {abs(year) + 1, 0} @@ -1159,7 +1159,7 @@ defmodule Calendar.ISO do """ @doc since: "1.13.0" @impl true - @spec year_of_era(year, month, day) :: {1..10000, era} + @spec year_of_era(year, month, day) :: {1..10_000, era} def year_of_era(year, _month, _day), do: year_of_era(year) @doc """ @@ -1704,11 +1704,11 @@ defmodule Calendar.ISO do ## Examples - iex> Calendar.ISO.iso_days_to_beginning_of_day({0, {0, 86400000000}}) + iex> Calendar.ISO.iso_days_to_beginning_of_day({0, {0, 86_400_000_000}}) {0, {0, 86400000000}} - iex> Calendar.ISO.iso_days_to_beginning_of_day({730485, {43200000000, 86400000000}}) + iex> Calendar.ISO.iso_days_to_beginning_of_day({730_485, {43_200_000_000, 86_400_000_000}}) {730485, {0, 86400000000}} - iex> Calendar.ISO.iso_days_to_beginning_of_day({730485, {46800000000, 86400000000}}) + iex> Calendar.ISO.iso_days_to_beginning_of_day({730_485, {46_800_000_000, 86_400_000_000}}) {730485, {0, 86400000000}} """ @@ -1724,11 +1724,11 @@ defmodule Calendar.ISO do ## Examples - iex> Calendar.ISO.iso_days_to_end_of_day({0, {0, 86400000000}}) + iex> Calendar.ISO.iso_days_to_end_of_day({0, {0, 86_400_000_000}}) {0, {86399999999, 86400000000}} - iex> Calendar.ISO.iso_days_to_end_of_day({730485, {43200000000, 86400000000}}) + iex> Calendar.ISO.iso_days_to_end_of_day({730_485, {43_200_000_000, 86_400_000_000}}) {730485, {86399999999, 86400000000}} - iex> Calendar.ISO.iso_days_to_end_of_day({730485, {46800000000, 86400000000}}) + iex> Calendar.ISO.iso_days_to_end_of_day({730_485, {46_800_000_000, 86_400_000_000}}) {730485, {86399999999, 86400000000}} """ @@ -1888,7 +1888,7 @@ defmodule Calendar.ISO do def shift_time_unit({_days, _day_fraction} = iso_days, value, unit) when unit in [:second, :millisecond, :microsecond, :nanosecond] or is_integer(unit) do - ppd = System.convert_time_unit(86400, :second, unit) + ppd = System.convert_time_unit(86_400, :second, unit) add_day_fraction_to_iso_days(iso_days, value, ppd) end @@ -1937,7 +1937,7 @@ defmodule Calendar.ISO do }) do [ month: year * 12 + month, - second: week * 7 * 86400 + day * 86400 + hour * 3600 + minute * 60 + second, + second: week * 7 * 86_400 + day * 86_400 + hour * 3600 + minute * 60 + second, microsecond: microsecond ] end diff --git a/lib/elixir/lib/file.ex b/lib/elixir/lib/file.ex index 6b2c33225f0..0a79b9a0162 100644 --- a/lib/elixir/lib/file.ex +++ b/lib/elixir/lib/file.ex @@ -694,7 +694,7 @@ defmodule File do File.touch("/fakedir/b.txt", {{2018, 1, 30}, {13, 59, 59}}) {:error, :enoent} - File.touch("/tmp/a.txt", 1544519753) + File.touch("/tmp/a.txt", 1_544_519_753) #=> :ok """ @@ -733,7 +733,7 @@ defmodule File do File.touch!("/fakedir/b.txt", {{2018, 1, 30}, {13, 59, 59}}) ** (File.Error) could not touch "/fakedir/b.txt": no such file or directory - File.touch!("/tmp/a.txt", 1544519753) + File.touch!("/tmp/a.txt", 1_544_519_753) """ @spec touch!(Path.t(), erlang_time() | posix_time()) :: :ok diff --git a/lib/elixir/lib/kernel.ex b/lib/elixir/lib/kernel.ex index dd3a4d8320f..564f9702607 100644 --- a/lib/elixir/lib/kernel.ex +++ b/lib/elixir/lib/kernel.ex @@ -6375,7 +6375,7 @@ defmodule Kernel do With a timeout: - iex> to_timeout(5400000) + iex> to_timeout(5_400_000) 5400000 iex> to_timeout(:infinity) :infinity diff --git a/lib/elixir/lib/process.ex b/lib/elixir/lib/process.ex index a8748b41668..ffb6ff2275d 100644 --- a/lib/elixir/lib/process.ex +++ b/lib/elixir/lib/process.ex @@ -839,7 +839,7 @@ defmodule Process do @spec flag(:min_bin_vheap_size, non_neg_integer) :: non_neg_integer @spec flag(:min_heap_size, non_neg_integer) :: non_neg_integer @spec flag(:priority, priority_level) :: priority_level - @spec flag(:save_calls, 0..10000) :: 0..10000 + @spec flag(:save_calls, 0..10_000) :: 0..10_000 @spec flag(:sensitive, boolean) :: boolean @spec flag(:trap_exit, boolean) :: boolean defdelegate flag(flag, value), to: :erlang, as: :process_flag @@ -858,7 +858,7 @@ defmodule Process do Inlined by the compiler. """ - @spec flag(pid, :save_calls, 0..10000) :: 0..10000 + @spec flag(pid, :save_calls, 0..10_000) :: 0..10_000 defdelegate flag(pid, flag, value), to: :erlang, as: :process_flag @doc """ diff --git a/lib/elixir/pages/getting-started/erlang-libraries.md b/lib/elixir/pages/getting-started/erlang-libraries.md index e0bdbf4ad1e..08c6db79d6d 100644 --- a/lib/elixir/pages/getting-started/erlang-libraries.md +++ b/lib/elixir/pages/getting-started/erlang-libraries.md @@ -145,7 +145,7 @@ The [`:rand`](`:rand`) has functions for returning random values and setting the ```elixir iex> :rand.uniform() 0.8175669086010815 -iex> _ = :rand.seed(:exs1024, {123, 123534, 345345}) +iex> _ = :rand.seed(:exs1024, {123, 123_534, 345_345}) iex> :rand.uniform() 0.5820506340260994 iex> :rand.uniform(6) diff --git a/lib/ex_unit/lib/ex_unit/formatter.ex b/lib/ex_unit/lib/ex_unit/formatter.ex index 3a4bca6cb49..c018ef66024 100644 --- a/lib/ex_unit/lib/ex_unit/formatter.ex +++ b/lib/ex_unit/lib/ex_unit/formatter.ex @@ -182,16 +182,16 @@ defmodule ExUnit.Formatter do ## Examples - iex> format_times(%{run: 10000, async: nil, load: nil}) + iex> format_times(%{run: 10_000, async: nil, load: nil}) "Finished in 0.01 seconds (0.00s async, 0.01s sync)" - iex> format_times(%{run: 10000, async: nil, load: 20000}) + iex> format_times(%{run: 10_000, async: nil, load: 20_000}) "Finished in 0.03 seconds (0.02s on load, 0.00s async, 0.01s sync)" - iex> format_times(%{run: 10000, async: nil, load: 200_000}) + iex> format_times(%{run: 10_000, async: nil, load: 200_000}) "Finished in 0.2 seconds (0.2s on load, 0.00s async, 0.01s sync)" - iex> format_times(%{run: 100_000, async: 50000, load: 200_000}) + iex> format_times(%{run: 100_000, async: 50_000, load: 200_000}) "Finished in 0.3 seconds (0.2s on load, 0.05s async, 0.05s sync)" """ @@ -215,7 +215,7 @@ defmodule ExUnit.Formatter do end defp normalize_us(nil), do: 0 - defp normalize_us(us), do: div(us, 10000) + defp normalize_us(us), do: div(us, 10_000) defp format_us(us) do if us < 10 do diff --git a/lib/ex_unit/mix.exs b/lib/ex_unit/mix.exs index 49325b2644f..ac2a611fb8d 100644 --- a/lib/ex_unit/mix.exs +++ b/lib/ex_unit/mix.exs @@ -36,7 +36,7 @@ defmodule ExUnit.MixProject do slowest: 0, slowest_modules: 0, stacktrace_depth: 20, - timeout: 60000, + timeout: 60_000, trace: false, after_suite: [], repeat_until_failure: 0, diff --git a/lib/ex_unit/test/ex_unit_test.exs b/lib/ex_unit/test/ex_unit_test.exs index 336b0bd4b85..2a9fa4bd8fd 100644 --- a/lib/ex_unit/test/ex_unit_test.exs +++ b/lib/ex_unit/test/ex_unit_test.exs @@ -211,7 +211,7 @@ defmodule ExUnitTest do output = capture_io(fn -> ExUnit.run() end) assert output =~ "** (ExUnit.TimeoutError) test timed out after 5ms" after - ExUnit.configure(timeout: 60000) + ExUnit.configure(timeout: 60_000) end test "reports slow tests" do @@ -281,7 +281,7 @@ defmodule ExUnitTest do config = ExUnit.configuration() assert config[:trace] assert config[:max_cases] == 1 - assert config[:timeout] == 60000 + assert config[:timeout] == 60_000 end test "sets trace when slowest is enabled" do diff --git a/lib/logger/lib/logger/formatter.ex b/lib/logger/lib/logger/formatter.ex index 2ed22d88af3..e2737d8b406 100644 --- a/lib/logger/lib/logger/formatter.ex +++ b/lib/logger/lib/logger/formatter.ex @@ -94,7 +94,7 @@ defmodule Logger.Formatter do > discarded. """ - @type date :: {1970..10000, 1..12, 1..31} + @type date :: {1970..10_000, 1..12, 1..31} @type time_ms :: {0..23, 0..59, 0..59, 0..999} @type date_time_ms :: {date, time_ms} diff --git a/lib/logger/test/logger/formatter_test.exs b/lib/logger/test/logger/formatter_test.exs index 1fbc466e2cc..4db4c03f095 100644 --- a/lib/logger/test/logger/formatter_test.exs +++ b/lib/logger/test/logger/formatter_test.exs @@ -41,7 +41,7 @@ defmodule Logger.FormatterTest do assert truncate(~c"ol" ++ "á", 4) == ~c"ol" ++ "á" # :infinity - long_string = String.duplicate("foo", 10000) + long_string = String.duplicate("foo", 10_000) assert truncate(long_string, :infinity) == long_string end diff --git a/lib/logger/test/logger/utils_test.exs b/lib/logger/test/logger/utils_test.exs index 5cea0f41eba..992084faab2 100644 --- a/lib/logger/test/logger/utils_test.exs +++ b/lib/logger/test/logger/utils_test.exs @@ -64,7 +64,7 @@ defmodule Logger.UtilsTest do end test "with :infinity truncate" do - long_string = String.duplicate("foo", 10000) + long_string = String.duplicate("foo", 10_000) assert scan_inspect(~c"~ts", [long_string], :infinity) == {~c"~ts", [long_string]} end end diff --git a/lib/mix/lib/mix/tasks/deps.partition.ex b/lib/mix/lib/mix/tasks/deps.partition.ex index 73fd291a07f..f9898c9630d 100644 --- a/lib/mix/lib/mix/tasks/deps.partition.ex +++ b/lib/mix/lib/mix/tasks/deps.partition.ex @@ -95,8 +95,8 @@ defmodule Mix.Tasks.Deps.Partition do clients = Enum.map(1..count//1, fn _ -> - with {:ok, client} <- :gen_tcp.accept(socket, 15000), - {:ok, message} <- :gen_tcp.recv(client, 0, 15000) do + with {:ok, client} <- :gen_tcp.accept(socket, 15_000), + {:ok, message} <- :gen_tcp.recv(client, 0, 15_000) do :inet.setopts(client, active: true) index = message |> String.trim() |> String.to_integer() %{port: Map.fetch!(ports, index), index: index, socket: client} diff --git a/lib/mix/lib/mix/tasks/profile.cprof.ex b/lib/mix/lib/mix/tasks/profile.cprof.ex index 5eaf752d1c9..9bca753f133 100644 --- a/lib/mix/lib/mix/tasks/profile.cprof.ex +++ b/lib/mix/lib/mix/tasks/profile.cprof.ex @@ -92,7 +92,7 @@ defmodule Mix.Tasks.Profile.Cprof do Other caveats are the impossibility to call count trace BIFs, since breakpoints can only be set on BEAM code; functions calls performed by `:cprof` are not traced; the maximum size of a call counter is equal to the host machine's word size - (for example, 2147483647 in a 32-bit host). + (for example, `2_147_483_647` in a 32-bit host). """ @typedoc """