   end
 
   defp check_configured() do
-    configured = Mix.ProjectStack.configured_applications
+    configured = Mix.ProjectStack.configured_applications()
     loaded = for {app, _, _} <- Application.loaded_applications(), do: app
-    _ = for app <- configured -- loaded,
-           :code.lib_dir(app) == {:error, :bad_name} do
-      Mix.shell.error """
-      You have configured application #{inspect app} in your configuration
-      file, but the application is not available.
 
-      This usually means one of:
+    _ =
+      for app <- configured -- loaded, :code.lib_dir(app) == {:error, :bad_name} do
+        Mix.shell().error("""
+        You have configured application #{inspect(app)} in your configuration
+        file, but the application is not available.
 
-      1. You have not added the application as a dependency in a mix.exs file.
+        This usually means one of:
 
-      2. You are configuring an application that does not really exist.
+        1. You have not added the application as a dependency in a mix.exs file.
 
-      Please ensure #{inspect app} exists or remove the configuration.
-      """
-    end
+        2. You are configuring an application that does not really exist.
+
+        Please ensure #{inspect(app)} exists or remove the configuration.
+        """)
+      end
+
     :ok
   end
 
   defp load_protocol(file) do
     case file do
       "Elixir." <> _ ->
-        module = file |> Path.rootname |> String.to_atom
+        module = file |> Path.rootname() |> String.to_atom()
         :code.purge(module)
         :code.delete(module)
+
       _ ->
         :ok
     end

    #
    # Mix should not depend directly on Logger so check that it's loaded.
    logger = Process.whereis(Logger)
    if logger do
      Logger.App.stop
    end

    if "--no-start" in args do
      # Start Logger again if the application won't be starting it
      if logger do
        :ok = Logger.App.start
      end
    else
      start(Mix.Project.config, opts)
    end

    :ok


  defp ensure_all_started(app, type) do
    case Application.ensure_all_started(app, type) do
      {:ok, _} ->
        :ok

      {:error, {app, reason}} ->
        Mix.raise("Could not start application #{app}: " <> Application.format_error(reason))
    end
  end

