Browse Source

Merge branch '2.2' into 2.11

# Conflicts:
#	tests/Smoke/CiIntegrationTest.php
Dariusz Ruminski 7 years ago
parent
commit
09eaff2007

+ 1 - 1
README.rst

@@ -1681,7 +1681,7 @@ Then, add the following command to your CI:
     $ IFS='
     $ '
     $ CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB "${COMMIT_RANGE}")
-    $ if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php_cs(\\.dist)?|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); fi
+    $ if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php_cs(\\.dist)?|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi
     $ vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --dry-run --stop-on-violation --using-cache=no ${EXTRA_ARGS}
 
 Where ``$COMMIT_RANGE`` is your range of commits, eg ``$TRAVIS_COMMIT_RANGE`` or ``HEAD~..HEAD``.

+ 5 - 1
benchmark.sh

@@ -1,10 +1,14 @@
 #!/bin/sh
+set -eu
 
 command -v php >/dev/null 2>&1 || { echo "I require \`php\` but it's not available. Aborting." >&2; exit 255; }
 command -v grep >/dev/null 2>&1 || { echo "I require \`grep\` but it's not available. Aborting." >&2; exit 255; }
 command -v awk >/dev/null 2>&1 || { echo "I require \`awk\` but it's not available. Aborting." >&2; exit 255; }
 
-if [ "" = "$1" ] || [ "" = "$2" ];
+BRANCH1=${1:-''}
+BRANCH2=${2:-''}
+
+if [ "" = "$BRANCH1" ] || [ "" = "$BRANCH2" ];
 then
     echo "Usage: bash benchmark.sh BRANCH1 BRANCH2 ...BRANCHN"
     exit 1;

+ 1 - 0
check_trailing_spaces.sh

@@ -1,4 +1,5 @@
 #!/bin/sh
+set -eu
 
 files_with_trailing_spaces=$(
     find . \

+ 1 - 1
dev-tools/build.sh

@@ -1,5 +1,5 @@
 #!/bin/sh
-set -e
+set -eu
 
 # ensure that deps will work on lowest supported PHP version
 composer config platform.php 2> /dev/null || composer config platform.php 5.6.0

+ 2 - 2
dev-tools/ci-integration.sh

@@ -1,8 +1,8 @@
 #!/bin/sh
-set -e
+set -eu
 
 IFS='
 '
 CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB "${COMMIT_RANGE}")
-if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php_cs(\\.dist)?|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); fi
+if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php_cs(\\.dist)?|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi
 vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --dry-run --stop-on-violation --using-cache=no ${EXTRA_ARGS}

+ 2 - 2
dev-tools/trigger-website.sh

@@ -1,8 +1,8 @@
 #!/bin/sh
-set -e
+set -eu
 
 TOKEN=$1
-MSG_SUFFIX=$2
+MSG_SUFFIX=${2:-''}
 
 if [ ! -z "$MSG_SUFFIX" ]
 then

+ 1 - 4
tests/Smoke/CiIntegrationTest.php

@@ -254,9 +254,6 @@ If you need help while solving warnings, ask at https://gitter.im/PHP-CS-Fixer,
 
     private static function executeScript(array $scriptParts)
     {
-        // @TODO: drop $scriptInit, for now it's needed, as defaut `set -eu` is causing our scripts to crash
-        $scriptInit = ['#!/bin/sh', 'set -e', ''];
-
-        return ScriptExecutor::create($scriptParts, self::$fixtureDir, $scriptInit)->getResult();
+        return ScriptExecutor::create($scriptParts, self::$fixtureDir)->getResult();
     }
 }