Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some enhancements to cargo clean #12638

Merged
merged 9 commits into from
Sep 20, 2023
Merged

Commits on Sep 20, 2023

  1. Wrap clean operations in a CleanContext.

    This refactors some of the `cargo clean` code to wrap the "cleaning"
    operation in a `CleanContext` so that the context can be passed to other
    parts of cargo which can perform their own cleaning operations.
    
    There are some minor changes in the error messages to prepare for
    cleaning operations that aren't directly related to the build directory.
    ehuss committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    61e8ef3 View commit details
    Browse the repository at this point in the history
  2. Add a --dry-run option to cargo clean.

    This adds a `--dry-run` option to have `cargo clean` display what it
    would delete without actually deleting it.
    ehuss committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    45c5394 View commit details
    Browse the repository at this point in the history
  3. Add a summary to cargo clean.

    This adds a summary at the end when `cargo clean` finishes that displays
    how many files and bytes were removed.
    ehuss committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    495ed7e View commit details
    Browse the repository at this point in the history
  4. Use existing arg_dry_run function.

    And drop the `-n` short flag until we decide to commit to using it
    generally.
    ehuss committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    e7e354c View commit details
    Browse the repository at this point in the history
  5. Use Self type.

    ehuss committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    e9110aa View commit details
    Browse the repository at this point in the history
  6. Separately track files and directories removed.

    The previous status line was a little awkward in the way it combined
    both counts. I don't think showing the directories is particularly
    interesting, so they are only displayed when no files are deleted.
    ehuss committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    ebee726 View commit details
    Browse the repository at this point in the history
  7. Add a warning to cargo clean --dry-run

    This makes it more consistent with other `--dry-run` commands, and
    makes it clearer to the user that cargo did not do anything.
    ehuss committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    f61d42d View commit details
    Browse the repository at this point in the history
  8. Don't display paths with cargo clean --dry-run without --verbose

    The paths themselves aren't particularly interesting.
    ehuss committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    c204734 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    655f75d View commit details
    Browse the repository at this point in the history