Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
This commit is contained in:
parent
8aa00a8908
commit
d6db92d323
3 changed files with 41 additions and 7 deletions
|
|
@ -132,11 +132,17 @@ repos:
|
|||
entry: ./dev/tools/fixaltlanguages_pre-commit.sh
|
||||
pass_filenames: true
|
||||
- id: php-stan
|
||||
name: Run local PHP Stan
|
||||
name: Run local PHPStan
|
||||
language: script
|
||||
entry: ./dev/tools/phpstan/allow_phpstan_in_precommit.sh
|
||||
pass_filenames: true
|
||||
stages: [pre-commit]
|
||||
- id: phan
|
||||
name: Run local Phan
|
||||
language: script
|
||||
entry: ./dev/tools/phan/allow_phan_in_precommit.sh
|
||||
pass_filenames: true
|
||||
stages: [pre-commit]
|
||||
|
||||
# Check PHP syntax
|
||||
- repo: https://github.com/mdeweerd/pre-commit-php
|
||||
|
|
|
|||
23
dev/tools/phan/allow_phan_in_precommit.sh
Executable file
23
dev/tools/phan/allow_phan_in_precommit.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
# Wrapper to run 'Phan' from pre-commit hook
|
||||
# This is very slow so not enabled by default
|
||||
# To enable it, create a file ~/.run-phan
|
||||
# To disable it, remove this file ~/.run-phan
|
||||
|
||||
|
||||
echo "Running Phan on files ~/vendor/bin/phan $@"
|
||||
|
||||
# Test presence of file
|
||||
if [ ! -f ~/.run-phan ]; then
|
||||
echo "Skipping Phan (file ~/.run-phan missing)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -f ~/vendor/bin/phan ]; then
|
||||
echo "Skipping Phan (file ~/vendor/bin/phpan missing)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
~/vendor/bin/phan $@
|
||||
|
||||
exit $?
|
||||
|
|
@ -1,17 +1,22 @@
|
|||
#!/bin/bash
|
||||
# Wrapper to run 'PHPStan' from pre-commit hook
|
||||
# This is very slow so not enabled by default
|
||||
# To enable it, create a file ~/.run-phpstan
|
||||
# To disable it, remove this file ~/.run-phpstan
|
||||
|
||||
echo "Running PHPStan on files ~/vendor/bin/phpstan --level=9 -v analyze -a dev/build/phpstan/bootstrap.php $@"
|
||||
|
||||
# Test presence of file
|
||||
if [ ! -f ".run-phpstan" ]; then
|
||||
echo "Skipping PHPStan (file .run-phpstan missing)"
|
||||
if [ ! -f ~/.run-phpstan ]; then
|
||||
echo "Skipping PHPStan (file ~/.run-phpstan missing)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -f "~/vendor/bin/phpstan" ]; then
|
||||
if [ ! -f ~/vendor/bin/phpstan ]; then
|
||||
echo "Skipping PHPStan (file ~/vendor/bin/phpstan missing)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Running PHPStan"
|
||||
~/vendor/bin/phpstan analyz e
|
||||
~/vendor/bin/phpstan --level=9 -v analyze -a dev/build/phpstan/bootstrap.php $@
|
||||
|
||||
exit 1;
|
||||
exit $?
|
||||
|
|
|
|||
Loading…
Reference in a new issue