Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ines
Drupal9 skeleton
Commits
700f413c
Commit
700f413c
authored
Feb 08, 2021
by
Ines WALLON
Browse files
add phpcs rules and fix xdebug config
parent
17ad1035
Pipeline
#670
failed with stages
in 28 minutes and 9 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
700f413c
...
...
@@ -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
:
...
...
config/.gitlab/code_quality_default.yml
View file @
700f413c
...
...
@@ -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"
...
...
config/.init_files/exemple.env
View file @
700f413c
...
...
@@ -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.
...
...
config/php/php.ini
View file @
700f413c
...
...
@@ -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}
config/php/xdebug.ini
deleted
100644 → 0
View file @
17ad1035
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
scripts/quality/phpcs.xml.dist
0 → 100644
View file @
700f413c
<?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>
scripts/test-
coding-standard
.sh
→
scripts/test-
phpcs
.sh
View file @
700f413c
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment