Skip to content

Commit 221a794

Browse files
authored
Merge pull request #261 from wpengine/ryanmeier/feature/npm-security-updates
NPM Security Updates
2 parents d5fb08b + 665ef11 commit 221a794

File tree

8 files changed

+28
-87
lines changed

8 files changed

+28
-87
lines changed

.phplint.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
path: ./
2+
jobs: 10
3+
cache: build/phplint.cache
4+
extensions:
5+
- php
6+
exclude:
7+
- vendor

.travis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ matrix:
2929
- php: 7.3
3030
env: WP_VERSION=5.2 WP_MULTISITE=1
3131
- php: 7.3
32-
env: WP_VERSION=latest WP_MULTISITE=1
32+
env: WP_VERSION=latest WP_MULTISITE=1 PHPCS=1
3333
- php: 7.3
3434
env: NPM_TESTS=1
3535
exclude:
@@ -87,8 +87,13 @@ before_script:
8787
fi
8888
script:
8989
- |
90+
if [[ "$PHPCS" == "1" ]]; then
91+
composer phpcs
92+
fi
93+
9094
if [[ "$NPM_TESTS" == "1" ]]; then
9195
npm test
9296
else
97+
bash php-lint.sh
9398
phpunit
9499
fi

Gruntfile.js

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
var phpPaths = [
2-
'wpengine-phpcompat.php',
3-
'load-files.php',
4-
'src/*.php',
5-
];
6-
71
module.exports = function(grunt) {
8-
92
grunt.initConfig({
103
wp_readme_to_markdown: {
114
options: {
@@ -17,27 +10,12 @@ module.exports = function(grunt) {
1710
'readme.md': 'readme.txt'
1811
},
1912
},
20-
},
21-
phplint: {
22-
plugin: phpPaths
23-
},
24-
phpcs: {
25-
plugin: {
26-
src: phpPaths
27-
},
28-
options: {
29-
bin: 'vendor/bin/phpcs',
30-
standard: 'src/ruleset-wordpress.xml'
31-
}
3213
}
3314
});
3415

3516
grunt.loadNpmTasks('grunt-wp-readme-to-markdown');
36-
grunt.loadNpmTasks('grunt-phplint');
37-
grunt.loadNpmTasks('grunt-phpcs');
38-
39-
grunt.registerTask('default', ['phplint', 'phpcs']);
4017

18+
grunt.registerTask('default', []);
4119
grunt.registerTask('readme', ['wp_readme_to_markdown']);
4220
};
4321

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
],
2121
"post-install-cmd": [
2222
"cd php52; composer install; cd .."
23-
]
23+
],
24+
"phpcs": "phpcs --standard=src/ruleset-wordpress.xml wpengine-phpcompat.php load-files.php src/*.php",
25+
"phpcs:fix": "phpcbf --standard=src/ruleset-wordpress.xml wpengine-phpcompat.php load-files.php src/*.php"
2426
}
2527
}

composer.lock

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

package-lock.json

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

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@
33
"devDependencies": {
44
"grunt": "^0.4.5",
55
"grunt-cli": "^1.2.0",
6-
"grunt-phpcs": "^0.4.0",
7-
"grunt-phplint": "0.0.8",
86
"grunt-wp-readme-to-markdown": "^2.0.0",
97
"lodash": "4.17.13",
108
"minimatch": "3.0.2",
119
"node-qunit-phantomjs": "^1.4.0"
1210
},
1311
"scripts": {
14-
"test": "npm run test:lint && npm run test:qunit",
12+
"test": "npm run test:qunit",
1513
"test:qunit": "node-qunit-phantomjs tests/qunit/index.html --verbose",
16-
"test:lint": "grunt",
1714
"readme": "grunt readme"
1815
}
1916
}

php-lint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
find . -not \( -path ./vendor -prune \) -not \( -path ./php52 -prune \) -type f -name '*.php' -print0 | xargs -0 -n1 -P4 -I {} php -l -n {} | (! grep -v "No syntax errors detected" )

0 commit comments

Comments
 (0)