Skip to content

Commit e319f76

Browse files
authored
feat: add .editorconfig and fix indent of some files (#98)
1 parent 5ea2920 commit e319f76

File tree

3 files changed

+135
-59
lines changed

3 files changed

+135
-59
lines changed

.editorconfig

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
# Change these settings to your own preference
9+
indent_style = space
10+
indent_size = 4
11+
12+
# We recommend you to keep these unchanged
13+
end_of_line = lf
14+
charset = utf-8
15+
trim_trailing_whitespace = true
16+
insert_final_newline = true
17+
18+
[*.{js,html}]
19+
indent_style = space
20+
indent_size = 2
21+
22+
[*.json]
23+
indent_style = space
24+
indent_size = 2
25+
26+
[*.md]
27+
trim_trailing_whitespace = false
28+
29+
[*.php]
30+
indent_style = space
31+
indent_size = 4
32+
33+
[*.sh]
34+
indent_style = tab
35+
indent_size = 4
36+
37+
[*.{,.dist}]
38+
indent_style = space
39+
indent_size = 4
40+
41+
[*.{yaml,yml}]
42+
indent_style = space
43+
indent_size = 4
44+
trim_trailing_whitespace = false
45+
46+
[api/helm/api/**.yaml]
47+
indent_style = space
48+
indent_size = 2
49+
50+
[.github/workflows/*.yml]
51+
indent_style = space
52+
indent_size = 2
53+
54+
[.gitmodules]
55+
indent_style = tab
56+
indent_size = 4
57+
58+
[.php_cs{,.dist}]
59+
indent_style = space
60+
indent_size = 4
61+
62+
[.travis.yml]
63+
indent_style = space
64+
indent_size = 2
65+
66+
[composer.json]
67+
indent_style = space
68+
indent_size = 4
69+
70+
[docker-compose{,.*}.{yaml,yml}]
71+
indent_style = space
72+
indent_size = 2
73+
74+
[Dockerfile]
75+
indent_style = tab
76+
indent_size = 4

Dockerfile

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,42 @@ FROM php:${PHP_VERSION}-fpm-alpine AS symfony_php
1212

1313
# persistent / runtime deps
1414
RUN apk add --no-cache \
15-
acl \
16-
fcgi \
17-
file \
18-
gettext \
19-
git \
20-
jq \
21-
;
15+
acl \
16+
fcgi \
17+
file \
18+
gettext \
19+
git \
20+
jq \
21+
;
2222

2323
ARG APCU_VERSION=5.1.19
2424
RUN set -eux; \
2525
apk add --no-cache --virtual .build-deps \
26-
$PHPIZE_DEPS \
27-
icu-dev \
28-
libzip-dev \
29-
zlib-dev \
26+
$PHPIZE_DEPS \
27+
icu-dev \
28+
libzip-dev \
29+
zlib-dev \
3030
; \
3131
\
3232
docker-php-ext-configure zip; \
3333
docker-php-ext-install -j$(nproc) \
34-
intl \
35-
zip \
34+
intl \
35+
zip \
3636
; \
3737
pecl install \
38-
apcu-${APCU_VERSION} \
38+
apcu-${APCU_VERSION} \
3939
; \
4040
pecl clear-cache; \
4141
docker-php-ext-enable \
42-
apcu \
43-
opcache \
42+
apcu \
43+
opcache \
4444
; \
4545
\
4646
runDeps="$( \
47-
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
48-
| tr ',' '\n' \
49-
| sort -u \
50-
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
47+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
48+
| tr ',' '\n' \
49+
| sort -u \
50+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
5151
)"; \
5252
apk add --no-cache --virtual .phpexts-rundeps $runDeps; \
5353
\
@@ -109,9 +109,9 @@ CMD ["php-fpm"]
109109
FROM caddy:${CADDY_VERSION}-builder-alpine AS symfony_caddy_builder
110110

111111
RUN xcaddy build \
112-
--with github.com/dunglas/mercure@main \
113-
--with github.com/dunglas/mercure/caddy@main \
114-
--with github.com/dunglas/vulcain/caddy
112+
--with github.com/dunglas/mercure@main \
113+
--with github.com/dunglas/mercure/caddy@main \
114+
--with github.com/dunglas/vulcain/caddy
115115

116116
FROM caddy:${CADDY_VERSION} AS symfony_caddy
117117

docker/php/docker-entrypoint.sh

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,42 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
1313
fi
1414
ln -sf "$PHP_INI_RECOMMENDED" "$PHP_INI_DIR/php.ini"
1515

16-
mkdir -p var/cache var/log
17-
18-
# The first time volumes are mounted, the project needs to be recreated
19-
if [ ! -f composer.json ]; then
20-
composer create-project "symfony/skeleton $SYMFONY_VERSION" tmp --stability=$STABILITY --prefer-dist --no-progress --no-interaction
21-
jq '.extra.symfony.docker=true' tmp/composer.json > tmp/composer.tmp.json
22-
rm tmp/composer.json
23-
mv tmp/composer.tmp.json tmp/composer.json
24-
25-
cp -Rp tmp/. .
26-
rm -Rf tmp/
27-
elif [ "$APP_ENV" != 'prod' ]; then
28-
rm -f .env.local.php
29-
composer install --prefer-dist --no-progress --no-interaction
30-
fi
31-
32-
if grep -q DATABASE_URL= .env; then
33-
echo "Waiting for db to be ready..."
34-
ATTEMPTS_LEFT_TO_REACH_DATABASE=60
35-
until [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ] || bin/console doctrine:query:sql "SELECT 1" > /dev/null 2>&1; do
36-
sleep 1
37-
ATTEMPTS_LEFT_TO_REACH_DATABASE=$((ATTEMPTS_LEFT_TO_REACH_DATABASE-1))
38-
echo "Still waiting for db to be ready... Or maybe the db is not reachable. $ATTEMPTS_LEFT_TO_REACH_DATABASE attempts left"
39-
done
40-
41-
if [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ]; then
42-
echo "The db is not up or not reachable"
43-
exit 1
44-
else
45-
echo "The db is now ready and reachable"
46-
fi
47-
48-
if ls -A migrations/*.php > /dev/null 2>&1; then
49-
bin/console doctrine:migrations:migrate --no-interaction
50-
fi
51-
fi
16+
mkdir -p var/cache var/log
17+
18+
# The first time volumes are mounted, the project needs to be recreated
19+
if [ ! -f composer.json ]; then
20+
composer create-project "symfony/skeleton $SYMFONY_VERSION" tmp --stability=$STABILITY --prefer-dist --no-progress --no-interaction
21+
jq '.extra.symfony.docker=true' tmp/composer.json >tmp/composer.tmp.json
22+
rm tmp/composer.json
23+
mv tmp/composer.tmp.json tmp/composer.json
24+
25+
cp -Rp tmp/. .
26+
rm -Rf tmp/
27+
elif [ "$APP_ENV" != 'prod' ]; then
28+
rm -f .env.local.php
29+
composer install --prefer-dist --no-progress --no-interaction
30+
fi
31+
32+
if grep -q DATABASE_URL= .env; then
33+
echo "Waiting for db to be ready..."
34+
ATTEMPTS_LEFT_TO_REACH_DATABASE=60
35+
until [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ] || bin/console doctrine:query:sql "SELECT 1" >/dev/null 2>&1; do
36+
sleep 1
37+
ATTEMPTS_LEFT_TO_REACH_DATABASE=$((ATTEMPTS_LEFT_TO_REACH_DATABASE - 1))
38+
echo "Still waiting for db to be ready... Or maybe the db is not reachable. $ATTEMPTS_LEFT_TO_REACH_DATABASE attempts left"
39+
done
40+
41+
if [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ]; then
42+
echo "The db is not up or not reachable"
43+
exit 1
44+
else
45+
echo "The db is now ready and reachable"
46+
fi
47+
48+
if ls -A migrations/*.php >/dev/null 2>&1; then
49+
bin/console doctrine:migrations:migrate --no-interaction
50+
fi
51+
fi
5252

5353
setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var
5454
setfacl -dR -m u:www-data:rwX -m u:"$(whoami)":rwX var

0 commit comments

Comments
 (0)