   end
 
   defp do_mix(dep, _config) do
-    Mix.Dep.in_dependency dep, fn _ ->
-      if req = old_elixir_req(Mix.Project.config) do
-        Mix.shell.error "warning: the dependency #{inspect dep.app} requires Elixir #{inspect req} " <>
-                        "but you are running on v#{System.version}"
+    Mix.Dep.in_dependency(dep, fn _ ->
+      if req = old_elixir_req(Mix.Project.config()) do
+        Mix.shell().error(
+          "warning: the dependency #{inspect(dep.app)} requires Elixir #{inspect(req)} " <>
+            "but you are running on v#{System.version()}"
+        )
       end
 
       # Force recompilation on compile status
       if dep.status == :compile do
-        Mix.Dep.Lock.touch_manifest
+        Mix.Dep.Lock.touch_manifest()
       end
 
       try do
-        res = Mix.Task.run("compile", ["--no-deps", "--no-archives-check",
-                                       "--no-elixir-version-check", "--no-warnings-as-errors"])
+        options = [
+          "--no-deps",
+          "--no-archives-check",
+          "--no-elixir-version-check",
+          "--no-warnings-as-errors"
+        ]
+
+        res = Mix.Task.run("compile", options)
+
         match?({:ok, _}, res)
       catch
         kind, reason ->
-          stacktrace = System.stacktrace
+          stacktrace = System.stacktrace()
           app = dep.app
-          Mix.shell.error "could not compile dependency #{inspect app}, \"mix compile\" failed. " <>
-            "You can recompile this dependency with \"mix deps.compile #{app}\", update it " <>
-            "with \"mix deps.update #{app}\" or clean it with \"mix deps.clean #{app}\""
+
+          Mix.shell().error(
+            "could not compile dependency #{inspect(app)}, \"mix compile\" failed. " <>
+              "You can recompile this dependency with \"mix deps.compile #{app}\", update it " <>
+              "with \"mix deps.update #{app}\" or clean it with \"mix deps.clean #{app}\""
+          )
+
           :erlang.raise(kind, reason, stacktrace)
       end
-    end
+    end)
   end
 
   defp do_rebar(dep, config) do
     lib_path = Path.join(config[:env_path], "lib")
-    cmd      = "#{rebar_cmd(dep)} compile skip_deps=true deps_dir=#{inspect lib_path}"
-    do_command dep, config, cmd, false
+    cmd = "#{rebar_cmd(dep)} compile skip_deps=true deps_dir=#{inspect(lib_path)}"
+    do_command(dep, config, cmd, false)
   end
 
   defp do_rebar3(%Mix.Dep{opts: opts} = dep, config) do
-    dep_path    = opts[:build]
+    dep_path = opts[:build]
     config_path = Path.join(dep_path, "mix.rebar.config")
-    lib_path    = Path.join(config[:env_path], "lib/*/ebin")
+    lib_path = Path.join(config[:env_path], "lib/*/ebin")
 
     env = [{"REBAR_CONFIG", config_path}, {"TERM", "dumb"}]
-    cmd = "#{rebar_cmd(dep)} bare compile --paths #{inspect lib_path}"
+    cmd = "#{rebar_cmd(dep)} bare compile --paths #{inspect(lib_path)}"
 
     File.mkdir_p!(dep_path)
     File.write!(config_path, rebar_config(dep))
-    do_command dep, config, cmd, false, env
+    do_command(dep, config, cmd, false, env)
   end
 
   defp rebar_config(dep) do
     dep.extra
-    |> Mix.Rebar.dependency_config
-    |> Mix.Rebar.serialize_config
+    |> Mix.Rebar.dependency_config()
+    |> Mix.Rebar.serialize_config()
   end
 
   defp rebar_cmd(%Mix.Dep{manager: manager} = dep) do

    makefile_win? = makefile_win?(dep)

    command =
      case :os.type do
        {:win32, _} when makefile_win? ->
          "nmake /F Makefile.win"
        {:unix, type} when type in [:freebsd, :openbsd] ->
          "gmake"
        _ ->
          "make"
      end

        compiled? and fetchable?
      end)

    if true in compiled, do: Mix.Dep.Lock.touch_manifest(), else: :ok
  end

  defp maybe_clean(app, opts) do
    if Keyword.get(opts, :force, false) do
      File.rm_rf!(Path.join([Mix.Project.build_path(), "lib", Atom.to_string(app)]))
    end
  end

