Skip to content

Commit

Permalink
Merge branch '2.15' into 2.16
Browse files Browse the repository at this point in the history
* 2.15:
  OrderedImportsFixer - fix for trailing comma in group
  BlankLineBeforeStatementFixer - handle comment case
  Fix: MethodArgumentSpaceFixer must run after MethodChainingIndentationFixer
  DX: Check trailing spaces in project files only
  Trim path
  YodaStyleFixer - handling equals empty array
  Increase PHPStan level to 8 with strict rules
  DX: ensure PhpUnitNamespacedFixer handles all classes
  • Loading branch information
SpacePossum committed May 23, 2020
2 parents 7d4bfbf + 1367857 commit d4f90fd
Show file tree
Hide file tree
Showing 19 changed files with 14,758 additions and 95 deletions.
12 changes: 3 additions & 9 deletions check_trailing_spaces.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,16 @@
set -eu

files_with_trailing_spaces=$(
find . \
-type f \
-not -path "./.git/*" \
-not -path "./dev-tools/bin/*" \
-not -path "./dev-tools/vendor/*" \
-not -path "./vendor/*" \
-not -path "./tests/Fixtures/*" \
-exec grep -EIHn "\\s$" {} \; \
git grep -EIn "\\s$" \
':!tests/Fixtures/*' \
| sort -fh
)

if [ "$files_with_trailing_spaces" ]
then
printf '\033[97;41mTrailing whitespaces detected:\033[0m\n'
e=$(printf '\033')
echo "${files_with_trailing_spaces}" | sed -E "s/^\\.\\/([^:]+):([0-9]+):(.*[^\\t ])?([\\t ]+)$/${e}[0;31m - in ${e}[0;33m\\1${e}[0;31m at line ${e}[0;33m\\2\\n ${e}[0;31m>${e}[0m \\3${e}[41;1m\\4${e}[0m/"
echo "${files_with_trailing_spaces}" | sed -E "s/^([^:]+):([0-9]+):(.*[^\\t ])?([\\t ]+)$/${e}[0;31m - in ${e}[0;33m\\1${e}[0;31m at line ${e}[0;33m\\2\\n ${e}[0;31m>${e}[0m \\3${e}[41;1m\\4${e}[0m/"

exit 3
fi
Expand Down
3 changes: 2 additions & 1 deletion dev-tools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"mi-schi/phpmd-extension": "^4.3",
"phpmd/phpmd": "^2.6",
"phpstan/phpstan": "0.12.18",
"phpstan/phpstan-phpunit": "^0.12"
"phpstan/phpstan-phpunit": "^0.12",
"phpstan/phpstan-strict-rules": "^0.12"
},
"conflict": {
"hhvm": "*"
Expand Down
Loading

0 comments on commit d4f90fd

Please sign in to comment.