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

Don't auto clean .yml files. #2276

Closed
aj0strow opened this issue Dec 16, 2016 · 7 comments · Fixed by #4724
Closed

Don't auto clean .yml files. #2276

aj0strow opened this issue Dec 16, 2016 · 7 comments · Fixed by #4724

Comments

@aj0strow
Copy link

Do you want to request a feature or report a bug?

Bug.

What is the current behavior?

Related to #1051. Right now yarn clean produces a clean file that removes .yml files.

.*.yml
*.yml

What is the expected behavior?

It's too aggressive to auto delete config files. You wouldn't auto delete .toml or .json files, so also shouldn't auto delete .yml files.

It would be more appropriate to remove specific well known configs, like circle.yml etc.

Please mention your node.js, yarn and operating system version.

$ node -v
v5.6.0

$ yarn version
yarn version v0.17.10

$ m info
ProductName:	Mac OS X
ProductVersion:	10.11.6
BuildVersion:	15G1108
@lili21
Copy link

lili21 commented Apr 25, 2017

any update ?

@quirkyshop
Copy link

still get a problem when exec yarn clean, such as .svgo.yml problem reproduce everytime.

yarn version: v0.23.4

@tjormola
Copy link

+1

@MartinHaeusler
Copy link

This issue just bit me as well. I'm by no means an expert in this field, but why do you even bother to selectively delete/keep files? On yarn clean, I would expect something like

rm -rf node_modules
yarn install

... or similar.

@rally25rs
Copy link
Contributor

I'm actually curious what the use case is for even running yarn clean? The docs basically say "don't use this" so why even make the command available?

I can only venture to guess that the intent was to remove files that probably weren't needed for a production deployment to run, saving some HD space, but it doesn't seem like the clean command should ever be run under a development environment.

I would think a lot of issues could be avoided by just removing this command, or do what NPM5 did with cache clear and have it do nothing unless you pass a --force flag, preventing accidental running of the command.

@twothe
Copy link

twothe commented Aug 10, 2017

Just fell into the same trap. Why exactly is there a function that as a result will permanently destroy your build until you deactivate it?

@BYK
Copy link
Member

BYK commented Aug 10, 2017

It would be more appropriate to remove specific well known configs, like circle.yml etc.

+1 to this. PR's welcome everyone :D

@BYK BYK closed this as completed in #4724 Oct 17, 2017
BYK pushed a commit that referenced this issue Oct 17, 2017
…4724)

**Summary**

Remove entries to clean `*.yml` and `.*.yml` from the default filter list in `.yarnclean`. Instead, include configuration files from common CI and build tools.

- Travis CI
- CircleCI
- AppVeyor
- Codeship
- Wercker

Fixes #4281, fixes #2276.

**Test plan**

```shell
$ yarn autoclean --init
yarn autoclean v1.2.1
[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.15s.
$ grep yml .yarnclean 
appveyor.yml
circle.yml
codeship-services.yml
codeship-steps.yml
wercker.yml
.travis.yml
```
joaolucasl pushed a commit to joaolucasl/yarn that referenced this issue Oct 27, 2017
…arnpkg#4724)

**Summary**

Remove entries to clean `*.yml` and `.*.yml` from the default filter list in `.yarnclean`. Instead, include configuration files from common CI and build tools.

- Travis CI
- CircleCI
- AppVeyor
- Codeship
- Wercker

Fixes yarnpkg#4281, fixes yarnpkg#2276.

**Test plan**

```shell
$ yarn autoclean --init
yarn autoclean v1.2.1
[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.15s.
$ grep yml .yarnclean 
appveyor.yml
circle.yml
codeship-services.yml
codeship-steps.yml
wercker.yml
.travis.yml
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants