-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manually syncing internal and external repos
- Loading branch information
1 parent
464d0f2
commit 4e46096
Showing
7 changed files
with
141 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
# Get staged PHP files for PHP CodeSniffer | ||
php_files=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.php$') | ||
if [ -n "$php_files" ]; then | ||
echo "Running PHP CodeSniffer on the following files:" | ||
echo "$php_files" | ||
|
||
echo "$php_files" | xargs vendor/bin/phpcs -d memory_limit=512M --standard=phpcs.xml.dist | ||
if [ $? -ne 0 ]; then | ||
echo "PHP CodeSniffer failed. Please fix the errors." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
# Get staged CSS and JS files | ||
css_files=$(git diff --cached --name-only --diff-filter=ACM | grep -E '^(css/.*\.css)$') | ||
js_files=$(git diff --cached --name-only --diff-filter=ACM | grep -E '^(js/.*\.js)$') | ||
|
||
# Combine CSS and JS files into a single variable | ||
all_files="$css_files $js_files" | ||
|
||
# Run Prettier if there are CSS or JS files | ||
if [ -n "$all_files" ]; then | ||
echo "Running Prettier on the following files:" | ||
echo "$all_files" | ||
|
||
echo "$all_files" | xargs npx prettier --write | ||
if [ $? -ne 0 ]; then | ||
echo "Prettier failed. Please fix the formatting errors." | ||
exit 1 | ||
fi | ||
|
||
# Add formatted files back to the staged changes | ||
echo "$all_files" | xargs git add | ||
fi | ||
|
||
echo "All checks passed." | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test-and-code-style: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: [8.1] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: composer install --prefer-dist | ||
|
||
- name: Run tests | ||
run: vendor/bin/phpunit --bootstrap __tests__/bootstrap.php __tests__ | ||
|
||
- name: Run PHPCS | ||
run: vendor/bin/phpcs --standard=WordPress --extensions=php --ignore=vendor/ . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/vendor | ||
/build | ||
/js/lib/node_modules | ||
/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"tabWidth": 2, | ||
"semi": true | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "facebook-pixel-for-wordpress", | ||
"version": "1.0.0", | ||
"description": "Grow your business with Facebook for WordPress! This plugin will install a Facebook Pixel for your page so you can capture the actions people take when they interact with your page, such as Lead, ViewContent, AddToCart, InitiateCheckout and Purchase events. Version 2.0.0 also includes support for the Conversions API, which lets you send events directly from your page’s server so you can capture a more of these events when they happen. This can help you better understand your customer’s journey from the moment they show interest in your business to the moment they complete a conversion. You can use this information to create ad campaigns that are relevant to your audience. [Learn More](https://www.facebook.com/business/learn/facebook-ads-pixel)", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "GPL-2.0", | ||
"devDependencies": { | ||
"prettier": "^3.3.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="WordPress Coding Standards"> | ||
<description>Coding standards for WordPress development.</description> | ||
|
||
<!-- Paths to check --> | ||
<file>./</file> | ||
|
||
<!-- Exclude these directories from being scanned --> | ||
<exclude-pattern>vendor/*</exclude-pattern> | ||
<exclude-pattern>node_modules/*</exclude-pattern> | ||
|
||
<!-- Include WordPress coding standards --> | ||
<rule ref="WordPress-Core"/> | ||
<rule ref="WordPress-Extra"/> | ||
<rule ref="WordPress-Docs"/> | ||
|
||
<!-- Set severity and error levels --> | ||
<arg name="warning-severity" value="6"/> | ||
<arg name="error-severity" value="5"/> | ||
|
||
<!-- Allow parallel processing --> | ||
<arg name="parallel" value="80"/> | ||
</ruleset> |