Skip to content

ci: lint with shared workflows and check formatting - #124

Merged
justlevine merged 1 commit into
mainfrom
ci/shared-lint-workflows
Nov 24, 2026
Merged

justlevine merged 1 commit into
mainfrom
ci/shared-lint-workflows

Conversation

@Adi-ty

@Adi-ty Adi-ty commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

What this PR does

Moves PHP and JS linting from hand-written jobs in test-measure.yml to the reusable workflows in rtCamp/wp-shared-workflows, and adds a Prettier formatting check to CI. The check covers the same files as npm run format. Follow-up to #121.

Closes

Closes #118

Changes

  • Call the shared PHPCS, PHPStan, and ESLint workflows pinned to v1.1.1.
  • Add npm run format:check and run it alongside ESLint in the shared lint job. Both checks report their results even if one fails.
  • Align .editorconfig with the formatter’s tab indentation for JSON and document the formatting commands.

How I verified

❯ composer validate --no-check-publish
./composer.json is valid
❯ composer lint
.................. 18 / 18 (100%)


Time: 1.59 secs; Memory: 22MB

❯ composer analyse
Note: Using configuration file /Users/adi/rtproj/wp-php-toolkit/phpstan.neon.dist.
  0/31 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
 31/31 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%


                                                                                                                        
 [OK] No errors                                                                                                         
                                                                                                                        

❯ npm run lint:js

> lint:js
> wp-scripts lint-js

❯ npm run format:check

> format:check
> prettier --check --ignore-path .prettierignore '**/*.{cjs,cts,js,json,jsx,mjs,mts,ts,tsx,yml,yaml,md}'

Checking formatting...
All matched files use Prettier code style!
❯ actionlint .github/workflows/test-measure.yml

Acceptance criteria

Runtime behavior

  • The lint jobs call the shared workflows.
  • The formatting check passes with the repo’s WordPress Prettier config.
  • The existing PHPUnit matrix retains its PHP 8.4 / WordPress 7.1 coverage run.

Code quality

  • Lint — zero errors
  • Static analysis — zero errors
  • Tests pass

Housekeeping

  • The proposed PR title is a Conventional Commit.

Reviewer notes

  • wp-shared-workflows #63 keeps PHPStan running after a PHPCS failure. Once released, we can update the pinned lint workflow to pick up the fix.
  • wp-shared-workflows #66 adds coverage reporting and changed-line coverage gating to wp-ci. Once released, we can migrate PHPUnit and coverage together and use wp-primitives for the end-to-end check.

Screenshots / terminal output

Copilot AI balanced review requested due to automatic review settings November 24, 2026 14:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@Adi-ty
Adi-ty requested a review from justlevine November 24, 2026 14:28
@justlevine
justlevine merged commit 30b22b9 into main Nov 24, 2026
29 checks passed
@justlevine
justlevine deleted the ci/shared-lint-workflows branch November 24, 2026 16:14
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.

Use wp-tooling for lints

4 participants