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 .gitattributes to project to prevent exporting test sources, artifacts, as well as PHARs committed to the repository #153

Closed
Ocramius opened this issue Apr 22, 2020 · 4 comments

Comments

@Ocramius
Copy link
Contributor

Summary

Noticed this because bin/phpdoc.phar is committed to the repo, but in general applies to all sources that aren't vital (or legally necessary, such as LICENSE) downstream: they should not be part of the release distribution.

Steps to reproduce

composer require jordanbrauer/unit-converter --prefer-dist
ls vendor/jordanbrauer/unit-converter # lists `/bin`

What is the expected correct behavior?

bin, as well as tests, .vscode, .github, .circleci, etc. should not be in the vendor path when installing a distribution release.

Possible fixes

See for example https://github.com/Ocramius/ProxyManager/blob/2.8.0/.gitattributes: adding such a file to a new minor release would solve the immediate pain 👍

@jordanbrauer
Copy link
Owner

Awesome! Thanks for the heads up @Ocramius – I will get on that later today after work, unless you happen to send an MR in before that. 🙂

@Ocramius
Copy link
Contributor Author

Would've sent patch, but did report this from my phone :-)

Under release crunch myself too, heh...

@jordanbrauer
Copy link
Owner

This has been taken care of. New output after applying the patch (or upgrading from 0.8.3 to 0.8.4) shows that there are no more useless artifacts in the distributed package!

tree -L 1 vendor/jordanbrauer/unit-converter

will output

vendor/jordanbrauer/unit-converter
├── CHANGELOG.md
├── LICENSE
├── README.md
├── SECURITY.md
├── composer.json
└── src

1 directory, 5 files

@Ocramius
Copy link
Contributor Author

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants