-
Notifications
You must be signed in to change notification settings - Fork 1.3k
pre-commit add Biome auto format ui/public/locales JSON #12245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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" |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
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.
| "noDuplicateObjectKeys": "off" | |
| "noDuplicateObjectKeys": "error" |
| "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", |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
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.
| "label.add.network.acl": "Add network ACL", |
There was a problem hiding this comment.
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
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
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
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
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?