Skip to content

Commit

Permalink
scripts: Improve usage
Browse files Browse the repository at this point in the history
* Add fix script
* Split install-dependencies script for parity with other scripts
* Install PHP tools using Composer, running utils/install-phars.sh not necessary any more (We did not do that in the past to avoid clashes between our and their dependencies but this does not seem to be an issue at the moment.) Ideally, composer would fix that on their end: composer/composer#5390
* Use install-dependencies on CI as well
* COMPOSER_NO_INTERACTION is now set on CI, instead of manually passing it to every composer commands.
  • Loading branch information
jtojnar committed Nov 23, 2019
1 parent 07508c1 commit 8eae3f6
Show file tree
Hide file tree
Showing 7 changed files with 1,090 additions and 21 deletions.
10 changes: 4 additions & 6 deletions .travis.yml
Expand Up @@ -13,6 +13,8 @@ matrix:
- php: 5.6
env: DEPLOY=true
fast_finish: true
env:
- COMPOSER_NO_INTERACTION=1

addons:
apt:
Expand All @@ -26,16 +28,12 @@ cache:

before_install:
- nvm install 12
- npm install
- if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi
- utils/install-phars.sh

install:
- composer self-update

before_script:
install:
- phpenv config-rm xdebug.ini
- composer install --prefer-dist --no-interaction
- npm run install-dependencies

script:
- if [ "$LINT_JS" = true ]; then npm run lint:client; fi
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -75,7 +75,7 @@ We use [Parcel](https://parceljs.org/) (installed by the command above) to build

If you want to create a package with all the dependencies bundled, you can run `npm run dist` command to produce a zipball.

Every patch is expected to adhere to our coding style, which is checked automatically by Travis. You can install the checkers locally either with your package manager or by calling `utils/install-phars.sh`, and then run the checks using `npm run check` before submitting a pull request.
Every patch is expected to adhere to our coding style, which is checked automatically by Travis. You can install the checkers locally using `npm run install-dependencies`, and then run the checks using `npm run check` before submitting a pull request. There is also `npm run fix`, that will attempt to fix the formatting.

## Credits

Expand Down
7 changes: 6 additions & 1 deletion composer.json
Expand Up @@ -22,6 +22,11 @@
"willwashburn/phpamo": "^1.0",
"ext-gd": "*"
},
"require-dev": {
"jakub-onderka/php-console-highlighter": "^0.4.0",
"jakub-onderka/php-parallel-lint": "^1.0",
"friendsofphp/php-cs-fixer": "^2.15"
},
"license": "GPL-3.0",
"authors": [
{
Expand Down Expand Up @@ -51,6 +56,6 @@
"scripts": {
"cs": "php-cs-fixer fix --verbose --dry-run --diff",
"fix": "php-cs-fixer fix --verbose --diff",
"lint": "php-parallel-lint src"
"lint": "parallel-lint src"
}
}

0 comments on commit 8eae3f6

Please sign in to comment.