diff --git a/.github/script.sh b/.github/script.sh index 27bc7f1..8622f48 100755 --- a/.github/script.sh +++ b/.github/script.sh @@ -38,7 +38,6 @@ EXPECTED=( AcquiaPHPStrict Drupal DrupalPractice - PHPCompatibility ) echo "$INSTALLED" for STANDARD in "${EXPECTED[@]}"; do diff --git a/.github/workflows/orca.yml b/.github/workflows/orca.yml deleted file mode 100644 index 6e531ae..0000000 --- a/.github/workflows/orca.yml +++ /dev/null @@ -1,117 +0,0 @@ ---- -name: Tests -on: - push: - branches: [ main, develop, wip, support/** ] - pull_request: - branches: [ develop, support/** ] - schedule: - # Sunday at 00:00:00 UTC. - # @see https://crontab.cronhub.io/ - - cron: "0 0 * * 0" -jobs: - build: - runs-on: ubuntu-24.04 - env: - ORCA_SUT_NAME: acquia/coding-standards - ORCA_SUT_BRANCH: main - ORCA_VERSION: ${{ matrix.orca-version }} - ORCA_TELEMETRY_ENABLE: TRUE - ORCA_JOB: ${{ matrix.orca-job }} - ORCA_COVERALLS_ENABLE: ${{ matrix.coveralls-enable }} - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # Google env variables. - ORCA_GOOGLE_API_CLIENT_ID: ${{ secrets.ORCA_GOOGLE_API_CLIENT_ID }} - ORCA_GOOGLE_API_CLIENT_SECRET: ${{ secrets.ORCA_GOOGLE_API_CLIENT_SECRET }} - ORCA_GOOGLE_API_REFRESH_TOKEN: ${{ secrets.ORCA_GOOGLE_API_REFRESH_TOKEN }} - - strategy: - matrix: - orca-job: - - STATIC_CODE_ANALYSIS - - INTEGRATED_TEST_ON_OLDEST_SUPPORTED - - INTEGRATED_TEST_ON_PREVIOUS_MINOR - - INTEGRATED_TEST_ON_LATEST_LTS - # - INTEGRATED_UPGRADE_TEST_FROM_PREVIOUS_MINOR - - ISOLATED_TEST_ON_CURRENT - - INTEGRATED_TEST_ON_CURRENT - # - INTEGRATED_UPGRADE_TEST_TO_NEXT_MINOR - - ISOLATED_TEST_ON_CURRENT_DEV - - INTEGRATED_TEST_ON_CURRENT_DEV - - STRICT_DEPRECATED_CODE_SCAN - - ISOLATED_TEST_ON_NEXT_MINOR - - INTEGRATED_TEST_ON_NEXT_MINOR - # - ISOLATED_UPGRADE_TEST_TO_NEXT_MAJOR_BETA_OR_LATER - # - ISOLATED_UPGRADE_TEST_TO_NEXT_MAJOR_DEV - - DEPRECATED_CODE_SCAN_W_CONTRIB - - INTEGRATED_TEST_ON_NEXT_MINOR_DEV - - ISOLATED_TEST_ON_NEXT_MINOR_DEV - # - INTEGRATED_UPGRADE_TEST_TO_NEXT_MINOR_DEV - - LOOSE_DEPRECATED_CODE_SCAN - php-version: [ "8.3" ] - coveralls-enable: [ "FALSE" ] - orca-version: [ "^4" ] - # include: - # - orca-job: INTEGRATED_TEST_ON_LATEST_EOL_MAJOR - # php-version: "8.1" - # - # - orca-job: INTEGRATED_TEST_ON_OLDEST_SUPPORTED - # php-version: "8.1" - # - # - orca-job: INTEGRATED_TEST_ON_LATEST_LTS - # php-version: "8.1" - # - # # - orca-job: ISOLATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_DEV - # # php-version: "8.3" - # # - orca-job: INTEGRATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_DEV - # # php-version: "8.3" - # # - orca-job: ISOLATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_BETA_OR_LATER - # # php-version: "8.3" - # # - orca-job: INTEGRATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_BETA_OR_LATER - # # php-version: "8.3" - # - # # - orca-job: ISOLATED_TEST_ON_CURRENT - # # php-version: "8.0" - # # coveralls-enable: "FALSE" - # # Custom job - # - php-version: "8.1" - # orca-job: "" - - steps: - - uses: actions/checkout@v6 - - - uses: actions/setup-node@v6 - with: - node-version: 12.x - - - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - coverage: xdebug - - - name: Before install - run: | - composer create-project --no-dev acquia/orca ../orca "$ORCA_VERSION" - ../orca/bin/ci/before_install.sh - - - name: Install - run: | - ../orca/bin/ci/install.sh - ./.github/install.sh - - - name: Before script - run: ../orca/bin/ci/before_script.sh - - - name: Script - run: ./.github/script.sh - - - name: After script - run: ../orca/bin/ci/after_script.sh - - - name: After success - if: ${{ success() }} - run: ../orca/bin/ci/after_success.sh - - - name: After failure - if: ${{ failure() }} - run: ../orca/bin/ci/after_failure.sh diff --git a/README.md b/README.md index 93b6c2b..c27a5fa 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ Acquia Coding Standards for PHP includes a selection of sniffs from the followin * [Drupal Code Sniffer](https://packagist.org/packages/drupal/coder) encapsulates [Drupal coding standards](https://www.drupal.org/coding-standards ) and best practices for module development. * [PHP_CodeSniffer](https://packagist.org/packages/squizlabs/php_codesniffer) itself contains several broadly applicable rulesets. -* [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility) checks for PHP cross-version compatibility with all supported language versions. * [Slevomat Coding Standard](https://github.com/slevomat/coding-standard) provides functional (safety and behavior), cleaning (dead code), and formatting (consistent look) sniffs. ## Rulesets @@ -39,6 +38,8 @@ There are four permutations of these guidelines, leading to four rulesets to cho composer require --dev acquia/coding-standards ``` + If you want to add PHP cross-version compatibility checks, we suggest [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility). + 1. Inform PHP CodeSniffer of the location of the standard and its dependencies: * It is strongly recommended that you use a Composer plugin to handle this for you, e.g., [`DealerDirect/phpcodesniffer-composer-installer`](https://github.com/DealerDirect/phpcodesniffer-composer-installer): @@ -55,7 +56,7 @@ There are four permutations of these guidelines, leading to four rulesets to cho "scripts": { "post-install-cmd": "@install-coding-standards", "post-update-cmd" : "@install-coding-standards", - "install-coding-standards": "\"vendor/bin/phpcs\" --config-set installed_paths vendor/acquia/coding-standards/src/Standards,vendor/drupal/coder/coder_sniffer,vendor/phpcompatibility/php-compatibility,vendor/slevomat/coding-standard" + "install-coding-standards": "\"vendor/bin/phpcs\" --config-set installed_paths vendor/acquia/coding-standards/src/Standards,vendor/drupal/coder/coder_sniffer,vendor/slevomat/coding-standard" } } ``` diff --git a/composer.json b/composer.json index c4ae39b..7321103 100644 --- a/composer.json +++ b/composer.json @@ -18,13 +18,13 @@ ], "require": { "drupal/coder": "^8.3", - "phpcompatibility/php-compatibility": "^10.0.0-alpha1", "slevomat/coding-standard": "^8.4", "squizlabs/php_codesniffer": "^3.7" }, "suggest": { "brainmaestro/composer-git-hooks": "Easily manage Git hooks in your composer config.", - "dealerdirect/phpcodesniffer-composer-installer": "Automatically install PHP_CodeSniffer coding standards (rulesets)." + "dealerdirect/phpcodesniffer-composer-installer": "Automatically install PHP_CodeSniffer coding standards (rulesets).", + "phpcompatibility/php-compatibility": "Check for PHP cross-version compatibility." }, "config": { "allow-plugins": { diff --git a/composer.lock b/composer.lock index 59fc5f7..67b890c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e5c8bb9c6b969c1d8b7496c1c906f531", + "content-hash": "49108978c36224b0ab3fb7f1e7797637", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -153,189 +153,6 @@ }, "time": "2025-10-16T12:23:49+00:00" }, - { - "name": "phpcompatibility/php-compatibility", - "version": "10.0.0-alpha2", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "e0f0e5a3dc819a4a0f8d679a0f2453d941976e18" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/e0f0e5a3dc819a4a0f8d679a0f2453d941976e18", - "reference": "e0f0e5a3dc819a4a0f8d679a0f2453d941976e18", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "phpcsstandards/phpcsutils": "^1.1.2", - "squizlabs/php_codesniffer": "^3.13.3 || ^4.0" - }, - "replace": { - "wimg/php-compatibility": "*" - }, - "require-dev": { - "php-parallel-lint/php-console-highlighter": "^1.0.0", - "php-parallel-lint/php-parallel-lint": "^1.4.0", - "phpcsstandards/phpcsdevcs": "^1.2.0", - "phpcsstandards/phpcsdevtools": "^1.2.3", - "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4 || ^10.5.32 || ^11.3.3", - "yoast/phpunit-polyfills": "^1.1.5 || ^2.0.5 || ^3.1.0" - }, - "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-master": "9.x-dev", - "dev-develop": "10.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "homepage": "https://github.com/wimg", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" - } - ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", - "homepage": "https://techblog.wimgodden.be/tag/codesniffer/", - "keywords": [ - "compatibility", - "phpcs", - "standards", - "static analysis" - ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "security": "https://github.com/PHPCompatibility/PHPCompatibility/security/policy", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" - }, - "funding": [ - { - "url": "https://github.com/PHPCompatibility", - "type": "github" - }, - { - "url": "https://github.com/jrfnl", - "type": "github" - }, - { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" - }, - { - "url": "https://thanks.dev/u/gh/phpcompatibility", - "type": "thanks_dev" - } - ], - "time": "2025-11-28T11:36:33+00:00" - }, - { - "name": "phpcsstandards/phpcsutils", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "c216317e96c8b3f5932808f9b0f1f7a14e3bbf55" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/c216317e96c8b3f5932808f9b0f1f7a14e3bbf55", - "reference": "c216317e96c8b3f5932808f9b0f1f7a14e3bbf55", - "shasum": "" - }, - "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", - "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.13.5 || ^4.0.1" - }, - "require-dev": { - "ext-filter": "*", - "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.4.0", - "phpcsstandards/phpcsdevcs": "^1.2.0", - "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0 || ^3.0.0" - }, - "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-stable": "1.x-dev", - "dev-develop": "1.x-dev" - } - }, - "autoload": { - "classmap": [ - "PHPCSUtils/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" - } - ], - "description": "A suite of utility functions for use with PHP_CodeSniffer", - "homepage": "https://phpcsutils.com/", - "keywords": [ - "PHP_CodeSniffer", - "phpcbf", - "phpcodesniffer-standard", - "phpcs", - "phpcs3", - "phpcs4", - "standards", - "static analysis", - "tokens", - "utility" - ], - "support": { - "docs": "https://phpcsutils.com/", - "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", - "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy", - "source": "https://github.com/PHPCSStandards/PHPCSUtils" - }, - "funding": [ - { - "url": "https://github.com/PHPCSStandards", - "type": "github" - }, - { - "url": "https://github.com/jrfnl", - "type": "github" - }, - { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" - }, - { - "url": "https://thanks.dev/u/gh/phpcsstandards", - "type": "thanks_dev" - } - ], - "time": "2025-12-08T14:27:58+00:00" - }, { "name": "phpstan/phpdoc-parser", "version": "2.3.0", diff --git a/src/Standards/AcquiaDrupalMinimal/ruleset.xml b/src/Standards/AcquiaDrupalMinimal/ruleset.xml index b548445..a854228 100644 --- a/src/Standards/AcquiaDrupalMinimal/ruleset.xml +++ b/src/Standards/AcquiaDrupalMinimal/ruleset.xml @@ -13,17 +13,6 @@ - - - - - - - tests/* diff --git a/src/Standards/AcquiaPHPMinimal/ruleset.xml b/src/Standards/AcquiaPHPMinimal/ruleset.xml index fab865e..3bc9fa1 100644 --- a/src/Standards/AcquiaPHPMinimal/ruleset.xml +++ b/src/Standards/AcquiaPHPMinimal/ruleset.xml @@ -16,17 +16,6 @@ *.(md|txt|yml) - - - - - - -