Skip to content

Added pre-commit config for formatting the UI code#4974

Merged
ChrisSmithCGI merged 3 commits into
mainfrom
4955-ui-code-requires-formatting-npx-format
Jul 15, 2026
Merged

Added pre-commit config for formatting the UI code#4974
ChrisSmithCGI merged 3 commits into
mainfrom
4955-ui-code-requires-formatting-npx-format

Conversation

@ChrisSmithCGI

Copy link
Copy Markdown
Collaborator

Resolves #4955

What is being addressed

Added a prettier pre-commit hook for formatting the frontend codebase

How is this addressed

  • Describe the changes made, and if appropriate, why they are addressed this way
  • Note any pending work (with links to the issues that will address them)
  • Update documentation
  • Update CHANGELOG.md if needed
  • Increment template version if needed, for guidelines see Authoring templates - versioning

Copilot AI review requested due to automatic review settings July 15, 2026 09:37
@ChrisSmithCGI ChrisSmithCGI requested a review from a team as a code owner July 15, 2026 09:37
@ChrisSmithCGI ChrisSmithCGI self-assigned this Jul 15, 2026
@ChrisSmithCGI ChrisSmithCGI force-pushed the 4955-ui-code-requires-formatting-npx-format branch from a9b7a29 to 48ad36d Compare July 15, 2026 09:40

Copilot AI 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.

Pull request overview

Adds automated UI code formatting by wiring Prettier into the repository’s pre-commit workflow, and aligns UI formatting defaults/versioning with that change.

Changes:

  • Add a Prettier pre-commit hook scoped to the UI app directory.
  • Update the UI Prettier configuration (trailing commas + print width).
  • Bump the UI package version and record the enhancement in the changelog.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

File Description
ui/app/package.json Bumps UI package version to reflect the formatting tooling change.
ui/app/.prettierrc Extends Prettier formatting rules used for UI code.
CHANGELOG.md Notes the new pre-commit-based UI formatting support under Enhancements.
.pre-commit-config.yaml Adds a Prettier hook to run on ui/app files during pre-commit.
Files not reviewed (1)
  • ui/app/package-lock.json: Generated file

Comment thread ui/app/package.json
Comment thread .pre-commit-config.yaml
Comment thread .pre-commit-config.yaml Outdated
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

Unit Test Results

241 tests   241 ✅  21s ⏱️
 27 suites    0 💤
  1 files      0 ❌

Results for commit 54b1eb4.

♻️ This comment has been updated with latest results.

@marrobi marrobi left a comment

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.

Easier to review! LGTM.

@JC-wk JC-wk 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.

LGTM
Interested to hear opinions on printWidth (120 was my suggestion)
can be tested with
pre-commit run --all-files
and comparing the changes

@ChrisSmithCGI

Copy link
Copy Markdown
Collaborator Author

LGTM Interested to hear opinions on printWidth (120 was my suggestion) can be tested with pre-commit run --all-files and comparing the changes

From memory, or at least this was what was explained to me when I was new, 80 characters at size 14 font printed without wrapping on A4 back when people used to print project reports for architectural reviews.

.. or something like that. My personal .dotfiles usually specify 120 as the soft wrap and 160 as the hard wrap. Since most of us don't print code any more, I think it mostly falls to team preference - with the only real physical driver potentially being how much code can be fit on a half screen without wrapping. If there is no strong opinion, then someone needs to make a decision (/ht @JC-wk) or the defaults should be used. There are couple of prettier plugins that adjust that rule to accommodate framework nuances / eccentricities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI code requires formatting (npx format)

4 participants