forked from wpengine/phpcompat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
49 lines (42 loc) · 1.08 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
var phpPaths = [
'wpengine-phpcompat.php',
'load-files.php',
'src/*.php',
];
module.exports = function(grunt) {
grunt.initConfig({
wp_readme_to_markdown: {
options: {
screenshot_url: 'assets/{screenshot}.png',
post_convert: addBuildStatus,
},
your_target: {
files: {
'readme.md': 'readme.txt'
},
},
},
phplint: {
plugin: phpPaths
},
phpcs: {
plugin: {
src: phpPaths
},
options: {
bin: 'vendor/bin/phpcs',
standard: 'src/ruleset-wordpress.xml'
}
}
});
grunt.loadNpmTasks('grunt-wp-readme-to-markdown');
grunt.loadNpmTasks('grunt-phplint');
grunt.loadNpmTasks('grunt-phpcs');
grunt.registerTask('default', ['phplint', 'phpcs']);
grunt.registerTask('readme', ['wp_readme_to_markdown']);
};
// Add build status image to GitHub readme.
function addBuildStatus(readme) {
var buildImage = '<a href="https://travis-ci.org/wpengine/phpcompat"><img src="https://travis-ci.org/wpengine/phpcompat.svg?branch=master"></a>';
return readme.replace(/# PHP Compatibility Checker #/, '# PHP Compatibility Checker ' + buildImage);
}