summaryrefslogtreecommitdiffstats
path: root/tools/install-phpcs.sh
diff options
context:
space:
mode:
authorMurilo Ijanc <[email protected]>2026-07-26 16:41:48 -0300
committerMurilo Ijanc <[email protected]>2026-07-26 16:47:14 -0300
commit535dbda6b48171f8115b455e54790de94d97d42a (patch)
tree5c0410011e61a883bdf063ee612875a637fb1d22 /tools/install-phpcs.sh
downloadwoocommerce-29190494c82855f0f0ce7fb16f831c8f971022c5.tar.gz
Initial importv0.1.0
Diffstat (limited to 'tools/install-phpcs.sh')
-rwxr-xr-xtools/install-phpcs.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/install-phpcs.sh b/tools/install-phpcs.sh
new file mode 100755
index 0000000..63ae7b2
--- /dev/null
+++ b/tools/install-phpcs.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# Fetch PHP_CodeSniffer and the WordPress standard into .phpcs/.
+#
+# Not a dependency of the plugin: nothing here ships, and a bare checkout lints
+# with `php -l` alone. Run this once to get the full WordPress review that
+# `make lint` will then include.
+
+set -eu
+
+root=$(cd "$(dirname "$0")/.." && pwd)
+target="$root/.phpcs"
+
+mkdir -p "$target"
+
+docker run --rm -v "$target":/app -w /app composer:2 sh -c '
+ composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true &&
+ composer require --dev --no-interaction --quiet \
+ squizlabs/php_codesniffer \
+ wp-coding-standards/wpcs \
+ dealerdirect/phpcodesniffer-composer-installer
+'
+
+printf 'phpcs installed in .phpcs/ — `make lint` will use it\n'