WordPress / WordPress/WordPress-Coding-Standards

WordPress DocBlock: Period at the end of the summary

Open
#1,098 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: Docs
Dominant language
PHP
Stars
2.8k
Forks
521
Avg merge
5d 20h
Merged PRs (30d)
1

Description

I was recently doing a review of a pull request for _s where the period was missing at the end of the summary and WPCS was not picking up on it.

The other values in the DocBlock also require a period at the end of the line.

There is an existing sniff to check for inline comments Squiz.Commenting.InlineComment.InvalidEndChar but not for function DocBlocks.

https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/#docblock-formatting

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the existing Squiz.Commenting.InlineComment.InvalidEndChar sniff with the function DocBlock rules and the linked WordPress documentation. Identify the relevant sniff tests and add coverage showing that a function DocBlock summary without a final period is reported, while a correctly punctuated summary passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.