Elixir release

1.7.0

Change breakdown

Organization at a glance

Detailed changelog

Enhancement

66 changes

Tool: Elixir Module: Calendar.ISO

Support negative dates in Calendar.ISO

Tool: Elixir Module: Calendar

Add Calendar.months_in_year/1 callback

Tool: Elixir Module: Code

Add Code.compile_file/2 that compiles files without leaving footprints on the system

Tool: Elixir Module: Code

Add Code.purge_compiler_modules/0 that purges any compiler module left behind. This is useful for live systems dynamically compiling code

Tool: Elixir Module: Code

Add Code.fetch_docs/1 that returns docs in the EEP 48 format

Tool: Elixir Module: Date

Add Date.months_in_year/1 function

Tool: Elixir Module: DynamicSupervisor

Use the name of the DynamicSupervisor as the ID whenever possible

Tool: Elixir Module: Exception

Provide "did you mean" suggestions on KeyError

Tool: Elixir Module: Exception

Provide more information on ArithmeticError on Erlang/OTP 21+

Tool: Elixir Module: Function

Add Function module with capture/3, info/1 and info/2 functions

Tool: Elixir Module: GenServer

Support the new handle_continue/2 callback on Erlang/OTP 21+

Tool: Elixir Module: IO.ANSI

Add cursor movement to IO.ANSI

Tool: Elixir Module: Kernel

Support adding arbitrary documentation metadata by passing a keyword list to @doc, @moduledoc and @typedoc

Tool: Elixir Module: Kernel

Introduce __STACKTRACE__ to retrieve the current stacktrace inside catch/rescue (this will be a requirement for Erlang/OTP 21+)

Tool: Elixir Module: Kernel

Raise on unsafe variables in order to allow us to better track unused variables (also known as imperative assignment / variable leakage)

Tool: Elixir Module: Kernel

Warn when using length to check if a list is not empty on guards

Tool: Elixir Module: Kernel

Add hints on mismatched do/end and others pairs

Tool: Elixir Module: Kernel

Warn when comparing structs using the >, <, >= and <= operators

Tool: Elixir Module: Kernel

Warn on unsupported nested comparisons such as x < y < z

Tool: Elixir Module: Kernel

Warn if redefining documentation across clauses of the same definition

Tool: Elixir Module: Kernel

Warn on unnecessary quotes around atoms, keywords and calls

Tool: Elixir Module: Macro

Add Macro.special_form?/2 and Macro.operator?/2 that returns true if the given name/arity is a special form or operator respectively

Tool: Elixir Module: Macro.Env

Add Macro.Env.vars/1 and Macro.Env.has_var?/2 that gives access to environment data without accessing private fields

Tool: Elixir Module: Regex

Include endianness in the regex version. This allows regexes to be recompiled when an archive is installed in a system with a different endianness

Tool: Elixir Module: Registry

Add Registry.count/1 and Registry.count_match/4

Tool: Elixir Module: String

Update to Unicode 11

Tool: Elixir Module: StringIO

Add StringIO.open/3

Tool: Elixir Module: System

Use ISO 8601 in System.build_info/0

Tool: ExUnit Module: ExUnit.Assertion

Print the arguments in error reports when asserting on a function call. For example, if assert is_list(arg) fails, the argument will be shown in the report

Tool: ExUnit Module: ExUnit.Diff

Improve diffing of lists when one list is a subset of the other

Tool: ExUnit Module: ExUnit.DocTest

Show colored diffs on failed doctests

Tool: ExUnit Module: ExUnit.Formatter

Excluded tests, via the --exclude and --only flags, are now shown as "Excluded" in reports. Tests skipped via @tag :skip are now exclusively shown as "Skipped" and in yellow

Tool: IEx Module: IEx.Helpers

Add use_if_available/2

Tool: IEx Module: IEx.Helpers

Allow force: true option in recompile/1

Tool: IEx Module: IEx.Helpers

Add :allocators pane to runtime_info/1

Tool: IEx Module: IEx.Helpers

Show documentation metadata in h/1 helpers

Tool: Logger Module: Logger

Ensure nil metadata is always pruned

Tool: Logger Module: Logger

Only evaluate Logger macro arguments when the message will be logged

Tool: Logger Module: Logger

Add :compile_time_purge_matching to purge logger calls that match certain compile time metadata, such as module names and application names

Tool: Logger Module: Logger

Log to :stderr if a backend fails and there are no other backends

Tool: Logger Module: Logger

Allow translators to return custom metadata

Tool: Logger Module: Logger

Return :crash_reason, :initial_call and :registered_name as metadata in crash reports coming from Erlang/OTP

Tool: Mix Module: mix archive.install

