Skip to content

Commit d45c63c

Browse files
authored
Merge branch 'trunk' into change/simplify-follow-returns
2 parents 51ece21 + dbf0d11 commit d45c63c

File tree

229 files changed

+32854
-2537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+32854
-2537
lines changed

.distignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
.git
77
.github
88
.gitignore
9+
.githooks
910
.php_cs
1011
.prettierignore
1112
.prettierrc.js

.githooks/pre-commit

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env sh
2+
3+
# Get all changed PHP files once.
4+
PHP_FILES=$(git diff --cached --name-only --diff-filter=ACMR | grep "\.php$" || true)
5+
6+
# Skip if no PHP files are changed.
7+
if [ -n "$PHP_FILES" ]; then
8+
# First sort PHP imports
9+
for file in $PHP_FILES; do
10+
node bin/precommit/sort-php-imports.js "$file"
11+
done
12+
13+
# Then check for unused imports.
14+
UNUSED_IMPORTS=0
15+
for file in $PHP_FILES; do
16+
if ! node bin/precommit/check-unused-imports.js "$file"; then
17+
UNUSED_IMPORTS=1
18+
fi
19+
done
20+
21+
# Exit if unused imports were found.
22+
if [ $UNUSED_IMPORTS -eq 1 ]; then
23+
exit 1
24+
fi
25+
26+
# Run PHP Code Sniffer on all changed PHP files at once.
27+
echo "$PHP_FILES" | xargs composer lint:fix > /dev/null 2>&1 || { echo "PHP formatting failed"; exit 1; }
28+
fi
29+
30+
# Run the WordPress formatter without showing all file output.
31+
npm run format > /dev/null 2>&1 || { echo "JavaScript formatting failed"; exit 1; }
32+
33+
# Make sure git is aware of all the changes made by the formatters.
34+
git update-index --again

.github/changelog/2009-from-description

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/changelog/2024-blocking-moderation-system

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/changelog/2029-from-description

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/changelog/2034-from-description

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/changelog/2035-from-description

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/changelog/2039-from-description

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/changelog/2041-from-description

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/changelog/2044-from-description

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)