Commit Graph

23 Commits

Author SHA1 Message Date
David A. Kennedy 72e34ef6bc
Merge pull request #1267 from jrfnl/feature/cs-update
Bring code style up to the latest standards
- This PR addresses code-style issues identified when testing the code against the WordPress Coding Standards.
2018-03-02 18:45:51 -05:00
jrfnl c453749f7a 🔧 PHPCS: don't ignore warnings, don't list scanned files
The `-n` flag will ignore warnings completely, while often it is useful to see them and to fix them.

Using `--runtime-set ignore_warnings_on_exit 1` in the Travis script instead, warnings will be shown, both when a developer runs PHPCS on their own machine, as well as in Travis, but warnings will not cause a failed Travis build.

The `-v` flag will list each file being scanned. This is intended for debugging purposes and not needed for normal use.
2018-02-27 14:34:50 +01:00
jrfnl a0d2892cad 🔧 Travis: update the versions used by the various PHPCS libaries
As WPCS and PHPCompatibility were for a little while (May - July 2017) not compatible with PHPCS 3.x, the library tags cloned were previously fixed to prevent issues with that.

As both WPCS as well as the PHPCompatibility standard are now compatible with PHPCS 3.x, the changes made in PR 1110 and PR 1183 can be reverted.

Notes:
* PHPCS - use `master`.
    WPCS uses a limited set of sniffs from PHPCS itself.
    Most of these sniffs are long established, stable and rarely get updated, so using PHPCS `master` should be safe.
* WPCS - use the latest release `0.14.0`.
    WPCS is the main source of CS violations and is under active development. This means that new versions of WPCS will easily break the build, so should be managed.
* PHPCompatibility - use `master`.
    PHPCompatibility checks PHP cross-version compatibility.
    It is actively developed and heavily unit tested, so any new violations found in `_s` because of changes in that library, should actually be addressed in `_s` ASAP.

    The PHPCompatibility library became compatible with PHPCS 3.x and improved compatibility with Composer installs in version `8.0.0` which was a breaking change.
    To account for that, the location where the library is cloned to and the `phpcs --installed_paths` command have been updated.
    Ref: https://github.com/wimg/PHPCompatibility/pull/446
2018-02-27 14:34:49 +01:00
jrfnl 6a0e5b8df1 Travis: stop build testing against HHVM, test against nightly
At some point in time, PHP was lagging behind and HHVM seemed like the future. What with PHP 7 being released and doing incredibly well, that time has passed and the popularity of HHVM is now marginal.

This commit drops testing against HHVM and starts testing against bleeding edge PHP nightly instead.
2018-02-27 09:34:14 +01:00
jrfnl 90e08bd964 Travis: speed up build times by disabling Xdebug
Xdebug is only **needed** when creating code coverage reports. Otherwise, it's just a nice extra, but a slow extra.
Disabling it will speed up the build times.

As suggested by John Blackbourn in https://johnblackbourn.com/reducing-travis-ci-build-times-for-wordpress-projects/

