Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 8.3.14 of the coder module (https://www.drupal.org/project/coder/issues/3262291) #4

Merged
merged 5 commits into from Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile2
Expand Up @@ -4,4 +4,4 @@ COPY docker-resources /docker-resources

RUN /docker-resources/build.sh && rm -rf /docker-resources

ENTRYPOINT [ "/root/.composer/vendor/bin/phpcs" ]
ENTRYPOINT [ "/vendor/bin/phpcs" ]
2 changes: 1 addition & 1 deletion Dockerfile3
Expand Up @@ -4,4 +4,4 @@ COPY docker-resources /docker-resources

RUN /docker-resources/build.sh && rm -rf /docker-resources

ENTRYPOINT [ "/root/.composer/vendor/bin/phpcs" ]
ENTRYPOINT [ "/vendor/bin/phpcs" ]
5 changes: 2 additions & 3 deletions docker-resources/build.sh
Expand Up @@ -16,7 +16,6 @@ apt-get update && \
apt-get install -y --no-install-recommends mariadb-client git unzip && \
rm -rf /var/lib/apt/lists/*

composer global require \
drupal/coder:8.3.13
mv /docker-resources/composer.json /

/root/.composer/vendor/bin/phpcs --config-set installed_paths ~/.composer/vendor/drupal/coder/coder_sniffer
composer update
10 changes: 10 additions & 0 deletions docker-resources/composer.json
@@ -0,0 +1,10 @@
{
"require": {
"drupal/coder": "*"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
File renamed without changes.
12 changes: 12 additions & 0 deletions example02/example.php
@@ -0,0 +1,12 @@
<?php

/**
* @file
* Dummy file.
*/

// this should FAIL because the comment is not in the correct format.
// see ./test.sh
function dummy_function(string $a, string $b) : string {
return $a . ' ' . $b;
}
12 changes: 8 additions & 4 deletions test.sh
Expand Up @@ -11,17 +11,21 @@ echo ""
echo ""

echo " => Building version 2 for php 7"
docker build -f="Dockerfile2" -t local-dcycle-php-lint-image .
docker build --progress=plain -f="Dockerfile2" -t local-dcycle-php-lint-image .
echo " => Running the help command (smoke test)"
docker run --rm local-dcycle-php-lint-image --help
echo " => Testing with Drupal"
docker run --rm -v "$(pwd)/example-code":/code local-dcycle-php-lint-image --standard=Drupal /code
docker run --rm -v "$(pwd)/example01":/code local-dcycle-php-lint-image --standard=Drupal /code
echo " => Expecting this to fail"
! docker run --rm -v "$(pwd)/example02":/code local-dcycle-php-lint-image --standard=Drupal /code

echo " => Building version 3 for php 8"
docker build -f="Dockerfile3" -t local-dcycle-php-lint-image .
docker build --progress=plain -f="Dockerfile3" -t local-dcycle-php-lint-image .
echo " => Running the help command (smoke test)"
docker run --rm local-dcycle-php-lint-image --help
echo " => Testing with Drupal"
docker run --rm -v "$(pwd)/example-code":/code local-dcycle-php-lint-image --standard=Drupal /code
docker run --rm -v "$(pwd)/example01":/code local-dcycle-php-lint-image --standard=Drupal /code
! docker run --rm -v "$(pwd)/example02":/code local-dcycle-php-lint-image --standard=Drupal /code

echo ""
echo ""
Expand Down