Skip to content

Ensure PHPCS cache directory is tracked and fix docblock typos - #357

Open
sonali195 wants to merge 2 commits into
WordPress:masterfrom
sonali195:fix/phpcs-cache-and-docs
Open

sonali195 wants to merge 2 commits into
WordPress:masterfrom
sonali195:fix/phpcs-cache-and-docs

Conversation

@sonali195

Copy link
Copy Markdown

Description

This pull request provides maintenance improvements for local development and documentation:

  1. PHPCS Cache Directory Tracking:

    • phpcs.xml.dist configures <arg name="cache" value=".cache/phpcs.json"/>. On fresh checkouts, .cache/ did not exist, causing composer lint / phpcs to fail with ERROR: The specified cache file path ".cache/phpcs.json" points to a non-existent directory.
    • Added .cache/.gitkeep and updated .gitignore (.cache/*, !.cache/.gitkeep) so the directory is always tracked and available without needing script-level directory guards.
  2. Cross-Platform Line Ending Normalization:

    • Added .gitattributes to normalize text files to LF (eol=lf), preventing line-ending sniff errors (Generic.Files.LineEndings.InvalidEOLChar) on Windows checkouts.
  3. Documentation & Docblock Fixes:

    • Fixed a header typo in report.php (PHPUnity -> PHPUnit).
    • Corrected inaccurate docblock comments in functions.php for setup_runner_env_vars() (which previously contained Gutenberg block delimiter descriptions) and updated @type bool $WPT_DEBUG_MODE to $WPT_DEBUG.
    • Updated a misleading comment regarding TLS certificates in prepare.php.

No core test runner functions or runtime behaviors were modified.

Testing Instructions

  1. Clone the repository into a clean directory.
  2. Run composer install.
  3. Run composer lint:errors to verify all PHPCS checks pass.

@github-actions

github-actions Bot commented Oct 15, 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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: sonali195 <sonaliprajapati@git.wordpress.org>
Co-authored-by: ekamran <ekamran@git.wordpress.org>
Co-authored-by: kittenkamala <amykamala@git.wordpress.org>

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@ekamran ekamran left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on a fresh checkout: on master composer lint:errors fails because .cache/ does not exist, and with this PR it passes. The functions.php changes outside the docblock are whitespace only, and the docblock now matches setup_runner_env_vars(). All tracked files are already stored with LF endings, so .gitattributes causes no renormalization diff, and eol=lf makes Windows checkouts use LF too. Thanks @sonali195.

@sonali195

Copy link
Copy Markdown
Author

Looks good to me. The PHP requirement is read from the cloned WordPress checkout and checked before the build. I found no issues.

@ekamran

ekamran commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Thanks @sonali195. I think this comment was meant for #360, which reads the minimum PHP version from the WordPress checkout before the build. If you meant it as a review of that PR, could you leave it on #360 instead?

@sonali195

Copy link
Copy Markdown
Author

Looks good to me. The PHP requirement is read from the cloned WordPress checkout and checked before the build. I found no issues.

@kittenkamala kittenkamala left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi - will you please separate the formatting/spacing fixes into it's own PR and remove from this one? Thank you!

@sonali195

Copy link
Copy Markdown
Author

I checked the diff and don’t see any formatting-only changes to separate. The changes appear to be limited to reading WordPress’s PHP requirement and checking it before the build. Could you point me to the formatting or spacing changes you’d like moved?

Comment thread .gitattributes
* text=auto eol=lf

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment isn't technically correct, as "native" varies by platform and this is forcing LF endings.

Aside from that, is this file/change needed? This is outside the scope of the PR described purpose of addressing PHPCS cache and typos. Unless there's a need for this file, I would prefer it not be introduced.

I'm not sure if it's the proper approach, and this is a different repo, but wordpress-develop uses the phpcs config to prevent sniff errors related to line endings and has a .editorconfig file.

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.

4 participants