Add Biome pre-commit hook#238
Conversation
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Secrets | May 13, 2026 5:42a.m. | Review ↗ | |
| Python | May 13, 2026 5:42a.m. | Review ↗ | |
| JavaScript | May 13, 2026 5:42a.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.
There was a problem hiding this comment.
Code Review
This pull request integrates Biome into the project's pre-commit workflow and adds a biome.json configuration file for formatting and linting. Feedback was provided to correct the biome.json structure by using the ignore field instead of unsupported negative patterns in includes. Additionally, it was suggested to expand the file regex in the pre-commit configuration to cover a broader range of supported web assets like TypeScript and JSX.
| "includes": [ | ||
| "**", | ||
| "!docs/bootstrap", | ||
| "!docs/featured.json", | ||
| "!docs/manifest.json", | ||
| "!docs/users.json" | ||
| ] |
There was a problem hiding this comment.
Biome uses the singular include key instead of includes. Furthermore, Biome does not support negative patterns (starting with !) within the include array. To exclude specific files or directories, you should use the ignore field. Since include defaults to all files in the project, you can simply provide the ignore list to achieve the desired filtering.
"ignore": [
"docs/bootstrap",
"docs/featured.json",
"docs/manifest.json",
"docs/users.json"
]| name: run biome | ||
| description: format and lint web assets with Biome | ||
| entry: biome check --write --files-ignore-unknown=true | ||
| files: \.(css|js|json)$ |
There was a problem hiding this comment.
The current regex only matches .css, .js, and .json files. Biome supports a wider range of web-related extensions including TypeScript (.ts, .tsx), JSX (.jsx), and various module formats (.mjs, .cjs). Consider expanding the regex to ensure these files are also processed if they exist in the project.
files: \.(css|js|jsonc?|jsx?|tsx?|m[jt]s|c[jt]s)$0fe74a4 to
630a005
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces Biome as a formatter/linter for web assets in the repository and wires it into the existing pre-commit setup, while keeping the current YAML formatting/linting hooks intact.
Changes:
- Added a root
biome.jsonconfiguration to define shared formatting defaults and enable Biome’s recommended lint rules. - Added a local
pre-commithook to runbiome check --writeon staged CSS/JS/JSON files (with Biome pinned as a Node dependency).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
biome.json |
Adds Biome configuration for formatting defaults and recommended linting. |
.pre-commit-config.yaml |
Adds a local Node-based Biome hook for CSS/JS/JSON while retaining existing YAML Prettier/yamllint hooks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Follow-up pushed in 43e0211:
Verification:
|
Summary
biome.jsonwith shared formatting defaults for web assetsbiomejs/pre-commithook for CSS, JS, JSON, and related filesVerification
npx --yes @biomejs/biome@2.3.8 check --write --files-ignore-unknown=true ..pre-commit-config.yamlwith PyYAMLgit diff --checkgit diff --check HEAD~1..HEADFixes #120