chore: add Biome pre-commit hook#230
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces Biome for linting and formatting by adding a new pre-commit hook and a corresponding biome.json configuration file. The review feedback suggests expanding the file extensions targeted by the pre-commit hook to include formats like .mjs and .jsonc. Additionally, several corrections were identified in the Biome configuration, including fixing the "include" property name, utilizing the "ignore" field for exclusions, and reconsidering the disabling of recommended correctness rules to maintain higher code quality.
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Secrets | Apr 29, 2026 3:11a.m. | Review ↗ | |
| Python | Apr 29, 2026 3:11a.m. | Review ↗ | |
| JavaScript | Apr 29, 2026 3:11a.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
jbampton
left a comment
There was a problem hiding this comment.
https://github.com/biomejs/pre-commit#using-biomes-pre-commit-hooks
Biome is not installed so we don't want a local hook.
Please use the standard biome hook. Thanks
|
Updated to use the standard Biome pre-commit hook from biomejs/pre-commit as requested, and expanded the file pattern to cover common Biome-supported extensions. I also re-validated the updated pre-commit config locally with pre-commit. One unrelated local environment limitation remains: the repo currently pins the isort pre-commit hook to a version that requires Python >=3.10, while this machine has Python 3.9, so a full pre-commit run could not complete here. Please take another look when you have a chance — happy to make any further adjustments. |
|
You can install a newer version of Python. @santoslgl01-web what OS are you using ? |
There was a problem hiding this comment.
Pull request overview
Adds Biome to the repository to standardize formatting/linting for frontend assets and integrates it into the existing pre-commit workflow (Issue #120).
Changes:
- Introduce a
biome.jsonconfiguration (formatting, lint rules, import organization). - Add a Biome
pre-commithook to run checks/fixes on JS/TS/JSON/CSS-family files. - Exclude
docs/users.jsonfrom the Biome hook (and attempt to exclude some paths in Biome config).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| biome.json | Adds Biome configuration for formatting/linting and file targeting. |
| .pre-commit-config.yaml | Registers the Biome hook in the pre-commit pipeline with file filters and excludes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| "$schema": "https://biomejs.dev/schemas/2.3.8/schema.json", | ||
| "files": { | ||
| "includes": ["**", "!docs/images", "!.git"] |
There was a problem hiding this comment.
docs/users.json is excluded only in the pre-commit hook, but not in Biome’s own file include/exclude rules. That means running Biome directly (e.g. biome check --write .) could still reformat this generated file, which contradicts the PR summary and the existing .prettierignore behavior. Consider excluding docs/users.json in biome.json as well so manual/local Biome runs and CI behave consistently with pre-commit.
| "includes": ["**", "!docs/images", "!.git"] | |
| "includes": ["**", "!docs/images", "!docs/users.json", "!.git"] |
| - repo: https://github.com/biomejs/pre-commit | ||
| rev: v2.3.8 | ||
| hooks: |
There was a problem hiding this comment.
PR description says Biome is wired into pre-commit via a “local Node hook”, but the change uses the upstream biomejs/pre-commit repo hook instead. Please either update the PR description to match the actual implementation or switch to a local hook if that’s a requirement (e.g., to avoid depending on the remote hook repository).
|
Thanks for the review. I’m working on updating this from a newer Python environment so I can rerun the repo’s expected tooling cleanly. For reference, I’m on macOS (Darwin arm64). I’ll push a follow-up once the requested changes are addressed. |
Summary
Fixes #120
Testing