]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Put more validations on travis
authorJeremy Benoist <jeremy.benoist@gmail.com>
Sun, 20 Mar 2016 20:10:17 +0000 (21:10 +0100)
committerJeremy Benoist <jbenoist@20minutes.fr>
Mon, 21 Mar 2016 09:00:41 +0000 (10:00 +0100)
Run php-cs-fixer to avoid CS on commits
Add a check on translation message using the built-in yaml validator. It'll avoid typo in translation yaml files.

.travis.yml
bin/php-cs-fixer [new symlink]
composer.json

index 5741b533a51aeb7d893c62c024daba1898f7b6ff..e2bf90cab5be8a83772a2d51c5a66d5dafe783e5 100644 (file)
@@ -11,6 +11,7 @@ addons:
 
 # cache vendor dirs
 cache:
+    apt: true
     directories:
         - vendor
         - $HOME/.composer/cache
@@ -28,6 +29,9 @@ env:
 
 matrix:
     fast_finish: true
+    include:
+        - php: 7.0
+          env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run DB=sqlite
     exclude:
         - php: hhvm
           env: DB=pgsql  # driver for PostgreSQL currently unsupported by HHVM, requires 3rd party dependency
@@ -53,3 +57,5 @@ script:
     - travis_wait composer install --no-interaction --no-progress --prefer-dist -o
     - ant prepare-$DB
     - bin/phpunit -v
+    - if [ "$CS_FIXER" = "run" ]; then php bin/php-cs-fixer fix src/ --verbose --dry-run ; fi;
+    - if [ "$VALIDATE_TRANSLATION_FILE" = "run" ]; then php bin/console lint:yaml src/Wallabag/CoreBundle/Resources/translations ; fi;
diff --git a/bin/php-cs-fixer b/bin/php-cs-fixer
new file mode 120000 (symlink)
index 0000000..902e8f5
--- /dev/null
@@ -0,0 +1 @@
+../vendor/fabpot/php-cs-fixer/php-cs-fixer
\ No newline at end of file
index a1a7ebb49654d152d80fc1dbce89d71d2db65319..1abf6f20b0eef9e2cc341655a6f0c76fb96ef036 100644 (file)
@@ -86,7 +86,8 @@
         "doctrine/doctrine-fixtures-bundle": "~2.2",
         "sensio/generator-bundle": "^3.0",
         "phpunit/phpunit": "~4.4",
-        "symfony/phpunit-bridge": "^2.7"
+        "symfony/phpunit-bridge": "^2.7",
+        "fabpot/php-cs-fixer": "~1.9"
     },
     "scripts": {
         "build-parameters": [