Commit Graph
3088 Commits
Author SHA1 Message Date
Glauber Campinho b99306bb44 Remove multiple clauses warning for default values on bodiless clause (#7092) 2017-12-11 21:38:49 +01:00
José Valim b4aac2d7be Do not indent right-side of pipelines in the formatter (#7103) 2017-12-11 21:07:30 +01:00
José Valim 4d3cbcdaaa Introduce @since as non-warning definition annotation
Partially implements #7099.
2017-12-11 18:22:08 +01:00
José Valim 29e8385409 Fix count_children for Task.Supervisor, closes #7101 2017-12-11 16:13:29 +01:00
José Valim 74f617399f Use a single table instead of digraph for tracking locals
This reduces the number of spawned ETS tables from 3 to 1
per local tracker and also removes the need for a separate
process.

Closes #7091.
2017-12-06 19:49:54 +01:00
José Valim c063093d32 Inspect tuples closer to the formatter, closes #6509 2017-12-06 12:01:48 +01:00
Donald Little 3086b68636 Show UTF-8 BOM on inspected strings (#7085) 2017-12-03 14:04:52 +01:00
Glauber Campinho 25dc8d8d4f Move boolean checks optimizations to Kernel (#7071) 2017-11-30 00:29:54 -02:00
Glauber Campinho e12a76eca9 Translate clauses for boolean check (#7069)
Warnings for unsafe variable on boolean checks stopped working after #7015 because
variables of the right clause are unbound on the left clause.

Fixes #7044
2017-11-28 11:56:13 -02:00
James Fish 9a65cbc082 Do not raise on non-integer values in is_odd/is_even (#7063) 2017-11-26 12:54:37 -02:00
Ivan Kozik 47a3b0897d Clarify File.exists? behavior for dangling symlinks (#7056) 2017-11-22 01:51:06 -02:00
Aleksei Magusev fb2d25516f Consider microseconds in maximum possible Calendar.ISO datetime (#7055) 2017-11-21 23:18:43 +01:00
José Valim ce4e0099e2 Properly take "do" into account on line breaks, closes #7052 2017-11-21 14:54:42 -02:00
Eric Meadows-Jönsson d8a533d19f assert_receive should expand in match context (#7042)
Closes #7041.
2017-11-19 07:24:25 -02:00
jgmchan 882c2bdb24 Show better error if an anonymous function has default arguments 2017-11-16 13:53:28 -02:00
Glauber Campinho 96fcc7e2cc Remove dialyzer warnings from else in with clauses (#7031)
Add generated: true to guard clauses from else in with clauses

Resolves #6426
2017-11-15 20:53:57 +01:00
Glauber Campinho 9aeafeefbd Warn duplicate definitions in macros (#7037)
Closes #6637
2017-11-15 20:52:28 +01:00
Eric Meadows-Jönsson 1303d09f61 Fix precedence of bitwise XOR (^^^) in formatter (#7036)
Closes #7034.
2017-11-15 19:53:20 +01:00
Glauber Campinho eb0891b94b Fix @impl warnings with default arguments (#7028) 2017-11-15 12:04:23 +01:00
Glauber Campinho 505c10e474 Support uniq: true in for comprehensions (#7020) 2017-11-13 23:00:53 +01:00
José Valim 6d1deb2032 Migrate Task.Supervisor to DynamicSupervisor
This means Task.Supervisor now supports max_children
and the restart and shutdown value should now be given
per task and not per supervisor.
2017-11-10 15:02:12 +01:00
José Valim 7f8db39ce2 Add DynamicSupervisor (#7006) 2017-11-09 22:14:26 +01:00
José Valim 432e9114b1 Ensure we track behaviours at compile time 2017-11-09 22:13:58 +01:00
Raphaël Lustin 3de8710217 Add truncate to Time, DateTime and NaiveDateTime (#7010)
Fixes #6997
2017-11-08 13:45:44 +01:00
José Valim 384e88ca43 Only consider a document doesn't fit if it has breaks
Closes #7007
2017-11-07 16:03:48 +01:00
José Valim adba54347e Add end_line information to string_to_quoted tests 2017-11-07 11:02:21 +01:00
José Valim 5ea7321562 Consider comments inside function calls
Closes #6994
2017-11-07 10:50:11 +01:00
José Valim ca75fc66ee Pass the proper precedence to binary operator handling, closes #7005 2017-11-07 09:37:02 +01:00
José Valim ad190b0889 Raise on reserved tokens, closes #6532 2017-11-06 17:15:44 +01:00
Chris Keele 6ab811c638 Adds Kernel.defguard/1 macro to build guard-safe macros
This makes defining guards easier, since it does the boilerplate
for you and raises at compile time in the defguard macro when
you do something not allowed in guards (as opposed to whenever
the new guard happens to be used as a guard).

It takes a `defguard name(args) when implementation` invocation,
passes the implementation through `:elixir_expand.expand/2` in
a guard context, and if nothing is raised, transforms the impl
into a macro that works both inside and outside of guard contexts.

Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2017-11-06 12:39:53 +01:00
José Valim db44cd2ddc Ensure file in stacktraces is a charlist 2017-11-03 22:25:07 +01:00
José Valim 25dbbef634 Warn if init/1 is not implemented in GenServer
This brings GenServer closer to the implementation in OTP
and aligns all behaviours to require the init/1 callback.

Closes #6998.
2017-11-03 18:49:07 +01:00
José Valim 74da11fd91 Ensure we handle :undefined returns for optional callbacks, closes #6993 2017-11-01 20:27:41 +01:00
José Valim 6ea055cd61 Track structs separately from compile time deps, closes #6575 2017-11-01 17:44:12 +01:00
José Valim bf26e78c18 Remove test marked with @tag :skip
The test is implemented in typespec_tesst as an error.
2017-10-31 14:26:30 +01:00
Michał Muskała c95a877d38 Separate tracking structs from compile-time dependencies
This is a first step to limiting recompilations in case a struct is used in a
module, the "parent module" of the struct changes, but struct definition itself
does not change.

Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2017-10-31 14:24:48 +01:00
Ben Olive dfcc88fc33 Handle final sigma unicode exception
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2017-10-30 18:45:16 +01:00
Eric Zhang 4b714ebef3 Raise when calling GenServer.stop/3 with current process (#6987) 2017-10-30 10:35:08 +01:00
José Valim 794928efe1 Restrict next break fits and eols on operators and function calls
* Whitelist which operators support next_break_fits
  * No longer consider tuples as part of next_break_fits
  * Do not consider eol for = and ::
  * Do not consider eol for calls with one next_break_fits arg
2017-10-27 12:34:09 +02:00
Blake Tan 554d595009 Better handling of non existing atoms (#6978) 2017-10-26 20:25:00 +02:00
Andrea Leopardi 3ac72777b7 Fix formatting of multiline "foo.{...}" calls (#6979) 2017-10-26 13:59:37 +02:00
José Valim 3d84aec0f9 Respect the user's choice on calls
Closes #6977
2017-10-26 13:19:21 +02:00
José Valim 7f8136915f Treat => and : as operators in the formatter
This means that the right side will break on its own line
when it doesn't fit and be indented by two spaces.

Closes #6976.
2017-10-26 12:43:02 +02:00
José Valim 37bae89e99 Use flex when inspecting tuples
This aligns better with the formatter latest style
2017-10-26 10:46:27 +02:00
José Valim 47dd73e7be Consistently add spaces after not 2017-10-25 19:38:56 +02:00
José Valim f09657180f Support next break fits inside tuples
This only applies if the tuple has not been "spaced out".
2017-10-25 19:36:34 +02:00
José Valim d3a85bfd21 Remove end column information from tokens
If we want to store this information, we need to store it
alongside the end line, otherwise it is ambiguous.
2017-10-25 11:56:31 +02:00
José Valim b87989e702 Support columns: true in string_to_quoted, closes #3554 2017-10-25 11:02:53 +02:00
José Valim 4b930b0a0b Avoid conflicts with erl_anno in meta
We avoid using :file publicly as well as :location privately.
We do still use :file privately but that's supposed to mirror
the `-file` annotation in Erlang before function definitions.
2017-10-25 00:33:05 +02:00
José Valim 55eba5c0f0 Improve fetch_env error message 2017-10-24 16:44:06 +02:00