Skip to content

Commit

Permalink
Support for JSON Linting (#6)
Browse files Browse the repository at this point in the history
* Fix Composer script 'phplint'

Fixed:
- Syntax for multiple starting points
- Match only regular PHP files

* Add Composer script 'jsonlint'

For linting metadata files.

Added:
- Composer package 'seld/jsonlint'
- Composer script 'jsonlint'

Changed:
- Execute 'jsonlint' in Travis
  • Loading branch information
mcaskill authored and mducharme committed Jul 24, 2019
1 parent c6a59a3 commit c4aa6aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ install:
- mkdir -p build/logs/

script:
- composer jsonlint
- composer phplint
- composer phpcs
- composer phpunit -- --coverage-clover "build/logs/clover.xml"
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"phpunit/phpunit": "^5.7 || ^6.5",
"squizlabs/php_codesniffer": "^3.0",
"php-coveralls/php-coveralls": "^2.0",
"seld/jsonlint": "^1.7",
"cache/void-adapter": "^0.3.1",
"tedivm/stash": "~0.14",
"pimple/pimple": "^3.0"
Expand All @@ -47,10 +48,12 @@
"@tests"
],
"tests": [
"@jsonlint",
"@phplint",
"@phpcs",
"@phpunit"
],
"jsonlint": "find metadata tests -type f -name '*.json' -print0 | xargs -0 -n1 -P8 vendor/bin/jsonlint | grep -v '^Valid JSON'; test $? -eq 1",
"phplint": "find src tests -type f -name '*.php' -print0 | xargs -0 -n1 -P8 php -l | grep -v '^No syntax errors detected'; test $? -eq 1",
"phpcs": "php vendor/bin/phpcs -ps --colors src/ tests/",
"phpcbf": "php vendor/bin/phpcbf -ps --colors src/ tests/",
Expand Down

0 comments on commit c4aa6aa

Please sign in to comment.