Skip to content

Commit

Permalink
Check & fix code in dev (#1766)
Browse files Browse the repository at this point in the history
* add php-fixer & eslint in docker container

* check only last edited files
  • Loading branch information
firepolo committed Aug 16, 2021
1 parent 0c7e79b commit 6a4db55
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .docker.dev/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ RUN mv composer.phar /usr/local/bin/composer
RUN pecl install apcu-beta \
&& echo extension=apcu.so > /usr/local/etc/php/conf.d/apcu.ini

RUN wget https://cs.symfony.com/download/php-cs-fixer-v2.phar -O /php-cs-fixer
RUN echo "diffs=\$(git diff --name-only) && php /php-cs-fixer fix --dry-run --diff --config=.php_cs \$diffs && /var/www/html/claroline/node_modules/.bin/eslint --ext js --ext jsx \$diffs" > /usr/local/bin/check-code
RUN echo "diffs=\$(git diff --name-only) && php /php-cs-fixer fix --diff --config=.php_cs \$diffs && /var/www/html/claroline/node_modules/.bin/eslint --fix --ext js --ext jsx \$diffs" > /usr/local/bin/fix-code
RUN chmod +x /usr/local/bin/check-code
RUN chmod +x /usr/local/bin/fix-code

COPY ./.docker.dev/web/config/php.ini /usr/local/etc/php/
COPY ./.docker.dev/web/files/apache2/claroline.conf /etc/apache2/sites-available/
COPY ./.docker.dev/web/files/apache2/claroline-ssl.conf /etc/apache2/sites-available/
Expand Down

0 comments on commit 6a4db55

Please sign in to comment.