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

rename clean to autoclean, add tests #4252

Merged
merged 2 commits into from Aug 29, 2017

Conversation

Projects
2 participants
@rally25rs
Contributor

rally25rs commented Aug 25, 2017

Related PRs

Summary

PR for RFC: yarnpkg/rfcs#52

  • clean renamed to autoclean
  • autoclean prompts user to run with --init or --force
  • autoclean --init creates .yarnclean
  • autoclean --force runs clean using .yarnclean if it exists
  • autoclean --force prompts user to run autoclean --init to create .yarnclean if it does not exist.

Test plan

Previously no tests existed for the clean task. I created a test file for autoclean.

Output from this series of commands:

$yarn autoclean
yarn autoclean v1.0.0
info ".yarnclean" does not exist. Autoclean will delete files specified by ".yarnclean". Run "autoclean --init" to create ".yarnclean" with the default entries.
✨  Done in 0.06s.

$ yarn autoclean --init
yarn autoclean v1.0.0
[1/1] Creating ".yarnclean"...
info Created ".yarnclean". Please review the contents of this file then run "yarn autoclean --force" to perform a clean.
✨  Done in 0.06s.

$ yarn autoclean --init
yarn autoclean v1.0.0
info ".yarnclean" already exists. To revert to the default file, delete ".yarnclean" then rerun this command.
✨  Done in 0.06s.

$ yarn autoclean
yarn autoclean v1.0.0
info This command required the "--force" flag to perform the clean. This is a destructive operation. Files specified in ".yarnclean" will be deleted.
✨  Done in 0.06s.

$ yarn autoclean --force
yarn autoclean v1.0.0
[1/1] Cleaning modules...
info Removed 3 files
info Saved 0 MB.
✨  Done in 0.08s.

@rally25rs rally25rs requested a review from BYK Aug 25, 2017

@rally25rs rally25rs self-assigned this Aug 25, 2017

@rally25rs rally25rs referenced this pull request Aug 25, 2017

Merged

Rename yarn clean #52

@rally25rs rally25rs added this to Awaiting Review in Yarn 1.0 Aug 25, 2017

@BYK BYK requested a review from arcanis Aug 25, 2017

@arcanis arcanis merged commit 915e775 into yarnpkg:master Aug 29, 2017

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@cpojer cpojer moved this from Awaiting Review to Done in Yarn 1.0 Aug 29, 2017

joaolucasl added a commit to joaolucasl/yarn that referenced this pull request Oct 27, 2017

rename clean to autoclean, add tests (yarnpkg#4252)
* rename clean to autoclean, add tests

* fix tests. expect statements were not being run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment