Skip to content

Add Prettier and format the People Portal - #99

Merged
IanCou merged 8 commits into
masterfrom
chore/prettier-write
Oct 20, 2026
Merged

IanCou merged 8 commits into
masterfrom
chore/prettier-write

Conversation

@IanCou

@IanCou IanCou commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

What

Adds Prettier to the People Portal and formats peopleportal/webui/src and peopleportal/server/src with it. Commits are split so the config, the mechanical reformat and the CI changes can be reviewed separately:

  1. Config: .prettierrc is Prettier's defaults with a 4-space tab width ({ "tabWidth": 4 }). .prettierignore skips:

    • the 14 Handlebars email templates that use partials ({{> header}}), which Prettier cannot parse (header.hbs and footer.hbs stay checked),
    • peopleportal/server/src/routes.ts, which tsoa spec-and-routes regenerates on every build,
    • landing-v3/, which is intentionally not formatted.
  2. Formatting: the result of running prettier --write over the two source folders. Formatting only, no behaviour changes.

  3. CI check: .github/workflows/pr_checks.yml (renamed from pr_build.yml) is now the one workflow that runs on People Portal pull requests, "People Portal PR Checks", with three jobs that run in parallel: Format (Prettier) runs prettier --check on peopleportal/webui/src and peopleportal/server/src, pinned to Prettier 3.9.10 so a new release cannot change the result; Build (Nx) runs ./nx run-many -t build -p pplserver pplui; and Test (Nx) runs pplserver:test-unit and pplui:test. It no longer builds landing-v3, and it triggers on peopleportal/**, the Nx files and the Prettier config. On merge, the existing deploy_peopleportal.yml is the only workflow that runs. To fix a format failure: npx prettier@3.9.10 --write peopleportal/webui/src peopleportal/server/src. The check names change from PR Build Check / build, so update any branch protection rule that requires the old name.

Verification

  • prettier --check passes on peopleportal/webui/src and peopleportal/server/src.
  • ./nx run-many -t build -p pplserver pplui succeeds.
  • pplserver:test-unit: 115 of 115 pass. pplui:test: 29 of 29 pass.
  • Nothing outside peopleportal/ is modified besides the two config files.

Things to know

  • Size: 153 files, about 23,000 lines added and 14,500 removed. Review the config commit on its own and skim the formatting commit with git diff -w or "Hide whitespace".
  • Blame: git blame will show the formatting commit for the lines it touched. There is no .git-blame-ignore-revs in this PR.
  • Open PRs: this will conflict with open branches that touch the same files (for example feat(recruitment): make applicant switching reliable #81). Authors can usually resolve by running npx prettier --write on their branch after rebasing.
  • Interfaces: Prettier writes ; between interface and type members, with no option for commas.
  • CI: this PR's own People Portal PR Checks run validates the formatting, the build and the tests.

🤖 Generated with Claude Code

Prettier defaults with a 4-space tab width. The ignore file skips the
Handlebars email templates that use partials (which Prettier cannot
parse), the generated tsoa routes.ts, and landing-v3.
Formatting only, no behaviour changes. Run with the .prettierrc added in
the previous commit over peopleportal/webui/src and peopleportal/server/src.
Copilot AI balanced review requested due to automatic review settings October 20, 2026 23:36

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 reached their quota limit.

Run prettier --check on the People Portal source for pull requests that
touch it, with Prettier pinned to 3.9.10 so a new release cannot change
the result.
Replace pr_build.yml and pr_format.yml with a single pr_checks.yml that
has a Prettier format job and an Nx build job, so both show up under one
workflow on the pull request.
Limit the workflow to the People Portal (drop landing-v3) and add the
server unit tests and UI tests next to the build, so there is one
workflow per pull request.
Make build-and-test depend on the Prettier job so a formatting failure
stops the PR checks early instead of running the slow build first.
Drop the dependency of the build on the format job and split build and
test into separate jobs, so a pull request gets all three results at
once.
The server test script passes a glob to node --test, which Node 20 does
not expand (the CI run failed with 'Could not find test/unit/**/*.test.js'),
and express-handlebars requires Node >=22.15.
@IanCou
IanCou merged commit 0036a24 into master Oct 20, 2026
3 checks passed
@IanCou
IanCou deleted the chore/prettier-write branch October 20, 2026 23:50
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.

2 participants