chore: add commitlint for conventional commit messages - #21
Conversation
|
Warning Review limit reached
More reviews will be available in 17 minutes and 20 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds commitlint-based Conventional Commits enforcement through package scripts and config, a Husky commit-msg hook, a pull-request CI check, ESLint support for config files, and CONTRIBUTING.md updates for commit format and PR commit rules. ChangesConventional commit enforcement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 10-25: The commitlint job in the CI workflow should be hardened by
reducing default token scope and preventing checkout credentials from being
reused during PR-controlled install steps. Update the workflow’s commitlint job
to add a minimal permissions block and adjust the Checkout step in
actions/checkout@v4 to avoid persisting credentials, while keeping the existing
setup in commitlint and bun install intact.
- Around line 15-20: The workflow still uses mutable action tags in the checkout
and Bun setup steps, so update the actions referenced by actions/checkout and
oven-sh/setup-bun to their full commit SHAs instead of version tags. Keep the
same workflow structure and step names, but replace each uses: entry with the
corresponding pinned SHA to satisfy the SHA-pinning policy.
In `@commitlint.config.js`:
- Around line 1-4: The commitlint config is using CommonJS syntax in a
JavaScript file that is not covered by the current ESLint Node globals override,
so `module` is flagged as undefined. Fix this by either renaming the
`commitlint.config.js` file to `commitlint.config.cjs` so it is treated as
CommonJS, or by updating the flat ESLint config to add a Node/CommonJS override
for config files; keep the existing `module.exports` in `commitlint.config`
aligned with whichever approach you choose.
In `@CONTRIBUTING.md`:
- Around line 42-54: The fenced code examples in the commit message section are
missing language identifiers, which is causing markdownlint failures. Update the
two fenced blocks in the CONTRIBUTING guidance to use the same language tag,
using the existing commit message example block markers around the format
template and examples. Keep the content unchanged and just add the appropriate
fence language to the relevant markdown snippets.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d4178330-bd2c-4836-a807-bf1896bdcc63
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
.github/workflows/ci.yml.husky/commit-msgCONTRIBUTING.mdcommitlint.config.jspackage.json
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v2 |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Locate workflow and show relevant lines with numbers.
git ls-files '.github/workflows/ci.yml'
echo '---'
wc -l .github/workflows/ci.yml
echo '---'
cat -n .github/workflows/ci.yml | sed -n '1,120p'Repository: gmi-software/react-native-nitro-maps
Length of output: 1874
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Locate workflow and show relevant lines with numbers.
git ls-files '.github/workflows/ci.yml'
echo '---'
wc -l .github/workflows/ci.yml
echo '---'
cat -n .github/workflows/ci.yml | sed -n '1,120p'Repository: gmi-software/react-native-nitro-maps
Length of output: 1874
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Locate workflow and show relevant lines with numbers.
git ls-files '.github/workflows/ci.yml'
echo '---'
wc -l .github/workflows/ci.yml
echo '---'
cat -n .github/workflows/ci.yml | sed -n '1,120p'Repository: gmi-software/react-native-nitro-maps
Length of output: 1874
🏁 Script executed:
#!/bin/bash
set -euo pipefail
git ls-files '.github/workflows/ci.yml'
echo '---'
wc -l .github/workflows/ci.yml
echo '---'
cat -n .github/workflows/ci.yml | sed -n '1,120p'Repository: gmi-software/react-native-nitro-maps
Length of output: 1874
Pin these Actions to full SHAs. actions/checkout@v4 and oven-sh/setup-bun@v2 are still mutable tags, so this workflow keeps violating the SHA-pinning policy until both uses: entries are locked down.
🧰 Tools
🪛 zizmor (1.26.1)
[error] 15-15: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 20-20: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/ci.yml around lines 15 - 20, The workflow still uses
mutable action tags in the checkout and Bun setup steps, so update the actions
referenced by actions/checkout and oven-sh/setup-bun to their full commit SHAs
instead of version tags. Keep the same workflow structure and step names, but
replace each uses: entry with the corresponding pinned SHA to satisfy the
SHA-pinning policy.
Source: Linters/SAST tools
| ``` | ||
| <type>[optional scope]: <description> | ||
| ``` | ||
|
|
||
| Common types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`. | ||
|
|
||
| Examples: | ||
|
|
||
| ``` | ||
| feat: add marker clustering support | ||
| fix(ios): correct viewport filter for wrapped longitudes | ||
| chore: add commitlint configuration | ||
| ``` |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add fence languages so the docs stop tripping markdownlint.
Both new fenced blocks are missing a language tag. Use text here and be done with it.
Suggested fix
-```
+```text
<type>[optional scope]: <description>@@
- +text
feat: add marker clustering support
fix(ios): correct viewport filter for wrapped longitudes
chore: add commitlint configuration
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ``` | |
| <type>[optional scope]: <description> | |
| ``` | |
| Common types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`. | |
| Examples: | |
| ``` | |
| feat: add marker clustering support | |
| fix(ios): correct viewport filter for wrapped longitudes | |
| chore: add commitlint configuration | |
| ``` |
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 42-42: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
[warning] 50-50: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@CONTRIBUTING.md` around lines 42 - 54, The fenced code examples in the commit
message section are missing language identifiers, which is causing markdownlint
failures. Update the two fenced blocks in the CONTRIBUTING guidance to use the
same language tag, using the existing commit message example block markers
around the format template and examples. Keep the content unchanged and just add
the appropriate fence language to the relevant markdown snippets.
Source: Linters/SAST tools
Summary
@commitlint/cliand@commitlint/config-conventionalwith Huskycommit-msghook for local validationCONTRIBUTING.mdCloses #20
Test plan
echo "feat: test" | bun run commitlintpassesecho "bad message" | bun run commitlintfails with validation errorscommitlintjob passes on this PRbun installwires Huskycommit-msghook locally