Skip to content

Conversation

@jbampton
Copy link
Member

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
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.46%. Comparing base (f417c6b) to head (59e2d7f).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #12245   +/-   ##
=========================================
  Coverage     17.46%   17.46%           
+ Complexity    15516    15515    -1     
=========================================
  Files          5913     5913           
  Lines        529385   529385           
  Branches      64679    64679           
=========================================
+ Hits          92448    92449    +1     
+ Misses       426518   426517    -1     
  Partials      10419    10419           
Flag Coverage Δ
uitests 3.58% <ø> (ø)
unittests 18.52% <ø> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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
Copy link
Contributor

Copilot AI left a comment

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.

"linter": {
"rules": {
"suspicious": {
"noDuplicateObjectKeys": "off"
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

The noDuplicateObjectKeys linter rule is disabled. This rule detects duplicate keys in JSON objects, which can lead to unexpected behavior since only the last value will be retained. Consider enabling this rule to catch potential issues in locale files where duplicate keys might be accidentally introduced.

Suggested change
"noDuplicateObjectKeys": "off"
"noDuplicateObjectKeys": "error"

Copilot uses AI. Check for mistakes.
"label.add.more": "Dodaj wi\u0119cej",
"label.add.netscaler.device": "Add Netscaler device",
"label.add.network": "Dodaj sie\u0107",
"label.add.network.acl": "Add network ACL",
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

Duplicate key detected: "label.add.network.acl" appears twice with different values ("Add network ACL" and "Add Network ACL"). In JSON, when duplicate keys exist, only the last value is used, which means the first entry on line 149 will be ignored. Remove the duplicate entry or rename one of the keys if they serve different purposes.

Suggested change
"label.add.network.acl": "Add network ACL",

Copilot uses AI. Check for mistakes.
Copy link
Member Author

@jbampton jbampton Dec 12, 2025

Choose a reason for hiding this comment

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

Pretty sure there was more than one duplicate key reported so I would prefer a separate PR to remove the duplicates if needed

@github-actions
Copy link

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

We can add Biome with pre-commit saving CI and developer time

2 participants