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

PES-2321: sniffer rules update #638

Merged
merged 23 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8abd0bb
PES-2321: voluntary comments
jan-potuznik-z Nov 4, 2024
9eb0aaf
PES-2321: alphabetically sorted uses
jan-potuznik-z Nov 4, 2024
2f4e8f0
PES-2321: property spacing
jan-potuznik-z Nov 4, 2024
3099895
PES-2321: empty line before return
jan-potuznik-z Nov 4, 2024
84a7a1b
PES-2321: empty line before all jump statements
jan-potuznik-z Nov 4, 2024
ecd00cd
PES-2321: function spacing unified
jan-potuznik-z Nov 4, 2024
f7b8e9a
PES-2321: namespace spacing unified
jan-potuznik-z Nov 4, 2024
5f59bf6
PES-2321: constant spacing check
jan-potuznik-z Nov 4, 2024
dcfb1a8
PES-2321: use statements spacing unified
jan-potuznik-z Nov 4, 2024
f52efd7
PES-2321: class members spacing unified
jan-potuznik-z Nov 4, 2024
3783cd9
PES-2321: rebase fix
jan-potuznik-z Nov 4, 2024
905d9b9
PES-2321: ruleset name updated
jan-potuznik-z Nov 4, 2024
3aae4d0
PES-2321: phpcbf pipeline
jan-potuznik-z Nov 4, 2024
1efac97
PES-2321: phpcbf pipeline update
jan-potuznik-z Nov 5, 2024
f33acda
PES-2321: check:ec fix
jan-potuznik-z Nov 5, 2024
68bc783
fixup! PES-2321: voluntary comments
jan-potuznik-z Nov 5, 2024
11ef7e7
PES-2321: code style checking in tests
jan-potuznik-z Nov 5, 2024
7692cdc
PES-2321: minimum_supported_wp_version update
jan-potuznik-z Nov 5, 2024
8b34029
PES-2321: woocommerce/woocommerce-sniffs update
jan-potuznik-z Nov 6, 2024
aa354b1
PES-2321: escaping exceptions not required
jan-potuznik-z Nov 6, 2024
bc30d88
PES-2321: linesCountBetweenUseTypes 1
jan-potuznik-z Nov 8, 2024
69ab207
PES-2321: FunctionSpacing update
jan-potuznik-z Nov 8, 2024
35e3a33
PES-2321: rebase fix
jan-potuznik-z Nov 8, 2024
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
13 changes: 13 additions & 0 deletions .github/run-phpcbf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

./vendor/bin/phpcbf
exit_code=$?

# Check if phpcbf made changes (non-zero exit code indicates fixes were made)
if [ $exit_code -ne 0 ]; then
echo "🛑 phpcbf made changes to the code."
exit 1
else
echo "✓ no changes were made by phpcbf."
exit 0
fi
34 changes: 34 additions & 0 deletions .github/workflows/run-phpcbf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: phpcbf check

on:
push:
branches: [ main ]
pull_request:

jobs:
phpcbf-check:
runs-on: ubuntu-24.04

strategy:
matrix:
php-version: [ '8.1' ]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl
coverage: yes

- name: php version
run: php -v

- name: Install Composer dependencies
run: composer install

- name: Run phpcbf
run: bash "${GITHUB_WORKSPACE}/.github/run-phpcbf.sh"
1 change: 1 addition & 0 deletions bootstrap-cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
*/

define( 'WP_DEBUG', false );

return require __DIR__ . '/bootstrap.php';
1 change: 1 addition & 0 deletions cli/create-latte-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
if ( is_dir( $container->parameters['latteTempFolder'] ) ) {
$filesToDelete = Finder::findFiles( '*' )->from( $container->parameters['latteTempFolder'] );
foreach ( $filesToDelete as $fileToDelete ) {
// phpcs:ignore WordPress.WP.AlternativeFunctions.unlink_unlink
unlink( $fileToDelete );
}
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"require": {
"php": "~8.1.0",
"woocommerce/woocommerce-sniffs": "0.1.3"
"woocommerce/woocommerce-sniffs": "1.0.0"
},
"require-dev": {
"composer/composer": "^2.6",
Expand Down
Loading
Loading