Skip to content

Commit b4899d3

Browse files
committed
Travis: add a check against false positives
This adds an additional check to the Travis build. PR 2 added `exclude`s to the various rulesets to prevent false positives being generated when the ruleset would be run against the code of the polyfills themselves. As the polyfills may, of course, be updated over time, we need to ensure that these excludes are still sufficient. This adds a `dev` dependency on the actual polyfills and a check to Travis to make sure that if the ruleset is run over the polyfill code, no errors are thrown. **Note**: this check may start failing without notice because of changes in the polyfills, but that's exactly what this check is guarding against and will prevent us from releasing a version which doesn't have the right excludes in place. In addition to this, an automatic weekly/monthly Travis run on `master` should be turned on to make sure this check is run on a semi-regular basis. _For now, I've turned an automatic monthly check on_ Additionally: * I've also merged the duplicate `cache` key in the Travis script. * And the integration tests now run against an open-ended `testVersion`.
1 parent eb35a0c commit b4899d3

2 files changed

Lines changed: 25 additions & 11 deletions

File tree

.travis.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ sudo: false
22

33
dist: trusty
44

5-
cache:
6-
apt: true
7-
85
language: php
96

107
## Cache composer downloads.
118
cache:
9+
apt: true
1210
directories:
1311
- $HOME/.cache/composer/files
1412

@@ -47,13 +45,22 @@ script:
4745
fi
4846
4947
# Test the rulesets.
50-
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP54Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP54 --runtime-set testVersion 5.3
51-
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP55Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP55 --runtime-set testVersion 5.3
52-
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP56Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP56 --runtime-set testVersion 5.3
53-
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP70Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP70 --runtime-set testVersion 5.3
54-
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP71Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP71 --runtime-set testVersion 5.3
55-
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP72Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP72 --runtime-set testVersion 5.3
56-
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP73Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP73 --runtime-set testVersion 5.3
48+
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP54Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP54 --runtime-set testVersion 5.3-
49+
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP55Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP55 --runtime-set testVersion 5.3-
50+
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP56Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP56 --runtime-set testVersion 5.3-
51+
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP70Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP70 --runtime-set testVersion 5.3-
52+
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP71Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP71 --runtime-set testVersion 5.3-
53+
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP72Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP72 --runtime-set testVersion 5.3-
54+
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP73Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP73 --runtime-set testVersion 5.3-
55+
56+
# Check that the ruleset does not throw unnecessary errors for the compat library itself.
57+
- vendor/bin/phpcs ./vendor/symfony/polyfill-php54/ --standard=PHPCompatibilitySymfonyPolyfillPHP54 --runtime-set testVersion 5.3-
58+
- vendor/bin/phpcs ./vendor/symfony/polyfill-php55/ --standard=PHPCompatibilitySymfonyPolyfillPHP55 --runtime-set testVersion 5.3-
59+
- vendor/bin/phpcs ./vendor/symfony/polyfill-php56/ ./vendor/symfony/polyfill-util/ --standard=PHPCompatibilitySymfonyPolyfillPHP56 --runtime-set testVersion 5.3- --ignore=*/polyfill-util/TestListener*
60+
- vendor/bin/phpcs ./vendor/symfony/polyfill-php70/ --standard=PHPCompatibilitySymfonyPolyfillPHP70 --runtime-set testVersion 5.3-
61+
- vendor/bin/phpcs ./vendor/symfony/polyfill-php71/ --standard=PHPCompatibilitySymfonyPolyfillPHP71 --runtime-set testVersion 5.3-
62+
- vendor/bin/phpcs ./vendor/symfony/polyfill-php72/ --standard=PHPCompatibilitySymfonyPolyfillPHP72 --runtime-set testVersion 5.3-
63+
- vendor/bin/phpcs ./vendor/symfony/polyfill-php73/ --standard=PHPCompatibilitySymfonyPolyfillPHP73 --runtime-set testVersion 5.3-
5764

5865
# Validate the composer.json file.
5966
# @link https://getcomposer.org/doc/03-cli.md#validate

composer.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@
2323
"phpcompatibility/phpcompatibility-passwordcompat" : "^1.0"
2424
},
2525
"require-dev" : {
26-
"dealerdirect/phpcodesniffer-composer-installer": "^0.5"
26+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5",
27+
"symfony/polyfill-php54": "dev-master",
28+
"symfony/polyfill-php55": "dev-master",
29+
"symfony/polyfill-php56": "dev-master",
30+
"symfony/polyfill-php70": "dev-master",
31+
"symfony/polyfill-php71": "dev-master",
32+
"symfony/polyfill-php72": "dev-master",
33+
"symfony/polyfill-php73": "dev-master"
2734
},
2835
"suggest" : {
2936
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",

0 commit comments

Comments
 (0)