Add support for the Hex organization via --organization

Tool: Mix Module: mix archive.uninstall

Support --force flag

Tool: Mix Module: mix compile

Improve support for external build tools such as rebar

Tool: Mix Module: mix deps

Include override: true in rebar dependencies to make the behaviour closer to how rebar3 works (although diverged deps are still marked as diverged)

Tool: Mix Module: mix escript.install

Add support for the Hex organization via --organization

Tool: Mix Module: mix escript.uninstall

Support --force flag

Tool: Mix Module: mix help

Also list aliases

Tool: Mix Module: mix local

Use ipv6 with auto fallback to ipv4 when downloading data

Tool: Mix Module: mix profile

Allow all profiling tasks to run programatically

Tool: Mix Module: mix test

Add --failed option that only runs previously failed tests

Tool: Mix Module: mix test

Print coverage summary by default when the --cover flag is given

Tool: Mix Module: Mix.Project

Add Mix.Project.clear_deps_cache/0

Tool: Mix Module: Mix.Project

Add Mix.Project.config_mtime/0 that caches the config mtime values to avoid filesystem access

Tool: Elixir Module: Code

Deprecate Code.load_file/2 in favor of Code.compile_file/2

Tool: Elixir Module: Code

Deprecate Code.loaded_files/0 in favor of Code.required_files/0

Tool: Elixir Module: Code

Deprecate Code.unload_files/1 in favor of Code.unrequire_files/1

Tool: Logger Module: Logger

compile_time_purge_level is deprecated in favor of compile_time_purge_matching

Tool: Elixir Module: Code

Code.get_docs/2 is deprecated in favor of Code.fetch_docs/1

Tool: Elixir Module: Enum

Enum.chunk/2/3/4 is deprecated in favor of Enum.chunk_every/2/3/4 - notice chunk_every does not discard incomplete chunks by default

Tool: Elixir Module: GenServer

Warn if super is used in any of the GenServer callbacks

Tool: Elixir Module: Kernel

not left in right is ambiguous and is deprecated in favor of left not in right

Tool: Elixir Module: Kernel

Warn on confusing operator sequences, such as 1+++1 meaning 1 ++ +1 or ........ meaning ... .. ...

Tool: Elixir Module: OptionParser

Deprecate dynamic option parser mode that depended on atoms to be previously loaded and therefore behaved inconsistently

Tool: Elixir Module: Stream

Stream.chunk/2/3/4 is deprecated in favor of Stream.chunk_every/2/3/4 - notice chunk_every does not discard incomplete chunks by default

Bugfix

18 changes

Tool: Elixir Module: IO.ANSI.Docs

Fix table column alignment when converting docs to ANSI escapes

Tool: Elixir Module: Code

Ensure string_to_quoted returns error tuples instead of raising in certain constructs

Tool: Elixir Module: Code.Formatter

Consistently format keyword lists in function calls with and without parens

Tool: Elixir Module: Code.Formatter

Do not break after -> when there are only comments and one-line clauses

Tool: Elixir Module: File

Allow the :trim_bom option to be used with :encoding

Tool: Elixir Module: Kernel

Raise on unsafe variables as some of the code emitted with unsafe variables would not correctly propagate variables or would disable tail call optimization semantics

Tool: Elixir Module: Kernel

Do not crash on dynamic sizes in binary generators with collectable into in comprehensions

Tool: Elixir Module: Kernel

Do not crash on literals with non-unary size in binary generators with collectable into in comprehensions

Tool: Elixir Module: Task

Improve error reports and exit reasons for failed tasks on Erlang/OTP 20+

Tool: ExUnit Module: ExUnit.Case

Raise proper error if @tag and @moduletag are used before use ExUnit.Case

Tool: ExUnit Module: ExUnit.Case

Raise proper error if @describetag is used outside of describe/2 blocks

Tool: ExUnit Module: ExUnit.DocTest

Emit proper assertion error on doctests with invalid UTF-8

Tool: Mix Module: mix archive.install

Fetch optional dependencies when installing an archive from Git/Hex

Tool: Mix Module: mix compile

Properly track config files in umbrella projects and recompile when any relevant umbrella configuration changes

Tool: Mix Module: mix deps

Ensure the same dependency from different SCMs are tagged as diverged when those SCMs are remote and non-remote

Tool: Mix Module: mix deps

Ensure we re-run dependency resolution when overriding a skipped dep in umbrella

Tool: Mix Module: mix deps.compile

Perform clean builds for dependencies on outdated locks to avoid old modules from affecting future compilation

Tool: Mix Module: mix escript.install

Fetch optional dependencies when installing an escript from Git/Hex