With an additional improvement to stabilize the command as suggested by Niklas Keller in  https://twitter.com/kelunik/status/954242454676475904
2018-02-27 09:33:27 +01:00
Bappi e4665250dd Change links http:// to https://
All necessary links checked and updated to https, some remain as http as those aren't using secured protocol yet
2017-10-10 23:29:36 +06:00
jrfnl 420b44af22 Travis: build against highest available PHP version
The new Trusty images as per Sept 7 include an image for PHP 7.2 (even though it hasn't been released yet).

The `_s` build tests are run against the lowest/highest supported PHP version for 5 and 7.
As `7.2` is now available, it should replace the `7.1` build.
2017-09-13 20:47:58 +02:00
Ulrich Pogson 4e69e3ffe1 Use Ubuntu Trusty by default and Precise for PHP 5.2
Starting July 18th 2017, Travis will begin switching the default image to trusty, which does not support PHP 5.2 or 5.3.

https://blog.travis-ci.com/2017-07-11-trusty-as-default-linux-is-coming
2017-07-18 23:40:25 +02:00
Ulrich Pogson 8eb93e96cf Clone specific PHPCS rulesets 2017-07-17 20:26:51 +02:00
jrfnl b78d053772 PHPCS: Move the recommended command line arguments into the custom ruleset. 2017-06-12 00:21:34 +02:00
jrfnl 0d353e1c0c Rename the PHPCS ruleset.
If the file is called `phpcs.xml` or `phpcs.xml.dist`, it is automatically picked up by PHPCS.

A `phpcs.xml` is given preference over a `phpcs.xml.dist` file. So renaming the file to `phpcs.xml.dist` allows for people to use the file provided by `_s` if they choose not to add their own, but also leaves people the freedom to easily overrule it.
2017-06-12 00:11:53 +02:00
David A. Kennedy 521b475f3b Switch versions of PHP Code Sniffer for build process
* Switches to 2.9 branch to avoid failed builds for now.

See: https://github.com/Automattic/_s/issues/1067#issuecomment-307258832

See #1079
2017-06-09 12:03:55 -04:00
jrfnl ccaa222ba4 Minor automated testing tweaks.
* Add PHP 7.1 to the travis test matrix as it will be released soon.
* Set `testVersion` for PHPCompatibility so we receive the messages for the right PHP versions.
2016-08-25 23:24:57 +02:00
jrfnl 91d536d49c Only get the jshint file when needed. 2015-12-26 05:00:11 +01:00
jrfnl e1f4b0add4 Updated based on feedback.
* Include skip-link-focus-fix.js in the js hint/lint tests & fix up the file.
* Pull in .jshintrc from WP SVN.
* Add PHPCompatibility Sniffs.
* Sync the ignore statements to always exclude .min.js files.
* Slim down the tested against PHP versions even more.
2015-12-15 10:09:54 +01:00
jrfnl b8d776c59c Slim down the travis script, add js checks and fix js errors thrown up.
What it will now do:
- Lint the php files against relevant PHP versions.
- Lint the js files once - the result won't change across PHP versions.
- Check against WPCS once - the result won't change across PHP versions.

What I have changed:
- Added linting against PHP 7 and HHVM, with HHVM being allowed to fail.
- Added js linting and style check per example from Twenty Sixteen.
- Moved to the faster container based environment for running travis.
- Script will no longer pull in PHPCS, WPCS and the JS linters in every build. Now they will only be pulled in when needed.
- Limited the clone depth for quicker cloning of external repositories.
- Removed the pulling in of WP and running builds against different WP versions as this wasn't used at all in the actual test scripts.
2015-12-13 15:03:43 +01:00
Philip Arthur Moore e4571763ec Update Travis CI Build Matrix now that WordPress 4.2 has been released. 2015-04-29 08:27:50 +07:00
Cor van Noorloos 084794098c update travis.yml
In short this updates `travis.yml`'s indent size to 2 spaces as per
WordPress' development repo and Jetpack.
Inserts final newline.
Uses a period at the end of each sentence.
2015-01-23 23:55:02 +01:00
Philip Arthur Moore e5e31d472c Update WP versions that are being used in Travis checks. [skip ci] 2015-01-06 10:45:45 +07:00
Philip Arthur Moore b443161ed6 Better build config for Travis CI. [skip ci] 2014-11-01 07:45:39 +07:00
yoarts b1af13868b Rewording "plugin" to "theme" 2014-08-20 14:31:45 +07:00
Philip Arthur Moore f8b66133ed Prepare Underscores for Coding Standards. See https://github.com/Automattic/_s/issues/553. [skip ci] 2014-08-18 00:12:38 +07:00
Philip Arthur Moore 895b7a93ab Prepare Underscores for Coding Standards. See https://github.com/Automattic/_s/issues/553. 2014-08-17 23:40:13 +07:00