Skip to content

Commit 8f38ca9

Browse files
committed
Merge branch 'master' into fork
2 parents 4820d26 + a289147 commit 8f38ca9

15 files changed

+429
-195
lines changed

Gruntfile.js

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
var phpPaths = ['wpengine-phpcompat.php', 'src/*.php'];
2+
13
module.exports = function(grunt) {
2-
4+
35
grunt.initConfig({
46
wp_readme_to_markdown: {
57
options: {
@@ -12,18 +14,32 @@ module.exports = function(grunt) {
1214
},
1315
},
1416
},
17+
phplint: {
18+
plugin: phpPaths
19+
},
20+
phpcs: {
21+
plugin: {
22+
src: phpPaths
23+
},
24+
options: {
25+
bin: 'vendor/bin/phpcs',
26+
standard: 'src/ruleset-wordpress.xml'
27+
}
28+
}
1529
});
16-
30+
1731
grunt.loadNpmTasks('grunt-wp-readme-to-markdown');
18-
19-
grunt.registerTask('default', [
20-
'wp_readme_to_markdown'
21-
]);
32+
grunt.loadNpmTasks('grunt-phplint');
33+
grunt.loadNpmTasks('grunt-phpcs');
34+
35+
grunt.registerTask('default', ['phplint', 'phpcs']);
36+
37+
grunt.registerTask('readme', ['wp_readme_to_markdown']);
2238
};
2339

2440
// Add build status image to GitHub readme.
2541
function addBuildStatus(readme) {
2642
var buildImage = '<a href="https://travis-ci.org/wpengine/phpcompat"><img src="https://travis-ci.org/wpengine/phpcompat.svg?branch=master"></a>';
27-
43+
2844
return readme.replace(/# PHP Compatibility Checker #/, '# PHP Compatibility Checker ' + buildImage);
2945
}

composer.json

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,24 @@
66
"name": "Jason Stallings",
77
"email": "[email protected]"
88
}],
9-
"require": {
10-
"squizlabs/php_codesniffer": "2.*",
9+
"require": {
10+
"squizlabs/php_codesniffer": "2.6.*",
1111
"wimg/php-compatibility": "dev-master",
1212
"simplyadmire/composer-plugins" : "@dev"
13-
},
14-
"autoload": {
15-
"classmap": ["src/wpephpcompat.php"]
13+
},
14+
"require-dev": {
15+
"wp-coding-standards/wpcs": "dev-master",
16+
"neronmoon/scriptsdev": "^0.1.0"
17+
},
18+
"autoload": {
19+
"classmap": ["src/wpephpcompat.php"]
1620
},
1721
"scripts": {
18-
"post-update-cmd": "rm -rf vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PHPCompatibility; cp -rp vendor/wimg/php-compatibility vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PHPCompatibility",
19-
"post-install-cmd": "rm -rf vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PHPCompatibility; cp -rp vendor/wimg/php-compatibility vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PHPCompatibility"
20-
}
22+
"post-update-cmd": "vendor/bin/phpcs --config-delete installed_paths; rm -rf vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PHPCompatibility; cp -rp vendor/wimg/php-compatibility vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PHPCompatibility",
23+
"post-install-cmd": "vendor/bin/phpcs --config-delete installed_paths; rm -rf vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PHPCompatibility; cp -rp vendor/wimg/php-compatibility vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PHPCompatibility"
24+
},
25+
"scripts-dev": {
26+
"post-update-cmd": "vendor/bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs/;",
27+
"post-install-cmd": "vendor/bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs/;"
28+
}
2129
}

composer.lock

Lines changed: 102 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
"devDependencies": {
44
"grunt": "^0.4.5",
55
"grunt-wp-readme-to-markdown": "^2.0.0",
6-
"node-qunit-phantomjs": "^1.4.0"
6+
"node-qunit-phantomjs": "^1.4.0",
7+
"grunt-phpcs": "^0.4.0",
8+
"grunt-phplint": "0.0.8"
79
},
810
"scripts": {
9-
"test": "node-qunit-phantomjs tests/qunit/index.html --verbose"
11+
"test": "npm run test:lint && npm run test:qunit",
12+
"test:qunit": "node-qunit-phantomjs tests/qunit/index.html --verbose",
13+
"test:lint": "grunt",
14+
"readme": "grunt readme"
1015
}
1116
}

0 commit comments

Comments
 (0)