Skip to content

pre-commit add Biome auto format ui/public/locales JSON; update the hooks with --freeze - #12245

Open
jbampton wants to merge 4 commits into
apache:mainfrom
jbampton:pre-commit-add-biome
Open

jbampton wants to merge 4 commits into
apache:mainfrom
jbampton:pre-commit-add-biome

Conversation

@jbampton

@jbampton jbampton commented Dec 11, 2025 •

Copy link
Copy Markdown
Member

https://github.com/biomejs/pre-commit/releases/tag/v2.6.7

updated the hooks with prek autoupdate --freeze

Description

Indentation in JSON is optional for the format to be valid, as whitespace is generally insignificant to JSON parsers. However, it is a best practice to indent JSON to make it human-readable and maintainable, especially for configuration files or debugging purposes.

Tools for Formatting: Most programming languages and code editors provide built-in tools or libraries to automatically format or "beautify" JSON with a specified indentation level

We had most of these JSON files with no indents and some with 2 spaces.

Some had minor whitespace inconsistencies in some places.

This PR closes #12244 and we can work on this Biome config more in future PRs.

For example rules can be set or disabled for individual file types etc.

Auto formatting saves time.

Really just whitespace standardization

refs #11277

If this PR is not preferred we may be able to use "flat" JSON for these file with no indents

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

With pre-commit. First run the files were formatted and second time pre-commit passed.

Will just work on the GHA CI with pass or fail.

How did you try to break this feature and the system with this change?

@codecov

codecov Bot commented Dec 11, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 20.77%. Comparing base (c5bd11a) to head (4158fd8).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #12245   +/-   ##
=========================================
  Coverage     20.77%   20.77%           
  Complexity    20855    20855           
=========================================
  Files          6053     6053           
  Lines        548230   548230           
  Branches      73237    73237           
=========================================
+ Hits         113903   113911    +8     
+ Misses       420988   420973   -15     
- Partials      13339    13346    +7     
Flag Coverage Δ
uitests 3.86% <ø> (ø)
unittests 22.21% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jbampton
jbampton marked this pull request as draft December 11, 2025 19:35

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

This PR adds Biome as a pre-commit hook to automatically format JSON locale files in ui/public/locales/. The changes standardize indentation to 2 spaces across all JSON files, improving consistency and maintainability.

Key Changes:

  • Added Biome formatter configuration with 2-space indentation
  • Configured pre-commit hook to run Biome on locale JSON files
  • Reformatted existing locale files (zh_CN.json, pl.json, hi.json) to use consistent 2-space indentation

Reviewed changes

Copilot reviewed 2 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.github/linters/biome.json New Biome configuration file defining formatting rules and disabling duplicate key detection
.pre-commit-config.yaml Added Biome pre-commit hook targeting locale JSON files
ui/public/locales/zh_CN.json Reformatted with consistent 2-space indentation, fixed spacing around colons
ui/public/locales/pl.json Reformatted entire file with 2-space indentation (previously had inconsistent/no indentation)
ui/public/locales/hi.json Reformatted entire file with 2-space indentation (previously had inconsistent/no indentation)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/linters/biome.json Resolved
Comment thread ui/public/locales/pl.json Resolved
@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@DaanHoogland

Copy link
Copy Markdown
Contributor

@shwstppr @sureshanaparti this has conflicts because the json is not indented in our code. I think we should actually but it will be quite a discipline to change, What do you think? cc the rest of the world.

@DaanHoogland DaanHoogland linked an issue Mar 3, 2026 that may be closed by this pull request
@shwstppr

shwstppr commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

@DaanHoogland @jbampton I'm fine with having indentation, but I think the change should go in the 4.20 branch otherwise it would be regular conflicts during forward merges

@jbampton
jbampton marked this pull request as draft March 31, 2026 10:08
@weizhouapache weizhouapache added this to the 4.24.0 milestone Jun 29, 2026
@DaanHoogland DaanHoogland moved this from Backlog to conflict/waiting for author in CloudStack Testing Aug 31, 2026
@nvazquez

Copy link
Copy Markdown
Contributor

Hi @jbampton can you please address the conflicts?

@nvazquez nvazquez modified the milestones: 24.0, 25.0 Oct 29, 2026
# Conflicts:
#	.pre-commit-config.yaml
#	ui/public/locales/el_GR.json
#	ui/public/locales/en.json
#	ui/public/locales/pt_BR.json
@jbampton jbampton changed the title pre-commit add Biome auto format ui/public/locales JSON pre-commit add Biome auto format ui/public/locales JSON; update the hooks with --freeze Nov 15, 2026

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.

🟢 Approval recommended

No active review issues block the locale-formatting and pre-commit changes.

No open issues 🎉

Review effort: Balanced

@jbampton
jbampton marked this pull request as ready for review November 15, 2026 07:47
@jbampton
jbampton requested a review from nvazquez November 15, 2026 07:49
@jbampton jbampton moved this from conflict/waiting to Ready in CloudStack Testing Nov 15, 2026
@jbampton jbampton moved this from Ready to In review in CloudStack Testing Nov 15, 2026
@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

This branch has not been deployed

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

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

We can add Biome with pre-commit saving CI and developer time Question: Should we allow duplicate keys in our JSON objects ?

6 participants