Skip to content

Commit d5bba8e

Browse files
committed
Add some more checks.
1 parent c9d9090 commit d5bba8e

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

ISSUES.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,24 @@ Hooks with `@param` tags that have an empty variable name.
2424

2525
_No hooks with empty variables._
2626

27+
## Empty Param Descriptions
28+
29+
Hooks with `@param` tags that have an empty description.
30+
31+
- `block_core_navigation_render_inner_blocks` — $inner_blocks (wp-includes/blocks/navigation.php)
32+
- `render_block_core_navigation_link_allowed_post_status` — $attributes (wp-includes/blocks/navigation-link.php)
33+
- `render_block_core_navigation_link_allowed_post_status` — $block (wp-includes/blocks/navigation-link.php)
34+
- `render_block_core_navigation_link_allowed_post_status` — $post_status (wp-includes/blocks/navigation-link.php)
35+
- `should_load_remote_block_patterns` — $should_load_remote (wp-includes/block-patterns.php)
36+
- `the_weekday` — $the_weekday (wp-includes/general-template.php)
37+
38+
## Missing Original Since
39+
40+
Hooks where all `@since` tags have descriptions, indicating the original version is missing.
41+
42+
- `{$action}_prefilter` (wp-admin/includes/file.php)
43+
- `password_reset_key_expired` (wp-includes/user.php)
44+
2745
## Param Count Mismatches
2846

2947
Hooks where the number of `@param` tags does not match the `args` count.

scripts/generate-issues.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,45 @@ fi
9595

9696
echo "" >> "$OUTPUT_FILE"
9797

98+
# Empty Param Descriptions
99+
echo "## Empty Param Descriptions" >> "$OUTPUT_FILE"
100+
echo "" >> "$OUTPUT_FILE"
101+
echo "Hooks with \`@param\` tags that have an empty description." >> "$OUTPUT_FILE"
102+
echo "" >> "$OUTPUT_FILE"
103+
104+
EMPTY_PARAM_DESC_ACTIONS=$(jq -r '.hooks[] | .name as $name | .file as $file | .doc.tags[] | select(.name == "param" and (.content == "" or .content == null)) | "- `\($name)` — \(.variable) (\($file))"' hooks/actions.json 2>/dev/null | sort -u)
105+
EMPTY_PARAM_DESC_FILTERS=$(jq -r '.hooks[] | .name as $name | .file as $file | .doc.tags[] | select(.name == "param" and (.content == "" or .content == null)) | "- `\($name)` — \(.variable) (\($file))"' hooks/filters.json 2>/dev/null | sort -u)
106+
107+
EMPTY_PARAM_DESC=$(echo -e "${EMPTY_PARAM_DESC_ACTIONS}\n${EMPTY_PARAM_DESC_FILTERS}" | grep -v '^$' | sort -u)
108+
109+
if [ -n "$EMPTY_PARAM_DESC" ]; then
110+
echo "$EMPTY_PARAM_DESC" >> "$OUTPUT_FILE"
111+
else
112+
echo "_No hooks with empty param descriptions._" >> "$OUTPUT_FILE"
113+
fi
114+
115+
echo "" >> "$OUTPUT_FILE"
116+
117+
# Missing Original Since
118+
echo "## Missing Original Since" >> "$OUTPUT_FILE"
119+
echo "" >> "$OUTPUT_FILE"
120+
echo "Hooks where all \`@since\` tags have descriptions, indicating the original version is missing." >> "$OUTPUT_FILE"
121+
echo "" >> "$OUTPUT_FILE"
122+
123+
# Exclude hooks with @since MU (3.0.0) as this indicates the original multisite version
124+
MISSING_ORIG_SINCE_ACTIONS=$(jq -r '.hooks[] | select((.doc.tags | map(select(.name == "since" and .description == "MU (3.0.0)")) | length == 0) and (.doc.tags | map(select(.name == "since")) | length > 0) and (.doc.tags | map(select(.name == "since" and (.description == null or .description == ""))) | length == 0)) | "- `\(.name)` (\(.file))"' hooks/actions.json 2>/dev/null | sort -u)
125+
MISSING_ORIG_SINCE_FILTERS=$(jq -r '.hooks[] | select((.doc.tags | map(select(.name == "since" and .description == "MU (3.0.0)")) | length == 0) and (.doc.tags | map(select(.name == "since")) | length > 0) and (.doc.tags | map(select(.name == "since" and (.description == null or .description == ""))) | length == 0)) | "- `\(.name)` (\(.file))"' hooks/filters.json 2>/dev/null | sort -u)
126+
127+
MISSING_ORIG_SINCE=$(echo -e "${MISSING_ORIG_SINCE_ACTIONS}\n${MISSING_ORIG_SINCE_FILTERS}" | grep -v '^$' | sort -u)
128+
129+
if [ -n "$MISSING_ORIG_SINCE" ]; then
130+
echo "$MISSING_ORIG_SINCE" >> "$OUTPUT_FILE"
131+
else
132+
echo "_No hooks with missing original since version._" >> "$OUTPUT_FILE"
133+
fi
134+
135+
echo "" >> "$OUTPUT_FILE"
136+
98137
# Param Count Mismatches
99138
echo "## Param Count Mismatches" >> "$OUTPUT_FILE"
100139
echo "" >> "$OUTPUT_FILE"

0 commit comments

Comments
 (0)