   @doc """
   Same as `rmdir/1`, but raises an exception in case of failure. Otherwise `:ok`.
   """
-  @spec rmdir!(Path.t) :: :ok | {:error, posix}
+  @spec rmdir!(Path.t()) :: :ok | {:error, posix}
   def rmdir!(path) do
     case rmdir(path) do
-      :ok -> :ok
-      {:error, reason} ->
-        raise File.Error, reason: reason, action: "remove directory",
+      :ok ->
+        :ok
+
+      {:error, reason} ->
+        raise File.Error,
+          reason: reason,
+          action: "remove directory",
           path: IO.chardata_to_string(path)
     end
   end

  @doc """
  Same as `chown/2`, but raises an exception in case of failure. Otherwise `:ok`.
  """
  @spec chown!(Path.t, non_neg_integer) :: :ok | no_return
  def chown!(path, uid) do
    case chown(path, uid) do
      :ok -> :ok
      {:error, reason} ->
        raise File.Error, reason: reason, action: "change owner for",
          path: IO.chardata_to_string(path)
    end
  end

  Raises an error if retrieving or changing the current
  directory fails.
  """
  @spec cd!(Path.t(), (() -> res)) :: res when res: var
  def cd!(path, function) do
    old = cwd!()
    cd!(path)

    try do
      function.()
    after
