This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Bundle/WebProfilerBundle
Fabien Potencier 5b531b6f76 feature #33579 Adding .gitattributes to remove Tests directory from "dist" (Nyholm)
This PR was merged into the 4.4 branch.

Discussion
----------

Adding .gitattributes to remove Tests directory from "dist"

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no?
| Tickets       |
| License       | MIT
| Doc PR        |

This is a controversial topic that have been mentioned before. We recently had some discussions on Slack about it and the community not in an agreement. This was asked back in 2014 already.

Im making this PR again, because I think this will help more people than it hurts to keep the tests in the "dist" version.

### Reasons for keeping the tests with the source

* You can look at the tests to understand how the code works
* It is convenient

In the past there were an argument of people might depend on Symfony's classes in Tests. That is no longer the case since we moved reusable classes from Tests to Test.

### Reasons for removing them (merging this PR)

* There should be difference between `composer update --prefer-source` and `composer update --prefer-dist`
* Smaller packages when deploying with Docker or on Serverless.
* Static analysis tools will not complain on PHP syntax errors in our tests ([example](https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/xml_with_wrong_ext.php))

## How to decide?

Merging this PR or not is tricky because no side has a solid technical argument. It is basically just personal preference. Please give this PR a 👍 or 👎 if you want to give your opinion.

## Other PRs and issues related to this:

Add .gitattributes file (https://github.com/symfony/symfony/pull/29277)
Added .gitattributes files to root and all components (https://github.com/symfony/symfony/pull/26472)
Exclude non-essential files from Composer package (https://github.com/symfony/symfony/issues/25414)
[HttpFoundation] optimize files for distribution (https://github.com/symfony/symfony/pull/24427)
Add .gitattributes files (https://github.com/symfony/symfony/pull/23926)
[Suggestion] Adding .gitattributes to ignore unnecessary folders and files for production env (https://github.com/symfony/symfony/issues/20057)
Add lightweight and root only .gitattributes (https://github.com/symfony/symfony/pull/18004)
Add .gitattributes to exclude tests from ZIPs (https://github.com/symfony/symfony/pull/17995)
[RFC] Move tests out of the source and source out of the tests (https://github.com/symfony/symfony/issues/17749)
Removal of development & testing files using .gitattributes (https://github.com/symfony/symfony/issues/16174)
Please add .gitattributes files and fix line endings (https://github.com/symfony/symfony/issues/13521)
making use of .gitattributes (https://github.com/symfony/symfony/issues/11810)

## Workarounds

There are workarounds for both sides. Example:

### Workaround if merged

* `composer update --prefer-source`

### Workaround if closed

* `find vendor/symfony -name "Tests" -type d -exec rm -r "{}" \;`
* https://github.com/editorconfig/editorconfig/issues/228
* https://github.com/dg/composer-cleaner

Commits
-------

ac7dc24bcb Adding .gitattributes to remove Tests directory from "dist"
2019-09-16 10:15:34 +02:00
..
Controller Remove superfluous phpdoc tags 2019-08-14 13:59:53 +02:00
Csp Add return types to internal|final|private methods 2019-08-20 17:32:53 +02:00
DependencyInjection Merge branch '4.3' into 4.4 2019-08-26 11:00:56 +02:00
EventListener Ensure $request->hasSession() is always checked before calling getSession() 2019-07-28 18:57:16 +02:00
Profiler Merge branch '3.4' into 4.3 2019-08-14 14:26:46 +02:00
Resources Merge branch '4.3' into 4.4 2019-09-15 10:41:08 +02:00
Tests Add return types to tests and final|internal|private methods 2019-08-21 17:14:41 +02:00
Twig Import return annotations from vendors 2019-08-14 15:27:41 +02:00
.gitattributes Adding .gitattributes to remove Tests directory from "dist" 2019-09-16 10:12:51 +02:00
.gitignore Added missing files .gitignore 2013-07-21 14:12:18 +02:00
CHANGELOG.md [HttpClient] Added TraceableHttpClient and WebProfiler panel 2019-08-23 19:16:53 +02:00
composer.json Decoupling TwigBundle and using the new ErrorRenderer mechanism 2019-07-23 20:05:48 -04:00
LICENSE update year in license files 2019-01-01 14:45:19 +01:00
phpunit.xml.dist Bump phpunit XSD version to 5.2 2018-11-11 12:18:13 +01:00
README.md [WebProfilerBundle] added a note in the README 2018-09-24 10:42:32 +02:00
WebProfilerBundle.php made it clear that the profiler is for dev only 2018-09-24 10:00:32 +02:00

WebProfilerBundle

The Web profiler bundle is a development tool that gives detailed information about the execution of any request.

Never enable it on production servers as it will lead to major security vulnerabilities in your project.

Resources