Skip to content

chore: add commitlint for conventional commit messages - #21

Merged
jkasprzyk17 merged 3 commits into
mainfrom
chore/add-commitlint
Jun 26, 2026
Merged

chore: add commitlint for conventional commit messages#21
jkasprzyk17 merged 3 commits into
mainfrom
chore/add-commitlint

Conversation

@jkasprzyk17

@jkasprzyk17 jkasprzyk17 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add @commitlint/cli and @commitlint/config-conventional with Husky commit-msg hook for local validation
  • Add CI job to validate commit messages on pull requests
  • Document conventional commit format in CONTRIBUTING.md

Closes #20

Test plan

  • echo "feat: test" | bun run commitlint passes
  • echo "bad message" | bun run commitlint fails with validation errors
  • CI commitlint job passes on this PR
  • bun install wires Husky commit-msg hook locally

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jkasprzyk17, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 04de0475-9828-466b-b77a-e9c2d0f52210

📥 Commits

Reviewing files that changed from the base of the PR and between acee4f7 and d551d53.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • CONTRIBUTING.md
  • package.json
📝 Walkthrough

Walkthrough

Adds 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.

Changes

Conventional commit enforcement

Layer / File(s) Summary
Commitlint setup
commitlint.config.js, package.json
The root package adds commitlint, format:check, and prepare scripts plus @commitlint/cli, @commitlint/config-conventional, and husky devDependencies; commitlint.config.js extends @commitlint/config-conventional.
Hook and CI validation
.husky/commit-msg, .github/workflows/ci.yml
The Husky commit-msg hook runs bunx commitlint --edit "$1", and the CI workflow adds a commitlint job for pull_request events.
Docs and config-file globals
CONTRIBUTING.md, eslint.config.mjs
CONTRIBUTING.md adds Conventional Commits guidance plus PR checklist updates, and ESLint adds Node globals for **/*.config.js files.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The added format:check script is unrelated to commitlint and goes beyond #20. Remove the unrelated format:check addition or justify it in the issue scope.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the commitlint change, though it is a bit long.
Description check ✅ Passed The description directly summarizes the commitlint hook, CI, and docs changes.
Linked Issues check ✅ Passed The PR implements #20: dev deps, config, Husky hook, CI check, and commit format docs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 893f71c and 399b4b3.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .github/workflows/ci.yml
  • .husky/commit-msg
  • CONTRIBUTING.md
  • commitlint.config.js
  • package.json

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml Outdated
Comment on lines +15 to +20
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Bun
uses: oven-sh/setup-bun@v2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 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

Comment thread commitlint.config.js
Comment thread CONTRIBUTING.md Outdated
Comment on lines +42 to +54
```
<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
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 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.

Suggested change
```
<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

@jkasprzyk17
jkasprzyk17 merged commit 5d60983 into main Jun 26, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add commitlint for conventional commit messages

1 participant