Commit Graph
3052 Commits
Author SHA1 Message Date
Ben Olive 6f40fae504 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 46dd155fc4 Raise when calling GenServer.stop/3 with current process (#6987) 2017-10-30 10:35:08 +01:00
José Valim ef43b25f85 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 39d903ecf3 Better handling of non existing atoms (#6978) 2017-10-26 20:25:00 +02:00
Andrea Leopardi e8c7d48cf7 Fix formatting of multiline "foo.{...}" calls (#6979) 2017-10-26 13:59:37 +02:00
José Valim f0a74482da Respect the user's choice on calls
Closes #6977
2017-10-26 13:19:21 +02:00
José Valim 3fba28e0ee 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 5e4bd77c63 Use flex when inspecting tuples
This aligns better with the formatter latest style
2017-10-26 10:46:27 +02:00
José Valim f11a26dc70 Consistently add spaces after not 2017-10-25 19:38:56 +02:00
José Valim 6f02c12e46 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 703e3000a6 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 292a14466d Support columns: true in string_to_quoted, closes #3554 2017-10-25 11:02:53 +02:00
José Valim 47ca7004b6 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 8152436235 Improve fetch_env error message 2017-10-24 16:44:06 +02:00
José Valim d0e496d6f5 Recognize hashbangs in the formatter
Those are known instructions in UNIX systems.

Closes #6969.
2017-10-24 14:00:10 +02:00
José Valim df8bca004a Improve optional callback checks 2017-10-22 01:48:00 +02:00
José Valim aad66f22bc Move all remaining behaviour usage warnings to Elixir 2017-10-22 00:59:11 +02:00
Alexis Brodeur 18f723541c Perform some behaviour lint checks in Elixir (#6841) 2017-10-21 23:35:15 +02:00
José Valim 17a59905b2 Format expansion_test.exs 2017-10-21 20:56:13 +02:00
José Valim f130cb9c84 Improve warnings during expansion 2017-10-21 20:43:35 +02:00
José Valim 23eb3ef089 Add Enumerable.slice/1 and use it in Enum (#6958)
We have reimplemented Enum.at/3, Enum.fetch/2, Enum.fetch!/2,
Enum.random/1, Enum.slice/2, and Enum.slice/3 to be more
efficient by using the new protocol function.

This partially implements #6955. We have decided to not replace
`count/1` by an `aggregate/2` callback because it became clear
we cannot implement `min/1` for date ranges since `Enum.min/1`
does a structural comparison. Given ranges are still the only case
that requires custom aggregations, we have decided to inline those
in Enum until we have more evidence that such callback is necessary.
2017-10-21 16:17:04 +02:00
Glauber Campinho f3acc14fb5 Add file information to the dispatches on the source manifests (#6954) 2017-10-21 11:53:06 +02:00
Pedro Medeiros 0dc899df43 Format @spec with map literal with multi keys
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2017-10-19 18:32:04 +02:00
José Valim 499c153c0d Ensure left side of | in maps has parens when necessary 2017-10-19 18:29:13 +02:00
José Valim 115bb08f51 Deprecate Range.range? in favor of pattern matching 2017-10-17 19:54:03 +02:00
Andrea Leopardi b5211deec0 Fix a bug where we discarded some meta in some literals in the parser (#6946)
Closes #6945.
2017-10-17 17:31:48 +02:00
José Valim 62ce847763 Simplify rules for & with binary operators
Closes #6923.
2017-10-16 18:10:56 +02:00
José Valim 24931c539b Fix tokenizer tests 2017-10-16 17:11:23 +02:00
José Valim 01cd27393e Keep integer/float underscores in the formatter, closes #6931 2017-10-16 16:44:53 +02:00
José Valim d475c8c286 Do not pass :in_memory to load_binary
Erlang's typespecs define only cover_compiled and preloaded
as valid atoms and uses an empty list for generated code.
So we should follow Erlang's rules until we can officially
relax them.
2017-10-14 23:19:32 +02:00
José Valim 782a4a59c3 Formatter should not fail on empty clauses, closes #6924 2017-10-12 11:30:41 +02:00
José Valim dbc38a581f Check files are formatted on CI 2017-10-12 09:41:06 +02:00
José Valim a33cbcd32a Format errors_test.exs 2017-10-12 09:35:58 +02:00
Andrea Leopardi ba1530c895 Run the code formatter on Kernel.QuoteTest 2017-10-12 00:48:43 +02:00
Andrea Leopardi b26666b8fd Run the code formatter on MacroTest 2017-10-12 00:41:04 +02:00
Andrea Leopardi 6337dbdf42 WIP 2017-10-12 00:40:21 +02:00
Eric Meadows-Jönsson 1e80f54a83 Run code formatter on Code.Formatter.GeneralTest 2017-10-11 23:49:41 +02:00
Eric Meadows-Jönsson 3931645f2f Run code formatter on RegistryTest 2017-10-11 23:49:41 +02:00
José Valim f597fa23b0 Format archive_test and inspect_test 2017-10-11 23:33:32 +02:00
José Valim 6250eef541 Format more pending files 2017-10-11 23:29:06 +02:00
José Valim 9fadbfc87a Format more pending files 2017-10-11 23:15:03 +02:00
José Valim dec9e6f0a8 Improvements to previously formatted files 2017-10-11 22:59:30 +02:00
Bruno Laturner f7fd750665 Run code formatter on Kernel.RaiseTest (#6914) 2017-10-11 22:43:51 +02:00
Tobiasz Małecki 09e1d28804 Run code formatter on lib/elixir/test/elixir/option_parser_test.exs (#6913) 2017-10-11 22:31:40 +02:00
José Valim 33941c681e Use String.to_atom/1 for Unicode atoms 2017-10-11 22:28:14 +02:00
José Valim 940d2f61c0 Make sure to not break guards on clauses with comments 2017-10-11 21:25:21 +02:00
José Valim 7f3cf98847 Format more files with little formatting requirement 2017-10-11 21:09:29 +02:00
José Valim 72eaaed46e Format more files with little formatting requirement 2017-10-11 20:17:50 +02:00
José Valim d8087008ac Format more files with little formatting requirement 2017-10-11 18:43:03 +02:00
Mohd Maqbool Alam ca43112757 Run the code formatter on lib/elixir/test/elixir/string_test.exs (#6897) 2017-10-11 18:28:57 +02:00