Skip to content

[Gulp] Continuous Integration (CI)

Crisoforo Gaspar Hernández edited this page Oct 27, 2015 · 2 revisions

For CI we have validation for PHP and JS files, for PHP we follow the code standard from WordPress and for the JS we follow the standard from airbnb.

This will allow you to integrate your project with travis to have consistent code across the project.

ci

This tasks execute js:ci and php:ci (more information about this tasks below) in order to validate the code standard from php and JS. if there is an error this tasks will exit the gulp tasks with exit code of 1 this maybe useful for travis.

Usage

gulp ci

php:ci

This task will run the validation of the code standard in the specified in the array phpFiles, this array of files can be modified in the gulpfile.js in order to exclude or add more files.

Will validate agains the rules from the PHPSniffer to see if the code matches the rules from WP Standard for PHP. It will exit with code 1 and generate an error in the gulp execution.

Usage

gulp php:ci

js:ci

This task will run the validation of the code standard in the specified in the array jsFiles this array of files, can be modified in the gulpfile.js in order to exclude or add more files.

Will validate agains the rules from the .jshintrc and .jscsrc to see if the code matches the rules from airbnb for the JS files. It will exit with code 1 and generate an error in the gulp execution.

Usage

gulp js:ci

This task depend in another two tasks:

js:hint-ci

Will validate agains the rules from the .jshintrc to see if the code matches the rules from airbnb for the JS files. It will exit with code 1 and generate an error in the gulp execution.

Usage

gulp js:hint-ci

js:cs-ci

Will validate agains the rules from the .jscsrc to see if the code matches the rules from airbnb for the JS files. It will exit with code 1 and generate an error in the gulp execution.

Usage

gulp js:hint-ci