diff --git a/.github/bin/phpcs-branch.php b/.github/bin/phpcs-branch.php index 1ce95a83cf..e1e464dd50 100644 --- a/.github/bin/phpcs-branch.php +++ b/.github/bin/phpcs-branch.php @@ -12,7 +12,7 @@ namespace WordPressOrg\Bin\PHPCS_Changed; function run_phpcs( $file, $bin_dir ) { - exec( "$bin_dir/phpcs $file -snq", $output, $exec_exit_status ); + exec( "$bin_dir/phpcs $file --standard=./phpcs-clean.xml.dist -snq", $output, $exec_exit_status ); echo implode( "\n", $output ); return $exec_exit_status; } @@ -27,10 +27,10 @@ function run_phpcs_changed( $file, $git, $base_branch, $bin_dir ) { exec( "$git diff $base_branch $file > $name.diff" ); exec( "$git show $base_branch:$file > $name.test.php" ); - exec( "$bin_dir/phpcs $name.test.php --standard=./phpcs.xml.dist --report=json -snq > $name.orig.phpcs" ); + exec( "$bin_dir/phpcs $name.test.php --standard=./phpcs-clean.xml.dist --report=json -snq > $name.orig.phpcs" ); exec( "cat $file > $name.test.php" ); - exec( "$bin_dir/phpcs $name.test.php --standard=./phpcs.xml.dist --report=json -snq > $name.phpcs" ); + exec( "$bin_dir/phpcs $name.test.php --standard=./phpcs-clean.xml.dist --report=json -snq > $name.phpcs" ); $cmd = "$bin_dir/phpcs-changed --diff $name.diff --phpcs-orig $name.orig.phpcs --phpcs-new $name.phpcs"; exec( $cmd, $output, $exec_exit_status ); diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml index 5c461cdaab..d25f168b5a 100644 --- a/.github/workflows/phpcs.yml +++ b/.github/workflows/phpcs.yml @@ -5,6 +5,7 @@ on: paths: - '**.php' - phpcs.xml.dist + - phpcs-clean.xml.dist - composer.json - .github/workflows/phpcs.yml - .github/bin/phpcs-branch.php diff --git a/phpcs-clean.xml.dist b/phpcs-clean.xml.dist new file mode 100644 index 0000000000..2a2b3e5bb2 --- /dev/null +++ b/phpcs-clean.xml.dist @@ -0,0 +1,35 @@ + + + Full WordPress Coding Standards, applied to changed lines and new files only (via .github/bin/phpcs-branch.php). No sniff exclusions — new code is held to the stock standard. + + + + + + + */vendor/* + */node_modules/* + */plugins/plugin-directory/libs/* + */plugins/theme-directory/lib/* + */plugins/wpf-stripe/stripe-php/* + + + */plugins/*/build/index.asset.php + + + *.js[x]? + *.[s]?css + + + . + + + + + + + + + + +