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

For PHP8+: Remove deprecated stylelint rule and rename PHPCS rule #195

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ name: PHP
on: [push, pull_request]

env:
PHPCS_DIR: /tmp/phpcs
PHPCOMPAT_DIR: /tmp/phpcompatibility
SNIFFS_DIR: /tmp/sniffs
WPCS_DIR: /tmp/wpcs
Expand All @@ -18,26 +17,27 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Setup PHP with Xdebug 2.x
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: xdebug2

- name: Set up PHPCS and WordPress-Coding-Standards
run: |
git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR
git clone -b 2.2.1 --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $WPCS_DIR
$PHPCS_DIR/bin/phpcs --config-set installed_paths $WPCS_DIR,$PHPCOMPAT_DIR,$SNIFFS_DIR
git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git $PHPCOMPAT_DIR

- name: Run PHPCS
run: |
$PHPCS_DIR/bin/phpcs -p . --ignore=node_modules,*/css/*,*/sass/* --standard=phpcs.xml

- name: Test PHP for syntax errors
run: find -L . -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l

- name: Checkout the repository
uses: actions/checkout@v3

- name: Setup PHP with Xdebug 2.x
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: xdebug2

- name: Set up PHPCS and WordPress-Coding-Standards
run: |
composer global require --dev dealerdirect/phpcodesniffer-composer-installer
composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer global require --dev phpcsstandards/phpcsextra:"^1.1.0"
composer global require phpcsstandards/phpcsutils:"^1.0"
composer global require --dev wp-coding-standards/wpcs:"^3.0"
git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git $PHPCOMPAT_DIR

- name: Run PHPCS
run: |
phpcs -p . --ignore=node_modules,*/css/*,*/sass/* --standard=phpcs.xml

- name: Test PHP for syntax errors
run: find -L . -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
1 change: 0 additions & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
"no-duplicate-selectors": true,
"length-zero-no-unit": true,
"font-weight-notation": "numeric",
"number-leading-zero": "never",
"number-max-precision": 3,
"selector-class-pattern": null,
"selector-max-class": 4,
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact" />
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect" />
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed" />
<exclude name="WordPress.WhiteSpace.PrecisionAlignment" />
<exclude name="Universal.WhiteSpace.PrecisionAlignment" />
<exclude name="PEAR.Functions.FunctionCallSignature.Indent" />
<exclude name="WordPress.Arrays.ArrayIndentation.ItemNotAligned" />
<exclude name="WordPress.Arrays.ArrayIndentation.MultiLineArrayItemNotAligned" />
Expand Down
Loading