From ea3939eafe60429d5d0366e5d2b7a210a4b92954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Mon, 6 Aug 2018 09:40:01 +0200 Subject: [PATCH] Do not exclude the license files (#269) Closes #266 --- box.json.dist | 1 - src/Configuration.php | 1 - tests/ConfigurationFileNoConfigTest.php | 4 +++- tests/Console/Command/CompileTest.php | 13 ++++++++----- tests/RequirementChecker/RequirementsDumperTest.php | 1 + 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/box.json.dist b/box.json.dist index 76de74cd2..aae5d34d3 100644 --- a/box.json.dist +++ b/box.json.dist @@ -12,7 +12,6 @@ ], "files": ["res/schema.json"], - "files-bin": ["vendor/composer/composer/LICENSE"], "directories-bin": [".requirement-checker"], "compression": "GZ", diff --git a/src/Configuration.php b/src/Configuration.php index b901f7bef..2ea5d031d 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -1157,7 +1157,6 @@ function (string $packagePath) use ($basePath): string { ->notName('*.md') ->notName('*.rst') ->notName('/^readme(\..*+)?$/i') - ->notName('/^license(\..*+)?$/i') ->notName('/^upgrade(\..*+)?$/i') ->notName('/^contributing(\..*+)?$/i') ->notName('/^changelog(\..*+)?$/i') diff --git a/tests/ConfigurationFileNoConfigTest.php b/tests/ConfigurationFileNoConfigTest.php index 417492294..a9e35ea70 100644 --- a/tests/ConfigurationFileNoConfigTest.php +++ b/tests/ConfigurationFileNoConfigTest.php @@ -363,7 +363,7 @@ public function test_the_blacklist_setting_is_applied_to_all_the_files_found_in_ public function test_it_ignores_the_most_common_non_needed_files_when_guess_the_files_from_the_composer_json_file(): void { // Depending on the test machine: the following command might be needed: - // docker run -i --rm -w /opt/box -v "$PWD":/opt/box box_php72 bin/phpunit tests/ConfigurationTest.php --filter test_it_ignores_the_most_common_non_needed_files_when_guess_the_files_from_the_composer_json_file + // docker run -i --rm -w /opt/box -v "$PWD":/opt/box box_php72 bin/phpunit tests/ConfigurationFileNoConfigTest.php --filter test_it_ignores_the_most_common_non_needed_files_when_guess_the_files_from_the_composer_json_file // Indeed OSX is case insensitive... touch('main.php~'); @@ -562,6 +562,8 @@ public function test_it_ignores_the_most_common_non_needed_files_when_guess_the_ 'composer.json', 'ConductCommand.php', 'ContributingCommand.php', + 'license', + 'LICENSE', 'LicenseCommand.php', 'LICENSE_GECKO', 'ReadmeCommand.php', diff --git a/tests/Console/Command/CompileTest.php b/tests/Console/Command/CompileTest.php index 13280cdb5..c85d9f30e 100644 --- a/tests/Console/Command/CompileTest.php +++ b/tests/Console/Command/CompileTest.php @@ -169,7 +169,7 @@ public function test_it_can_build_a_PHAR_file(): void ? Setting file permissions to 0755 * Done. - // PHAR: 44 files (100B) + // PHAR: 45 files (100B) // You can inspect the generated PHAR with the "info" command. // Memory usage: 5.00MB (peak: 10.00MB), time: 0.00s @@ -247,6 +247,7 @@ public function test_it_can_build_a_PHAR_file(): void '/.box/vendor/composer/autoload_static.php', '/.box/vendor/composer/installed.json', '/.box/vendor/composer/semver/', + '/.box/vendor/composer/semver/LICENSE', '/.box/vendor/composer/semver/src/', '/.box/vendor/composer/semver/src/Comparator.php', '/.box/vendor/composer/semver/src/Constraint/', @@ -376,7 +377,7 @@ public function test_it_can_build_a_PHAR_without_any_configuration(): void ? No compression * Done. - // PHAR: 48 files (100B) + // PHAR: 49 files (100B) // You can inspect the generated PHAR with the "info" command. // Memory usage: 5.00MB (peak: 10.00MB), time: 0.00s @@ -460,6 +461,7 @@ public function test_it_can_build_a_PHAR_without_any_configuration(): void '/.box/vendor/composer/autoload_static.php', '/.box/vendor/composer/installed.json', '/.box/vendor/composer/semver/', + '/.box/vendor/composer/semver/LICENSE', '/.box/vendor/composer/semver/src/', '/.box/vendor/composer/semver/src/Comparator.php', '/.box/vendor/composer/semver/src/Constraint/', @@ -823,7 +825,7 @@ public function test_it_can_build_a_PHAR_file_in_verbose_mode(): void ? Setting file permissions to 0755 * Done. - // PHAR: 44 files (100B) + // PHAR: 45 files (100B) // You can inspect the generated PHAR with the "info" command. // Memory usage: 5.00MB (peak: 10.00MB), time: 0.00s @@ -923,7 +925,7 @@ public function test_it_can_build_a_PHAR_file_in_very_verbose_mode(): void ? Setting file permissions to 0755 * Done. - // PHAR: 44 files (100B) + // PHAR: 45 files (100B) // You can inspect the generated PHAR with the "info" command. // Memory usage: 5.00MB (peak: 10.00MB), time: 0.00s @@ -1042,7 +1044,7 @@ public function test_it_can_build_a_PHAR_file_in_debug_mode(): void ? Setting file permissions to 0755 * Done. - // PHAR: 44 files (100B) + // PHAR: 45 files (100B) // You can inspect the generated PHAR with the "info" command. // Memory usage: 5.00MB (peak: 10.00MB), time: 0.00s @@ -1085,6 +1087,7 @@ public function test_it_can_build_a_PHAR_file_in_debug_mode(): void '.box_dump/.box/vendor/composer/ClassLoader.php', '.box_dump/.box/vendor/composer/installed.json', '.box_dump/.box/vendor/composer/LICENSE', + '.box_dump/.box/vendor/composer/semver/LICENSE', '.box_dump/.box/vendor/composer/semver/src/Comparator.php', '.box_dump/.box/vendor/composer/semver/src/Constraint/AbstractConstraint.php', '.box_dump/.box/vendor/composer/semver/src/Constraint/Constraint.php', diff --git a/tests/RequirementChecker/RequirementsDumperTest.php b/tests/RequirementChecker/RequirementsDumperTest.php index 7c04b9e72..0abfeba09 100644 --- a/tests/RequirementChecker/RequirementsDumperTest.php +++ b/tests/RequirementChecker/RequirementsDumperTest.php @@ -60,6 +60,7 @@ public function test_it_dumps_the_requirement_checker_files( 'vendor/composer/ClassLoader.php', 'vendor/composer/installed.json', 'vendor/composer/LICENSE', + 'vendor/composer/semver/LICENSE', 'vendor/composer/semver/src/Comparator.php', 'vendor/composer/semver/src/Constraint/AbstractConstraint.php', 'vendor/composer/semver/src/Constraint/Constraint.php',