From c4adef488e81fda52feeb943d1e9bae110d92cac Mon Sep 17 00:00:00 2001 From: Patrick Kenny <33362-ptmkenny@users.noreply.drupalcode.org> Date: Mon, 27 May 2024 15:00:08 +0000 Subject: [PATCH] Issue #3450099 by ptmkenny, DamienMcKenna: Require phpcs, composer-lint, cspell, phpstan and stylelint to pass. --- .gitlab-ci.yml | 46 +++++++++++++------ CHANGELOG.txt | 2 + .../json_field_widget_test_helper.info.yml | 2 +- .../tests/src/Functional/WidgetTest.php | 2 +- src/JsonFieldRequirements.php | 2 +- 5 files changed, 36 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d7301f4..168f453 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,15 +1,18 @@ ################ # GitLabCI template for Drupal projects. # -# This template is designed to give any Contrib maintainer everything they need to test, without requiring modification. -# It is also designed to keep up to date with Core Development automatically through the use of include files that can be centrally maintained. -# As long as you include the project, ref and three files below, any future updates added by the Drupal Association will be used in your -# pipelines automatically. However, you can modify this template if you have additional needs for your project. -# The full documentation is on https://project.pages.drupalcode.org/gitlab_templates/ +# This template is designed to give any Contrib maintainer everything they need +# to test, without requiring modification. It is also designed to keep up to +# date with Core Development automatically through the use of include files +# that can be centrally maintained. As long as you include the project, ref and +# three files below, any future updates added by the Drupal Association will be +# used in your pipelines automatically. However, you can modify this template +# if you have additional needs for your project. The full documentation is on +# https://project.pages.drupalcode.org/gitlab_templates/ ################ -# For information on alternative values for 'ref' see https://project.pages.drupalcode.org/gitlab_templates/info/templates-version/ -# To test a Drupal 7 project, change the first include filename from .main.yml to .main-d7.yml +# For information on alternative values for 'ref' see: +# https://project.pages.drupalcode.org/gitlab_templates/info/templates-version/ include: - project: $_GITLAB_TEMPLATES_REPO ref: $_GITLAB_TEMPLATES_REF @@ -18,18 +21,31 @@ include: - "/includes/include.drupalci.variables.yml" - "/includes/include.drupalci.workflows.yml" +# Require additional tests to pass. +composer-lint: + allow_failure: false +cspell: + allow_failure: false +phpcs: + allow_failure: false +phpstan: + allow_failure: false +stylelint: + allow_failure: false + ################ -# Pipeline configuration variables are defined with default values and descriptions in the file +# Pipeline configuration variables are defined with default values and +# descriptions in the file # https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes/include.drupalci.variables.yml -# Uncomment the lines below if you want to override any of the variables. The following is just an example. +# Uncomment the lines below if you want to override any of the variables. The +# following is just an example. ################ variables: - _CSPELL_WORDS: 'josdejong,jsoneditor,jsonview,quickedit,Swaggest,yesmeck' + _CSPELL_WORDS: 'dawehner,Jesin,josdejong,jsoneditor,jsonview,McKenna,quickedit,Swaggest,yesmeck' OPT_IN_TEST_MAX_PHP: '1' - OPT_IN_TEST_NEXT_MINOR: '1' OPT_IN_TEST_PREVIOUS_MAJOR: '1' OPT_IN_TEST_PREVIOUS_MINOR: '1' -# SKIP_ESLINT: '1' -# OPT_IN_TEST_NEXT_MAJOR: '1' -# _CURL_TEMPLATES_REF: 'main' - + # Disable the next phpstan minor release as it would involve breaking + # compatibility with D9 and < 10.3. + # @see https://www.drupal.org/project/json_field/issues/3450162 + # OPT_IN_TEST_NEXT_MINOR: '1' diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a753f2c..9358d49 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,8 @@ JSON Field 8.x-1.x-dev, 2024-xx-xx organized in alphabetical order as per standard coding practices. #3448199 by ptmkenny, DamienMcKenna: Fix library warning method name. #3450101 by DamienMcKenna: Coding standards fixes. +#3450099 by ptmkenny, DamienMcKenna: Require phpcs, composer-lint, cspell, + phpstan and stylelint to pass. JSON Field 8.x-1.3, 2023-08-09 diff --git a/modules/json_field_widget/tests/modules/json_field_widget_test_helper/json_field_widget_test_helper.info.yml b/modules/json_field_widget/tests/modules/json_field_widget_test_helper/json_field_widget_test_helper.info.yml index 7e7b5df..6d0308f 100644 --- a/modules/json_field_widget/tests/modules/json_field_widget_test_helper/json_field_widget_test_helper.info.yml +++ b/modules/json_field_widget/tests/modules/json_field_widget_test_helper/json_field_widget_test_helper.info.yml @@ -1,6 +1,6 @@ name: 'JSON Field Widget Test Helper' type: module -description: 'Extra logic to make testing the widgete.' +description: 'Extra logic to make testing the widget.' package: Testing dependencies: - drupal:node diff --git a/modules/json_field_widget/tests/src/Functional/WidgetTest.php b/modules/json_field_widget/tests/src/Functional/WidgetTest.php index 6e1e1bc..445e5ee 100644 --- a/modules/json_field_widget/tests/src/Functional/WidgetTest.php +++ b/modules/json_field_widget/tests/src/Functional/WidgetTest.php @@ -6,7 +6,7 @@ use Drupal\Component\Serialization\Json; use Drupal\Tests\BrowserTestBase; /** - * Verify that JSON Field widget UI works as expected + * Verify that JSON Field widget UI works as expected. * * @group json_field */ diff --git a/src/JsonFieldRequirements.php b/src/JsonFieldRequirements.php index 1c45d7b..c1b8f9e 100644 --- a/src/JsonFieldRequirements.php +++ b/src/JsonFieldRequirements.php @@ -72,7 +72,7 @@ class JsonFieldRequirements implements JsonFieldRequirementsInterface { $version_query = 'SHOW server_version'; } elseif ($driver === 'sqlite') { - $version_query = 'select sqlite_version()'; + $version_query = 'select sqlite_version()'; } $driver_version = $this->connection->query($version_query)->fetchCol(); $is_compatible = version_compare($driver_version[0], $minimum_version_required); -- GitLab