summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2017-10-08 12:20:51 +0200
committerJosé Valim <jose.valim@plataformatec.com.br>2017-10-08 12:41:59 +0200
commitb8611b9d47a2aac4a6cb43b285e60b355bc632c7 (patch)
treef01e3b60163f687bfef005632a4e2f51accc08c3
parent5e46354fe4851c7bf7fb840d5bfe4da8f48ca5e9 (diff)
downloadelixir-jv-mix-format.tar.gz
Check formatting is equivalent on travisjv-mix-format
-rw-r--r--.travis.yml5
-rw-r--r--lib/elixir/src/elixir.erl19
2 files changed, 13 insertions, 11 deletions
diff --git a/.travis.yml b/.travis.yml
index f246d4c62..c208778dc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,9 +22,12 @@ script:
- make compile
- rm -rf .git
- make test
+ - bin/elixir bin/mix format --dry-run --check-equivalent
- dialyzer -pa lib/elixir/ebin --build_plt --output_plt elixir.plt --apps lib/elixir/ebin/elixir.beam lib/elixir/ebin/Elixir.Kernel.beam
notifications:
recipients:
- - jose.valim@plataformatec.com.br
+ - jose.valim@gmail.com.br
- eric.meadows.jonsson@gmail.com
+ - lexmag@me.com
+ - an.leopardi@gmail.com
diff --git a/lib/elixir/src/elixir.erl b/lib/elixir/src/elixir.erl
index 292b1097c..9af8f934e 100644
--- a/lib/elixir/src/elixir.erl
+++ b/lib/elixir/src/elixir.erl
@@ -35,16 +35,15 @@ start(_Type, _Args) ->
error -> [binary]
end,
- OTPRelease = string:to_integer(erlang:system_info(otp_release)),
-
%% Whenever we change this check, we should also change escript.build.
- case OTPRelease of
- {Num, _} when Num >= 19 ->
- ok;
- _ ->
- io:format(standard_error, "unsupported Erlang version, expected Erlang 19+~n", []),
- erlang:halt(1)
- end,
+ OTPRelease =
+ case string:to_integer(erlang:system_info(otp_release)) of
+ {Num, _} when Num >= 19 ->
+ Num;
+ _ ->
+ io:format(standard_error, "unsupported Erlang version, expected Erlang 19+~n", []),
+ erlang:halt(1)
+ end,
%% We need to make sure the re module is preloaded
%% to make function_exported checks on it fast.
@@ -83,7 +82,7 @@ start(_Type, _Args) ->
%% TODO: Remove OTPRelease check once we support OTP 20+.
Tokenizer = case code:ensure_loaded('Elixir.String.Tokenizer') of
{module, Mod} when OTPRelease >= 20 -> Mod;
- {error, _} -> elixir_tokenizer
+ _ -> elixir_tokenizer
end,
URIConfig = [{{uri, <<"ftp">>}, 21},