ronantakizawa/codereview-bench huggingface dataset:
Repository: tauri-apps/tauri
File: packages/api/src/window.ts (TypeScript)

Code before:
  async setVisibleOnAllWorkspaces(visible: boolean): Promise<void> {
    return invoke('plugin:window|set_visible_on_all_workspaces', {
      label: this.label,
      value: visible
    })
  }

  /**
   * Sets the title bar style. **macOS only**.
   *
   * @since 2.0.0
   */
  async setTitleBarStyle(style: TitleBarStyle): Promise<void> {
    return invoke('plugin:window|set_title_bar_style', {
      label: this.label,
      value: style
    })
  }

  /**
   * Set window theme, pass in `null` or `undefined` to follow system theme
   *
   * ### Platform-specific
   *
   * - **Linux / macOS**: Theme is app-wide and not specific to this window.
   * - **iOS / Android:** Unsupported.
   */
  async setTheme(theme?: Theme | null): Promise<void> {
    return invoke('plugin:window|set_theme', {
      label: this.label,
      value: theme
    })
  }

  // Listeners

  /**
   * Listen to window resize.
   *
   * @example
   * ```typescript
   * import { getCurrentWindow } from "@tauri-apps/api/window";
   * const unlisten = await getCurrentWindow().onResized(({ payload: size }) => {
   *  console.log('Window resized', size);
   * });
   *
   * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted
   * unlisten();
   * ```
   *
   * @returns A promise resolving to a function to unlisten to the event.

Review comment (suggestion):
```suggestion
   * - **iOS / Android:** Unsupported.
   *
   * @since 2.0.0
```

Code after:
  async setVisibleOnAllWorkspaces(visible: boolean): Promise<void> {
    return invoke('plugin:window|set_visible_on_all_workspaces', {
      label: this.label,
      value: visible
    })
  }

  /**
   * Sets the title bar style. **macOS only**.
   *
   * @since 2.0.0
   */
  async setTitleBarStyle(style: TitleBarStyle): Promise<void> {
    return invoke('plugin:window|set_title_bar_style', {
      label: this.label,
      value: style
    })
  }

  /**
   * Set window theme, pass in `null` or `undefined` to follow system theme
   *
   * #### Platform-specific
   *
   * - **Linux / macOS**: Theme is app-wide and not specific to this window.
   * - **iOS / Android:** Unsupported.
   *
   * @since 2.0.0
   */
  async setTheme(theme?: Theme | null): Promise<void> {
    return invoke('plugin:window|set_theme', {
      label: this.label,
      value: theme
    })
  }

  // Listeners

  /**
   * Listen to window resize.
   *
   * @example
   * ```typescript
   * import { getCurrentWindow } from "@tauri-apps/api/window";
   * const unlisten = await getCurrentWindow().onResized(({ payload: size }) => {
   *  console.log('Window resized', size);
   * });
   *
   * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted
   * unlisten();
   * ```
Repository: tauri-apps/tauri
File: crates/tauri/src/window/mod.rs (Rust)

Code before:

  /// Sets the title bar style. **macOS only**.
  pub fn set_title_bar_style(&self, style: tauri_utils::TitleBarStyle) -> crate::Result<()> {
    self
      .window
      .dispatcher
      .set_title_bar_style(style)
      .map_err(Into::into)
  }

  /// Sets the theme for this window.
  ///
  /// ## Platform-specific
  ///
  /// - **Linux / macOS**: Theme is app-wide and not specific to this window.
  /// - **iOS / Android:** Unsupported.
  pub fn set_theme(&self, theme: Option<Theme>) -> crate::Result<()> {
    self
      .window
      .dispatcher
      .set_theme(theme)
      .map_err(Into::<crate::Error>::into)?;
    #[cfg(windows)]
    if let (Some(window_menu), Ok(hwnd)) = (&*self.menu_lock(), self.hwnd()) {
      let raw_hwnd = hwnd.0 as isize;
      let menu = window_menu.menu.clone();
      self.run_on_main_thread(move || {
        let _ = unsafe {
          menu.inner().set_theme_for_hwnd(
            raw_hwnd,
            theme
              .map(crate::menu::map_to_menu_theme)
              .unwrap_or(muda::MenuTheme::Auto),
          )
        };
      })?;
    };
    Ok(())
  }
}

/// Progress bar state.
#[cfg(desktop)]
#[cfg_attr(
  docsrs,
  doc(cfg(any(target_os = "macos", target_os = "linux", windows)))
)]
#[derive(serde::Deserialize)]
pub struct ProgressBarState {
  /// The progress bar status.
  pub status: Option<ProgressBarStatus>,

Review comment (suggestion):
instead of holding the `menu_lock` here for the rest of the scope, we can just clone and release the lock
```suggestion
    let window_menu = self.menu_lock().clone();
    if let (Some(menu), Ok(hwnd)) = (window_menu, self.hwnd()) {
      let raw_hwnd = hwnd.0 as isize;
```

Code after:

  /// Sets the title bar style. **macOS only**.
  pub fn set_title_bar_style(&self, style: tauri_utils::TitleBarStyle) -> crate::Result<()> {
    self
      .window
      .dispatcher
      .set_title_bar_style(style)
      .map_err(Into::into)
  }

  /// Sets the theme for this window.
  ///
  /// ## Platform-specific
  ///
  /// - **Linux / macOS**: Theme is app-wide and not specific to this window.
  /// - **iOS / Android:** Unsupported.
  pub fn set_theme(&self, theme: Option<Theme>) -> crate::Result<()> {
    self
      .window
      .dispatcher
      .set_theme(theme)
      .map_err(Into::<crate::Error>::into)?;
    #[cfg(windows)]
    if let (Some(menu), Ok(hwnd)) = (self.menu(), self.hwnd()) {
      let raw_hwnd = hwnd.0 as isize;
      self.run_on_main_thread(move || {
        let _ = unsafe {
          menu.inner().set_theme_for_hwnd(
            raw_hwnd,
            theme
              .map(crate::menu::map_to_menu_theme)
              .unwrap_or(muda::MenuTheme::Auto),
          )
        };
      })?;
    };
    Ok(())
  }
}

/// Progress bar state.
#[cfg(desktop)]
#[cfg_attr(
  docsrs,
  doc(cfg(any(target_os = "macos", target_os = "linux", windows)))
)]
#[derive(serde::Deserialize)]
pub struct ProgressBarState {
  /// The progress bar status.
  pub status: Option<ProgressBarStatus>,
  /// The progress bar progress. This can be a value ranging from `0` to `100`
Repository: tauri-apps/tauri
File: core/tauri-runtime-wry/src/lib.rs (Rust)

Code before:
  // Setters
  Center,
  RequestUserAttention(Option<UserAttentionTypeWrapper>),
  SetResizable(bool),
  SetMaximizable(bool),
  SetMinimizable(bool),
  SetClosable(bool),
  SetTitle(String),
  Maximize,
  Unmaximize,
  Minimize,
  Unminimize,
  Show,
  Hide,
  Close,
  Destroy,
  SetDecorations(bool),
  SetShadow(bool),
  SetAlwaysOnBottom(bool),
  SetAlwaysOnTop(bool),
  SetVisibleOnAllWorkspaces(bool),
  SetContentProtected(bool),
  SetSize(Size),
  SetMinSize(Option<Size>),
  SetMaxSize(Option<Size>),
  SetSizConstraints(WindowSizeConstraints),
  SetPosition(Position),
  SetFullscreen(bool),
  SetFocus,
  SetIcon(TaoWindowIcon),
  SetSkipTaskbar(bool),
  SetCursorGrab(bool),
  SetCursorVisible(bool),
  SetCursorIcon(CursorIcon),
  SetCursorPosition(Position),
  SetIgnoreCursorEvents(bool),
  SetProgressBar(ProgressBarState),
  SetTitleBarStyle(tauri_utils::TitleBarStyle),
  DragWindow,
  ResizeDragWindow(tauri_runtime::ResizeDirection),
  RequestRedraw,
}

#[derive(Debug, Clone)]
pub enum SynthesizedWindowEvent {
  Focused(bool),
  DragDrop(DragDropEvent),
}

impl From<SynthesizedWindowEvent> for WindowEventWrapper {
  fn from(event: SynthesizedWindowEvent) -> Self {

Review comment (suggestion):
```suggestion
  SetSizeConstraints(WindowSizeConstraints),
```

Code after:
  // Setters
  Center,
  RequestUserAttention(Option<UserAttentionTypeWrapper>),
  SetResizable(bool),
  SetMaximizable(bool),
  SetMinimizable(bool),
  SetClosable(bool),
  SetTitle(String),
  Maximize,
  Unmaximize,
  Minimize,
  Unminimize,
  Show,
  Hide,
  Close,
  Destroy,
  SetDecorations(bool),
  SetShadow(bool),
  SetAlwaysOnBottom(bool),
  SetAlwaysOnTop(bool),
  SetVisibleOnAllWorkspaces(bool),
  SetContentProtected(bool),
  SetSize(Size),
  SetMinSize(Option<Size>),
  SetMaxSize(Option<Size>),
  SetSizeConstraints(WindowSizeConstraints),
  SetPosition(Position),
  SetFullscreen(bool),
  SetFocus,
  SetIcon(TaoWindowIcon),
  SetSkipTaskbar(bool),
  SetCursorGrab(bool),
  SetCursorVisible(bool),
  SetCursorIcon(CursorIcon),
  SetCursorPosition(Position),
  SetIgnoreCursorEvents(bool),
  SetProgressBar(ProgressBarState),
  SetTitleBarStyle(tauri_utils::TitleBarStyle),
  DragWindow,
  ResizeDragWindow(tauri_runtime::ResizeDirection),
  RequestRedraw,
}

#[derive(Debug, Clone)]
pub enum SynthesizedWindowEvent {
  Focused(bool),
  DragDrop(DragDropEvent),
}

impl From<SynthesizedWindowEvent> for WindowEventWrapper {
  fn from(event: SynthesizedWindowEvent) -> Self {
Repository: tauri-apps/tauri
File: tooling/api/src/window.ts (TypeScript)

Code before:
      throw new Error(
        'the `size` argument must be either a LogicalSize or a PhysicalSize instance'
      )
    }

    let value = null as Record<string, unknown> | null
    if (size) {
      value = {}
      value[`${size.type}`] = {
        width: size.width,
        height: size.height
      }
    }

    return invoke('plugin:window|set_max_size', {
      label: this.label,
      value
    })
  }

  /**
   * Sets the window inner size constraints.
   * @example
   * ```typescript
   * import { getCurrent, PhysicalSize } from '@tauri-apps/api/window';
   * await getCurrent().setSizeConstraints(new PhysicalSize(600, 500));
   * ```
   *
   * @param size The logical or physical inner size, or `null` to unset the constraint.
   * @returns A promise indicating the success or failure of the operation.
   */
  async setSizeConstraints(
    constraints: WindowSizeConstraints | null | undefined
  ): Promise<void> {
    function logical(pixel?: number): { Logical: number } | null {
      return pixel ? { Logical: pixel } : null
    }

    return invoke('plugin:window|set_size_constraints', {
      label: this.label,
      value: {
        minWidth: logical(constraints?.minWidth),
        minHeight: logical(constraints?.minHeight),
        maxWidth: logical(constraints?.maxWidth),
        maxHeight: logical(constraints?.maxHeight)
      }
    })
  }

  /**
   * Sets the window outer position.

Review comment (suggestion):
```suggestion
   * import { getCurrentWindow } from '@tauri-apps/api/window';
   * await getCurrentWindow().setSizeConstraints({ minWidth: 300 });
```

Code after:
      throw new Error(
        'the `size` argument must be either a LogicalSize or a PhysicalSize instance'
      )
    }

    let value = null as Record<string, unknown> | null
    if (size) {
      value = {}
      value[`${size.type}`] = {
        width: size.width,
        height: size.height
      }
    }

    return invoke('plugin:window|set_max_size', {
      label: this.label,
      value
    })
  }

  /**
   * Sets the window inner size constraints.
   * @example
   * ```typescript
   * import { getCurrentWindow } from '@tauri-apps/api/window';
   * await getCurrentWindow().setSizeConstraints({ minWidth: 300 });
   * ```
   *
   * @param size The logical or physical inner size, or `null` to unset the constraint.
   * @returns A promise indicating the success or failure of the operation.
   */
  async setSizeConstraints(
    constraints: WindowSizeConstraints | null | undefined
  ): Promise<void> {
    function logical(pixel?: number): { Logical: number } | null {
      return pixel ? { Logical: pixel } : null
    }

    return invoke('plugin:window|set_size_constraints', {
      label: this.label,
      value: {
        minWidth: logical(constraints?.minWidth),
        minHeight: logical(constraints?.minHeight),
        maxWidth: logical(constraints?.maxWidth),
        maxHeight: logical(constraints?.maxHeight)
      }
    })
  }

  /**
   * Sets the window outer position.
Repository: tauri-apps/tauri
File: tooling/cli/src/add.rs (Rust)

Code before:
  }

  // rust-only
  #[allow(clippy::single_element_loop)]
  for p in ["localhost", "persisted-scope", "single-instance"] {
    plugins.entry(p).or_default().rust_only = true;
  }

  plugins
}

#[derive(Debug, Parser)]
#[clap(about = "Add a tauri plugin to the project")]
pub struct Options {
  /// The plugin to add.
  pub plugin: String,
  /// Git tag to use.
  #[clap(short, long)]
  pub tag: Option<String>,
  /// Git rev to use.
  #[clap(short, long)]
  pub rev: Option<String>,
  /// Git branch to use.
  #[clap(short, long)]
  pub branch: Option<String>,
  /// Don't reformat code with rustfmt
  #[clap(long)]
  pub no_reformatting: bool,
}

pub fn command(options: Options) -> Result<()> {
  let (plugin, version) = options
    .plugin
    .split_once('@')
    .map(|(p, v)| (p, Some(v)))
    .unwrap_or((&options.plugin, None));

  let plugin_snake_case = plugin.replace('-', "_");
  let crate_name = format!("tauri-plugin-{plugin}");
  let npm_name = format!("@tauri-apps/plugin-{plugin}");

  let mut plugins = plugins();
  let metadata = plugins.remove(plugin).unwrap_or_default();

  let tauri_dir = tauri_dir();

  let target_str = metadata
    .desktop_only
    .then_some(r#"cfg(not(any(target_os = "android", target_os = "ios")))"#)
    .or_else(|| {
      metadata

Review comment (suggestion):
```suggestion
  /// Don't format code with rustfmt
```

Code after:
  }

  // rust-only
  #[allow(clippy::single_element_loop)]
  for p in ["localhost", "persisted-scope", "single-instance"] {
    plugins.entry(p).or_default().rust_only = true;
  }

  plugins
}

#[derive(Debug, Parser)]
#[clap(about = "Add a tauri plugin to the project")]
pub struct Options {
  /// The plugin to add.
  pub plugin: String,
  /// Git tag to use.
  #[clap(short, long)]
  pub tag: Option<String>,
  /// Git rev to use.
  #[clap(short, long)]
  pub rev: Option<String>,
  /// Git branch to use.
  #[clap(short, long)]
  pub branch: Option<String>,
  /// Don't format code with rustfmt
  #[clap(long)]
  pub no_fmt: bool,
}

pub fn command(options: Options) -> Result<()> {
  let (plugin, version) = options
    .plugin
    .split_once('@')
    .map(|(p, v)| (p, Some(v)))
    .unwrap_or((&options.plugin, None));

  let plugin_snake_case = plugin.replace('-', "_");
  let crate_name = format!("tauri-plugin-{plugin}");
  let npm_name = format!("@tauri-apps/plugin-{plugin}");

  let mut plugins = plugins();
  let metadata = plugins.remove(plugin).unwrap_or_default();

  let tauri_dir = tauri_dir();

  let target_str = metadata
    .desktop_only
    .then_some(r#"cfg(not(any(target_os = "android", target_os = "ios")))"#)
    .or_else(|| {
      metadata
Repository: tauri-apps/tauri
File: tooling/cli/src/init.rs (Rust)

Code before:
      prompts::input(
        "What is the url of your dev server?",
        init_defaults.framework.map(|f| f.dev_url()),
        self.ci,
        true,
      )
    })?;

    let package_manager =
      if self.before_build_command.is_none() && self.before_dev_command.is_none() {
        prompts::select(
          "What package manager are you using?",
          &["npm", "pnpm", "yarn", "bun"],
          Some(0),
        )?
        .unwrap()
      } else {
        "npm".to_string()
      };

    self.before_dev_command =
      self
        .before_dev_command
        .map(Some)
        .unwrap_or(match package_manager.as_str() {
          "npm" => Some("npm run dev".to_string()),
          "pnpm" => Some("pnpm dev".to_string()),
          "yarn" => Some("yarn dev".to_string()),
          "bun" => Some("bun dev".to_string()),
          _ => unreachable!(),
        });

    self.before_build_command =
      self
        .before_build_command
        .map(Some)
        .unwrap_or(match package_manager.as_str() {
          "npm" => Some("npm run build".to_string()),
          "pnpm" => Some("pnpm build".to_string()),
          "yarn" => Some("yarn build".to_string()),
          "bun" => Some("bun build".to_string()),
          _ => unreachable!(),
        });

    Ok(self)
  }
}

pub fn command(mut options: Options) -> Result<()> {
  options = options.load()?;


Review comment (suggestion):
using `dev` and `build` as defaults isn't desired.. some frontends use `start` instead of `dev` and if you have a monorepo you might have a `frontend:dev` script instead...

Code after:
    self.dev_url = self.dev_url.map(|s| Ok(Some(s))).unwrap_or_else(|| {
      prompts::input(
        "What is the url of your dev server?",
        init_defaults.framework.map(|f| f.dev_url()),
        self.ci,
        true,
      )
    })?;

    let detected_package_manager = match PackageManager::from_project(&self.directory).first() {
      Some(&package_manager) => package_manager,
      None => PackageManager::Npm,
    };

    self.before_dev_command = self
      .before_dev_command
      .map(|s| Ok(Some(s)))
      .unwrap_or_else(|| {
        prompts::input(
          "What is your frontend dev command?",
          Some(default_dev_command(detected_package_manager).into()),
          self.ci,
          true,
        )
      })?;

    self.before_build_command = self
      .before_build_command
      .map(|s| Ok(Some(s)))
      .unwrap_or_else(|| {
        prompts::input(
          "What is your frontend build command?",
          Some(default_build_command(detected_package_manager).into()),
          self.ci,
          true,
        )
      })?;

    Ok(self)
  }
}

fn default_dev_command(pm: PackageManager) -> &'static str {
  match pm {
    PackageManager::Yarn => "yarn dev",
    PackageManager::YarnBerry => "yarn dev",
    PackageManager::Npm => "npm run dev",
    PackageManager::Pnpm => "pnpm dev",
    PackageManager::Bun => "bun dev",
  }
}
Repository: tauri-apps/tauri
File: core/tauri-utils/src/io.rs (Rust)

Code before:
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

//! IO helpers.

use std::{fs::read_to_string, io::BufRead, path::Path};

/// Write to the given file if the content is different.
pub fn write_if_changed(content: &str, path: &Path) -> std::io::Result<()> {
  if content != read_to_string(path).unwrap_or_default() {
    std::fs::write(path, content)
  } else {
    Ok(())
  }
}

/// Read all bytes until a newline (the `0xA` byte) or a carriage return (`\r`) is reached, and append them to the provided buffer.
///
/// Adapted from <https://doc.rust-lang.org/std/io/trait.BufRead.html#method.read_line>.
pub fn read_line<R: BufRead + ?Sized>(r: &mut R, buf: &mut Vec<u8>) -> std::io::Result<usize> {
  let mut read = 0;
  loop {
    let (done, used) = {
      let available = match r.fill_buf() {
        Ok(n) => n,
        Err(ref e) if e.kind() == std::io::ErrorKind::Interrupted => continue,

        Err(e) => return Err(e),
      };
      match memchr::memchr(b'\n', available) {
        Some(i) => {
          let end = i + 1;
          buf.extend_from_slice(&available[..end]);
          (true, end)
        }

Review comment (suggestion):
This does a probably unexpected thing if `content == ""`. In that case the file is not created if it doesn’t already exist (due to the `or_default`).
I think the solution from https://github.com/tauri-apps/wry/pull/1342 is better
```rust
if read_to_string(path).map_or(true, |c| c != content) {
  // …
}
```

Code after:
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

//! IO helpers.

use std::io::BufRead;

/// Read all bytes until a newline (the `0xA` byte) or a carriage return (`\r`) is reached, and append them to the provided buffer.
///
/// Adapted from <https://doc.rust-lang.org/std/io/trait.BufRead.html#method.read_line>.
pub fn read_line<R: BufRead + ?Sized>(r: &mut R, buf: &mut Vec<u8>) -> std::io::Result<usize> {
  let mut read = 0;
  loop {
    let (done, used) = {
      let available = match r.fill_buf() {
        Ok(n) => n,
        Err(ref e) if e.kind() == std::io::ErrorKind::Interrupted => continue,

        Err(e) => return Err(e),
      };
      match memchr::memchr(b'\n', available) {
        Some(i) => {
          let end = i + 1;
          buf.extend_from_slice(&available[..end]);
          (true, end)
        }
        None => match memchr::memchr(b'\r', available) {
          Some(i) => {
            let end = i + 1;
            buf.extend_from_slice(&available[..end]);
            (true, end)
          }
          None => {
            buf.extend_from_slice(available);
            (false, available.len())
Repository: tauri-apps/tauri
File: tooling/cli/src/mobile/mod.rs (Rust)

Code before:
      }
    }
  }

  if !project_outdated_reasons.is_empty() {
    let reason = project_outdated_reasons.join(" and ");
    bail!(
        "{} project directory is outdated because {reason}. Please run `tauri {} init` and try again.",
        target.ide_name(),
        target.command_name(),
      )
  }

  Ok(())
}

#[cfg(unix)]
fn ensure_gradlew(project_dir: &std::path::Path) -> Result<()> {
  use std::os::unix::fs::PermissionsExt;

  let gradlew_path = project_dir.join("gradlew");
  if let Ok(metadata) = gradlew_path.metadata() {
    let mut permissions = metadata.permissions();
    let is_executable = permissions.mode() & 0o111 != 0;
    if !is_executable {
      permissions.set_mode(0o755);
      std::fs::set_permissions(&gradlew_path, permissions)
        .context("failed to change gradlew permissions")?;
    }
    std::fs::write(
      &gradlew_path,
      std::fs::read_to_string(&gradlew_path)
        .context("failed to read gradlew")?
        .replace("\r\n", "\n"),
    )
    .context("failed to replace gradlew CRLF with LF")?;
  }

  Ok(())
}

fn log_finished(outputs: Vec<PathBuf>, kind: &str) {
  if !outputs.is_empty() {
    let mut printable_paths = String::new();
    for path in &outputs {
      writeln!(printable_paths, "        {}", path.display()).unwrap();
    }

    log::info!(action = "Finished"; "{} {}{} at:\n{}", outputs.len(), kind, if outputs.len() == 1 { "" } else { "s" }, printable_paths);
  }
}

Review comment (security):
should we preserve previous permissions and only add `0o111` for execution bit? instead of always setting `0o755`

Code after:
      }
    }
  }

  if !project_outdated_reasons.is_empty() {
    let reason = project_outdated_reasons.join(" and ");
    bail!(
        "{} project directory is outdated because {reason}. Please run `tauri {} init` and try again.",
        target.ide_name(),
        target.command_name(),
      )
  }

  Ok(())
}

#[cfg(unix)]
fn ensure_gradlew(project_dir: &std::path::Path) -> Result<()> {
  use std::os::unix::fs::PermissionsExt;

  let gradlew_path = project_dir.join("gradlew");
  if let Ok(metadata) = gradlew_path.metadata() {
    let mut permissions = metadata.permissions();
    let is_executable = permissions.mode() & 0o111 != 0;
    if !is_executable {
      permissions.set_mode(permissions.mode() | 0o111);
      std::fs::set_permissions(&gradlew_path, permissions)
        .context("failed to mark gradlew as executable")?;
    }
    std::fs::write(
      &gradlew_path,
      std::fs::read_to_string(&gradlew_path)
        .context("failed to read gradlew")?
        .replace("\r\n", "\n"),
    )
    .context("failed to replace gradlew CRLF with LF")?;
  }

  Ok(())
}

fn log_finished(outputs: Vec<PathBuf>, kind: &str) {
  if !outputs.is_empty() {
    let mut printable_paths = String::new();
    for path in &outputs {
      writeln!(printable_paths, "        {}", path.display()).unwrap();
    }

    log::info!(action = "Finished"; "{} {}{} at:\n{}", outputs.len(), kind, if outputs.len() == 1 { "" } else { "s" }, printable_paths);
  }
}