Skip to content

Add Pantheon-WP coding standards for comment usage#19

Merged
jazzsequence merged 21 commits intomainfrom
1-multiline-comments
Jul 18, 2025
Merged

Add Pantheon-WP coding standards for comment usage#19
jazzsequence merged 21 commits intomainfrom
1-multiline-comments

Conversation

@jazzsequence
Copy link
Contributor

@jazzsequence jazzsequence commented Jul 18, 2025

This PR adds a new sniff enforcing commenting guidelines.
Multiple consecutive // comments reports a WARNING in Pantheon-WP-Minimum and an ERROR in Pantheon-WP.
Long /* ... */ comments (> 80 columns) reports an ERROR in Pantheon-WP.

Test framework has been updated to support passing the specific ruleset in to test the sniffs against those rules.
Composer scripts have been added to make it easier to test the sniffs and run the tests against specific rulesets.

fixes #1

we're redeclaring in Pantheon-WP with a higher severity
We need to redeclare because we're redeclaring the parent rulesets
Introduces the new `DisallowMultilineSlashCommentSniff` to improve comment consistency and readability.

This sniff performs two main checks:
- It flags consecutive single-line `//` comments, enforcing the use of `/* ... */` block syntax for multiline comments.
- It issues a warning for any comment line that exceeds 80 characters to encourage better formatting.
so we can test things manually easier
@jazzsequence jazzsequence requested a review from a team as a code owner July 18, 2025 18:33
@jazzsequence jazzsequence merged commit 79ee409 into main Jul 18, 2025
5 checks passed
@jazzsequence jazzsequence deleted the 1-multiline-comments branch July 18, 2025 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enforce rule on multiline comments

1 participant