Skip to content

Build/Test Tools: Add descriptions for all registered Grunt tasks. - #13915

Open
Sabbir345 wants to merge 2 commits into
WordPress:trunkfrom
Sabbir345:65858-grunt-task-descriptions
Open

Sabbir345 wants to merge 2 commits into
WordPress:trunkfrom
Sabbir345:65858-grunt-task-descriptions

Conversation

@Sabbir345

@Sabbir345 Sabbir345 commented Oct 2, 2026 •

Copy link
Copy Markdown

Adds a description to the 30 Grunt tasks in Gruntfile.js that are registered without one, so that every task has a meaningful entry in grunt --help.

When grunt.registerTask() is called without a description, Grunt falls back to a generic one: Custom task. for function tasks, or Alias for "…" tasks. listing the subtasks for alias tasks. On current trunk, 31 of the 49 registered tasks show one of these placeholders.

Notes

  • This is a documentation-only change. No task lists, task functions, or options were changed. The description is the only argument added to each registerTask() call.
  • Existing docblocks (verify:build, verify:old-files, verify:source-maps, build:gutenberg) are kept, and each task's description summarizes its docblock.
  • The apply alias is left unchanged. Grunt already describes it as Alias for "patch" task., which is accurate.
  • Descriptions follow the style of the existing ones, for example Runs QUnit tests.. Where a task has a notable option or requirement, it is mentioned:
  • build: the --dev option.
  • watch: the watch:phpunit target and the --phpunit option.
  • precommit:emoji: the GitHub CLI requirement.

Testing Instructions

  1. Install the dependencies with npm ci.
  2. On trunk, run npx grunt --help and look at the Available tasks section. Tasks such as build, watch, and verify:old-files show Custom task., and tasks such as rtl, build:css, and precommit:js show a generated Alias for "…" tasks. list.
  3. Check out this branch and run npx grunt --help again. Every task defined in Gruntfile.js now has a descriptive entry. apply still shows Alias for "patch" task..
  4. Run npx grunt jshint:grunt to confirm that the Gruntfile still lints cleanly.

Evidence

Generic placeholder descriptions in the output of npx grunt --help:

Branch Custom task. Alias for "…"
trunk 4 27
this branch 0 1 (apply, intentional)

Before (trunk), excerpt

            rtl  Alias for "rtlcss:core", "rtlcss:colors" tasks.
         colors  Alias for "sass:colors", "postcss:colors" tasks.
   jshint:corejs  Alias for "jshint:grunt", "jshint:tests", ...
         watch  Custom task.
   precommit:js  Alias for "webpack:prod", "jshint:corejs", "lint:jsdoc", ...
      build:css  Alias for "clean:css", "copy:wp-admin-css-compat-rtl", ...
   verify:build  Alias for "verify:old-files", "verify:source-maps" tasks.
verify:old-files  Custom task.
build:gutenberg  Alias for "clean:gutenberg", "copy:gutenberg-php", ...
         build  Custom task.
      prerelease  Alias for "format:php:error", "precommit:php", ...
         default  Alias for "build" task.

After (this branch), excerpt

            rtl  Generates right-to-left (RTL) stylesheets for core and the admin color schemes.
         colors  Compiles and processes the admin color scheme stylesheets.
   jshint:corejs  Runs JSHint on the Gruntfile, tests, bundled themes, and core JavaScript files.
         watch  Watches files for changes and runs the related tasks. Use watch:phpunit or --phpunit to also run PHPUnit tests.
   precommit:js  Builds, lints, type checks, and tests JavaScript files in preparation for a commit.
      build:css  Builds all CSS files, including the RTL and admin color scheme stylesheets.
   verify:build  Runs all build verification tasks.
verify:old-files  Verifies that no files listed in $_old_files exist in the build directory.
build:gutenberg  Refreshes the Gutenberg-sourced content in src/.
         build  Builds WordPress. Use --dev to build into src/ for development.
      prerelease  Runs formatting checks, linting, tests, and image optimization in preparation for a release.
         default  Runs the build task.

Lint

$ npx grunt jshint:grunt
Running "jshint:grunt" (jshint) task
>> 1 file lint free.

Done.

Trac ticket: #65858

Use of AI Tools

  • AI assistance: Yes
  • Tool(s): Claude Code
  • Model(s): Claude Opus 5.5
  • Used for: Auditing which tasks lacked descriptions, drafting the descriptions, and drafting this PR description. I reviewed each description against the task's implementation and verified the grunt --help output and linting locally.

This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Adds a description to the 30 Grunt tasks that were registered without one, so that every task is described in the output of `grunt --help`. Existing docblocks are kept. The `apply` alias is left unchanged because Grunt already describes it as an alias for the `patch` task.

This is a documentation-only change. No task lists or task functions were changed.

See #65858.
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props sabbir345.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

2 participants