Commit 700f413c authored by Ines WALLON's avatar Ines WALLON
Browse files

add phpcs rules and fix xdebug config

parent 17ad1035
Pipeline #670 failed with stages
in 28 minutes and 9 seconds
......@@ -107,8 +107,8 @@ docker-stop:
@echo "${BLUE}Stopping all containers:${NC}"
@docker-compose down -v
test:
@docker-compose exec web bash ${WORK_DIR}/scripts/test-coding-standard.sh "$(filter-out $@,$(MAKECMDGOALS))"
quality-phpcs:
@docker-compose exec web bash ${WORK_DIR}/scripts/test-phpcs.sh "$(filter-out $@,$(MAKECMDGOALS))"
@make resetOwner
logs:
......
......@@ -8,7 +8,7 @@ PHPCS:
tags:
- spud
script:
- phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md web/modules/contrib_project/ --report-junit=./phpcs.xml
- phpcs --standard=./scripts/quality/phpcs.xml.dist --report-junit=./phpcs.xml web/modules/contrib_project/
artifacts:
when: always
reports:
......@@ -30,11 +30,7 @@ PHPCPD:
tags:
- spud
script:
- phpcpd web/modules/contrib_project/ --log-pmd phpcpd.xml
artifacts:
when: always
reports:
junit: phpcpd.xml
- phpcpd web/modules/contrib_project/
rules:
- if: $CI_COMMIT_BRANCH == "contrib_modules"
......
......@@ -12,9 +12,17 @@ ADMIN_PASSWORD=admin
ADMIN_MAIL=admin@exemple.com
SITE_NAME=Drupal
#Xdebug
XDEBUG_ENABLED=false
CUSTOM_PHP_XDEBUG_CLIENT_HOST=172.17.0.1
CUSTOM_PHP_XDEBUG_CLIENT_PORT=9001
CUSTOM_PHP_XDEBUG_IDEKEY=PHPSTORM
CUSTOM_PHP_XDEBUG_MAX_NESTING_LEVEL=500
CUSTOM_PHP_XDEBUG_MODE=debug
CUSTOM_PHP_XDEBUG_START_WITH_REQUEST=yes
# ENVIRONEMENT=prod
ENVIRONEMENT=dev
WORK_DIR=/project
# Shell colors.
......
......@@ -16,9 +16,9 @@ post_max_size = 80M
upload_max_filesize = 80M
; Xdebug.
xdebug.max_nesting_level = 500
xdebug.remote_autostart = On
xdebug.remote_connect_back = On
xdebug.remote_enable = On
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM
xdebug.client_host = ${CUSTOM_PHP_XDEBUG_CLIENT_HOST}
xdebug.client_port = ${CUSTOM_PHP_XDEBUG_CLIENT_PORT}
xdebug.idekey = ${CUSTOM_PHP_XDEBUG_IDEKEY}
xdebug.max_nesting_level = ${CUSTOM_PHP_XDEBUG_MAX_NESTING_LEVEL}
xdebug.mode = ${CUSTOM_PHP_XDEBUG_MODE}
xdebug.start_with_request = ${CUSTOM_PHP_XDEBUG_START_WITH_REQUEST}
xdebug.remote_enable=1
xdebug.idekey=PHPSTORM
xdebug.profiler_enable=0
xdebug.max_nesting_level=700
xdebug.remote_host=192.168.10.10 # your ip
xdebug.remote_port=9000
<?xml version="1.0"?>
<ruleset name="project">
<description>Scan custom code.</description>
<arg name="basepath" value="."/>
<arg name="colors"/>
<arg name="extensions" value="css,inc,info,install,md,module,php,profile,test,theme,txt,yml"/>
<!-- Official extensions. -->
<!-- <arg name="extensions" value="inc,install,module,php,profile,test,theme,yml"/>-->
<arg name="parallel" value="75"/>
<arg value="p"/>
<!-- Ignore various version control directories. -->
<exclude-pattern>*/\.git/*</exclude-pattern>
<exclude-pattern>*/\.svn/*</exclude-pattern>
<exclude-pattern>*/\.hg/*</exclude-pattern>
<exclude-pattern>*/\.bzr/*</exclude-pattern>
<!-- Drupal coding standards. -->
<rule ref="Drupal"/>
<rule ref="DrupalPractice"/>
<rule ref="Generic.PHP.RequireStrictTypes"/>
<rule ref="Squiz.PHP.Eval"/>
</ruleset>
......@@ -10,13 +10,9 @@ if [ -n "$1" ]; then
else
CHECK_DIR=$WORK_DIR/web/modules/custom
fi
echo -e "${GREEN}[info] Enter $CHECK_DIR directory ${NC}"
echo -e "${YELLOW}[notice] Check deprecated function${NC}"
drupal-check $CHECK_DIR
echo -e "${YELLOW}[notice] Run phpcs${NC}"
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md $CHECK_DIR
phpcs --standard=$WORK_DIR/scripts/quality/phpcs.xml.dist $CHECK_DIR
if [ $? -eq 0 ]; then
echo -e "\n${GREEN} [OK] No errors${NC}\n"
fi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment