Skip to content

Commit

Permalink
Merge branch 'release/3.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Jul 10, 2024
2 parents bb52b78 + 619c135 commit ca05888
Show file tree
Hide file tree
Showing 12 changed files with 198 additions and 352 deletions.
12 changes: 7 additions & 5 deletions .github/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ cd ~/fixture || exit 1
# Test that all standards were installed.
INSTALLED=$(./vendor/bin/phpcs -i)
EXPECTED=(
AcquiaDrupalMinimal
AcquiaDrupalStrict
AcquiaDrupalTransitional
AcquiaPHP
AcquiaPHPMinimal
AcquiaPHPStrict
Drupal
DrupalPractice
PHPCompatibility
Expand All @@ -54,13 +55,14 @@ if [[ "$FAILURES" ]]; then
fi

# Place a good test file.
printf "<?php\n\n/**\n * @file\n * Good test file.\n */\n" > good.php
printf "<?php\n\n/**\n * @file\n * Good test file.\n */\n\ndeclare(strict_types=1);\n" > good.php

# Test that the SUT's standards can be run.
EXPECTED=(
AcquiaDrupalMinimal
AcquiaDrupalStrict
AcquiaDrupalTransitional
AcquiaPHP
AcquiaPHPMinimal
AcquiaPHPStrict
)
for STANDARD in "${EXPECTED[@]}"; do
./vendor/bin/phpcs -v --standard="$STANDARD" good.php
Expand Down
45 changes: 23 additions & 22 deletions .github/workflows/orca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,26 @@ on:
- cron: "0 0 * * 0"
jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
env:
ORCA_SUT_NAME: acquia/coding-standards
ORCA_SUT_BRANCH: master
ORCA_VERSION: ^3
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_LATEST_LTS
- INTEGRATED_TEST_ON_LATEST_LTS
- INTEGRATED_TEST_ON_PREVIOUS_MINOR
# - INTEGRATED_UPGRADE_TEST_FROM_PREVIOUS_MINOR
- ISOLATED_TEST_ON_CURRENT
Expand All @@ -44,32 +48,29 @@ jobs:
- ISOLATED_TEST_ON_NEXT_MINOR_DEV
# - INTEGRATED_UPGRADE_TEST_TO_NEXT_MINOR_DEV
- LOOSE_DEPRECATED_CODE_SCAN
php-version: [ "8.1" ]
php-version: [ "8.1", "8.3" ]
coveralls-enable: [ "FALSE" ]
orca-version: [ "^4" ]
include:
- orca-job: INTEGRATED_TEST_ON_OLDEST_SUPPORTED
php-version: "7.4"
- orca-job: INTEGRATED_TEST_ON_LATEST_EOL_MAJOR
php-version: "8.1"
coveralls-enable: "FALSE"
orca-version: "^4"

- orca-job: INTEGRATED_TEST_ON_OLDEST_SUPPORTED
- orca-job: INTEGRATED_TEST_ON_LATEST_EOL_MAJOR
php-version: "8.0"
coveralls-enable: "FALSE"
orca-version: "^3"

- 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: INTEGRATED_TEST_ON_LATEST_LTS
php-version: "7.4"
coveralls-enable: "FALSE"
# - orca-job: ISOLATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_DEV
# php-version: "8.1"
# coveralls-enable: "FALSE"
# - orca-job: INTEGRATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_DEV
# php-version: "8.1"
# coveralls-enable: "FALSE"
# - orca-job: ISOLATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_BETA_OR_LATER
# php-version: "8.1"
# coveralls-enable: "FALSE"
# - orca-job: INTEGRATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_BETA_OR_LATER
# php-version: "8.1"
# coveralls-enable: "FALSE"
# - orca-job: ISOLATED_TEST_ON_CURRENT
# php-version: "8.0"
# coveralls-enable: "FALSE"
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ Acquia Coding Standards for PHP includes a selection of sniffs from the followin

## Rulesets

Rules are split into rulesets according to the project language and framework:
Rules are split into rulesets according to the project *framework* and *audience*:

* [AcquiaPHP](src/Standards/AcquiaPHP/ruleset.xml) contains sniffs applicable to all PHP projects.
* [AcquiaDrupalStrict](src/Standards/AcquiaDrupalStrict/ruleset.xml) incorporates AcquiaPHP and adds all Drupal coding standards and best practices sniffs. Recommended for new Drupal projects and teams familiar with Drupal coding standards.
* [AcquiaDrupalTransitional](src/Standards/AcquiaDrupalTransitional/ruleset.xml) incorporates AcquiaPHP and adds Drupal core's own phpcs configuration, which is less strict than the official standards. Recommended for legacy Drupal codebases or teams new to Drupal coding standards.
* [AcquiaEdge](src/Standards/AcquiaEdge/ruleset.xml) incorporates AcquiaPHP and adds backwards-incompatible sniffs that will be included in AcquiaPHP with the next major release of this package.
* Projects targeting the Drupal community, e.g., Drupal modules, should adopt a *Drupal* ruleset. All others should adopt a (more generalized) *PHP* ruleset.
* Public projects, e.g., open-source Drupal modules, should adopt a *non-strict* ruleset to facilitate external collaboration. All others should adopt a more opinionated *internal* ruleset.

There are four permutations of these guidelines, leading to four rulesets to choose from:

* [AcquiaDrupalMinimal](src/Standards/AcquiaDrupalMinimal/ruleset.xml) is based on the Drupal coding standard and is intended for use on all public Drupal projects.
* [AcquiaDrupalStrict](src/Standards/AcquiaDrupalStrict/ruleset.xml) is based on AcquiaDrupal and adds the more opinionated DrupalPractice standard. It is intended for use on all internal Drupal projects.
* [AcquiaPHPMinimal](src/Standards/AcquiaPHPMinimal/ruleset.xml) is based on PSR-12 and is intended for use on all public non-Drupal projects.
* [AcquiaPHPStrict](src/Standards/AcquiaPHPStrict/ruleset.xml) is based on AcquiaPHP and adds additional, more opinionated standards. It is intended for use on all internal, non-Drupal projects.

## Installation & usage

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"standards",
"static analysis"
],
"license": "GPL-2.0-only",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Acquia Engineering",
Expand All @@ -34,7 +34,7 @@
},
"extra": {
"branch-alias": {
"dev-develop": "2.x-dev"
"dev-develop": "3.x-dev"
}
},
"autoload": {
Expand Down
78 changes: 39 additions & 39 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions example/phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

<!-- Uncomment your chosen standard and the filename extensions corresponding to it. -->
<!-- @see https://github.com/acquia/coding-standards-php/issues/18 for background on filename extensions. -->
<!-- <rule ref="AcquiaDrupalMinimal"/><arg name="extensions" value="php,module,inc,install,test,profile,theme,css,info,txt,md,yml"/> -->
<rule ref="AcquiaDrupalStrict"/><arg name="extensions" value="php,module,inc,install,test,profile,theme,css,info,txt,md,yml"/>
<!-- <rule ref="AcquiaDrupalTransitional"/><arg name="extensions" value="php,module,inc,install,test,profile,theme,css,info,txt,md,yml"/> -->
<!-- <rule ref="AcquiaPHP"/><arg name="extensions" value="php,inc,test,css,txt,md,yml"/> -->
<!-- <rule ref="AcquiaEdge"/><arg name="extensions" value="php,inc,test,css,txt,md,yml"/> -->
<!-- <rule ref="AcquiaPHPMinimal"/><arg name="extensions" value="php,inc,test,css,txt,md,yml"/> -->
<!-- <rule ref="AcquiaPHPStrict"/><arg name="extensions" value="php,inc,test,css,txt,md,yml"/> -->

<arg name="colors"/>
<arg name="cache" value=".phpcs-cache"/>
Expand Down
Loading

0 comments on commit ca05888

Please sign in to comment.