Skip to content

chore(infra): set up branch+PR workflow with pre-commit and CI lint#1

Open
dev-hjJoo wants to merge 3 commits intomainfrom
chore/pr-review-lint-setup
Open

chore(infra): set up branch+PR workflow with pre-commit and CI lint#1
dev-hjJoo wants to merge 3 commits intomainfrom
chore/pr-review-lint-setup

Conversation

@dev-hjJoo
Copy link
Copy Markdown
Owner

@dev-hjJoo dev-hjJoo commented Apr 23, 2026

Summary

  • Adopt a branch + pull request workflow for all changes (no direct commits to main).
  • Add pre-commit hooks for markdown style, commit-message convention, and basic hygiene.
  • Add a CI workflow that runs pre-commit on every PR / push and lints the PR title for Conventional Commits compliance.
  • Note that CodeRabbit provides automated code review and update CONTRIBUTING / WORKFLOW / README accordingly.

Why

CodeRabbit is already wired in on this repo. The remaining gap was (1) not requiring PRs at all, and (2) no local or CI linting. This PR closes both — CodeRabbit handles review, pre-commit + CI handle mechanical checks.

Changes

File Purpose
.pre-commit-config.yaml Local hooks: whitespace, large-file guard, YAML/JSON, markdownlint-cli2, conventional-pre-commit
.markdownlint.yaml Relaxed rules (MD013/MD033/MD041/MD024/MD034/MD036/MD040) to fit our frontmatter + tables + inline HTML
.github/workflows/ci.yml lint job (pre-commit on all files) + pr-title job (semantic PR title)
CONTRIBUTING.md Pre-commit setup instructions, branch+PR flow, CodeRabbit mention, checklist update
00_meta/WORKFLOW.md Commit / PR rule updated to require branch+PR
README.md One-line pointer to new flow

Test plan

  • CodeRabbit posts an automated review on this PR
  • CI lint job passes (pre-commit run --all-files)
  • CI pr-title job passes (this PR title follows Conventional Commits)
  • Locally: pre-commit install && pre-commit install --hook-type commit-msg && pre-commit run --all-files succeeds
  • Try opening a dummy commit with a bad message to verify commit-msg hook blocks it

Notes

  • Squash merge recommended — PR title becomes the main history entry.
  • If pre-commit hook versions drift, run pre-commit autoupdate and commit the result.

Summary by CodeRabbit

  • Chores

    • Introduced automated CI pipeline with linting and PR title format validation on pull requests.
    • Added pre-commit hooks to enforce code hygiene and commit message standards.
    • Added markdown linting configuration.
  • Documentation

    • Updated contribution guidelines with new PR requirements and local setup instructions.

dev-hjJoo and others added 3 commits April 24, 2026 02:40
Hooks cover whitespace hygiene, large-file guard, YAML/JSON
syntax, markdownlint-cli2 for prose style, and
conventional-pre-commit enforcing the repo commit-message
convention. Configuration relaxes a few markdownlint rules
(MD013, MD033, MD041) that conflict with our frontmatter,
tables, and inline HTML usage.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
One CI workflow running pre-commit across all files on pull
requests and main pushes, plus a PR-title job that enforces
Conventional Commits via amannn/action-semantic-pull-request
using the repository's declared type and scope lists.
Concurrency cancels superseded runs on the same ref.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Document that every change lands through a feature branch
and pull request (no direct commits to main), that CodeRabbit
auto-reviews each PR, and that squash merge is preferred so
PR titles become the main history. Add a setup section for
pre-commit and list required PR checklist items.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

📝 Walkthrough

Walkthrough

Establishes GitHub Actions CI/CD workflow with linting and PR title validation, introduces pre-commit hooks for code quality and commit message standards, enables Markdown linting, and updates documentation to reflect new developer workflow requirements and standards.

Changes

Cohort / File(s) Summary
CI/CD Workflow & Linting Configuration
.github/workflows/ci.yml, .markdownlint.yaml, .pre-commit-config.yaml
Introduces GitHub Actions workflow with lint and pr-title jobs running on pushes/PRs to main. Adds pre-commit hooks for trailing whitespace, file size validation, YAML/JSON linting, Markdown linting, and conventional commit message validation. Markdown linting configuration selectively disables specific rules while allowing sibling duplicate headings.
Documentation Updates
00_meta/WORKFLOW.md, CONTRIBUTING.md, README.md
Updates contribution and workflow documentation to enforce feature-branch-only development, require PR titles in Conventional Commit format, recommend squash merging, note automated CodeRabbit review, and mandate successful pre-commit run --all-files before merge.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A workflow's born, with pre-commit hops so free,
Linting checks and CI dance in harmony,
The docs now shine with standards clear and bright,
Commits stay clean, conventions held tight,
This rabbit celebrates developer delight! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: establishing a branch+PR workflow with pre-commit and CI linting infrastructure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/pr-review-lint-setup

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 41-79: Update the GitHub Action invocation for the pr-title job to
use the newer release by changing the uses reference from
amannn/action-semantic-pull-request@v5 to
amannn/action-semantic-pull-request@v6.1.1; ensure the step under the pr-title
job that sets env/GITHUB_TOKEN and the with inputs (types, scopes, requireScope,
subjectPattern, subjectPatternError) are preserved and remain compatible with
v6.1.1, then run the workflow locally or trigger CI to confirm no input name
changes break the job.

In @.pre-commit-config.yaml:
- Around line 29-40: The commit hook args list includes additional conventional
commit types "--strict", "ci", "build", and "perf" (the args entries: --strict,
feat, fix, docs, refactor, test, chore, style, ci, build, perf) that are not
documented in CONTRIBUTING.md; update the Type table in CONTRIBUTING.md to
include the missing types "ci", "build", and "perf" (and any mention of --strict
if relevant) so the documented allowed types match the args list in
.pre-commit-config.yaml and avoid confusion for contributors.

In `@00_meta/WORKFLOW.md`:
- Line 71: Resolve the contradiction between the two workflow rules by either
removing the exception that allows direct commits for typo/link fixes or
clarifying the PR-only rule to explicitly permit that exception; specifically,
update the wording of the rule that reads "모든 변경은 feature 브랜치 → Pull Request 를
통해 머지. `main` 직접 커밋 금지" to append a clear exception for "오탈자·링크 수정은 `main` 직접 커밋
허용" or delete the exception sentence "오탈자·링크 수정은 `main` 직접 커밋 허용" so both
statements are consistent throughout the document.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2bdaf488-8b75-44f7-992f-4c21060d8f03

📥 Commits

Reviewing files that changed from the base of the PR and between be2fd8a and fc187d0.

📒 Files selected for processing (6)
  • .github/workflows/ci.yml
  • .markdownlint.yaml
  • .pre-commit-config.yaml
  • 00_meta/WORKFLOW.md
  • CONTRIBUTING.md
  • README.md

Comment thread .github/workflows/ci.yml
Comment on lines +41 to +79
pr-title:
name: Lint PR title
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
pull-requests: read
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
feat
fix
docs
refactor
test
chore
style
ci
build
perf
scopes: |
meta
adr
research
product
design
arch
agents
backend
frontend
eval
infra
requireScope: false
subjectPattern: "^[a-z].+[^.]$"
subjectPatternError: |
PR title subject must start with a lowercase letter,
be non-empty, and not end with a period.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

amannn/action-semantic-pull-request latest version 2025

💡 Result:

The latest version of amannn/action-semantic-pull-request is v6.1.1, released on August 22, 2025.

Citations:


Update amannn/action-semantic-pull-request to v6.1.1.

The action configuration (types, scopes, subjectPattern) properly enforces Conventional Commits and aligns with project standards. However, v5 is outdated; the latest version is v6.1.1 (released August 22, 2025).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 41 - 79, Update the GitHub Action
invocation for the pr-title job to use the newer release by changing the uses
reference from amannn/action-semantic-pull-request@v5 to
amannn/action-semantic-pull-request@v6.1.1; ensure the step under the pr-title
job that sets env/GITHUB_TOKEN and the with inputs (types, scopes, requireScope,
subjectPattern, subjectPatternError) are preserved and remain compatible with
v6.1.1, then run the workflow locally or trigger CI to confirm no input name
changes break the job.

Comment thread .pre-commit-config.yaml
Comment on lines +29 to +40
args:
- --strict
- feat
- fix
- docs
- refactor
- test
- chore
- style
- ci
- build
- perf
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Type list mismatch with documentation.

The conventional-pre-commit hook allows ci, build, and perf types (lines 38-40), but CONTRIBUTING.md (lines 78-87) only documents feat, fix, docs, refactor, test, chore, and style. This inconsistency may confuse contributors.

📝 Suggested fix: Add missing types to CONTRIBUTING.md

Add to the Type table in CONTRIBUTING.md:

 | `chore` | 설정·의존성·CI 등 유지보수 |
 | `style` | 포맷팅만 |
+| `ci` | CI/CD 파이프라인 변경 |
+| `build` | 빌드 시스템·외부 의존성 변경 |
+| `perf` | 성능 개선 |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.pre-commit-config.yaml around lines 29 - 40, The commit hook args list
includes additional conventional commit types "--strict", "ci", "build", and
"perf" (the args entries: --strict, feat, fix, docs, refactor, test, chore,
style, ci, build, perf) that are not documented in CONTRIBUTING.md; update the
Type table in CONTRIBUTING.md to include the missing types "ci", "build", and
"perf" (and any mention of --strict if relevant) so the documented allowed types
match the args list in .pre-commit-config.yaml and avoid confusion for
contributors.

Comment thread 00_meta/WORKFLOW.md

## Commit / PR 규칙

- **모든 변경은 feature 브랜치 → Pull Request 를 통해 머지**. `main` 직접 커밋 금지.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Potential conflict with existing rule on line 66.

Line 71 states "모든 변경은 feature 브랜치 → Pull Request 를 통해 머지. main 직접 커밋 금지" (all changes via PR, no direct main commits), but line 66 (existing, unchanged) states "오탈자·링크 수정은 main 직접 커밋 허용" (typo/link fixes allowed directly to main). These rules contradict each other.

Consider either:

  1. Removing the exception on line 66 to enforce strict PR-only workflow
  2. Clarifying line 71 to note the typo/link exception
🧰 Tools
🪛 LanguageTool

[grammar] ~71-~71: Ensure spelling is correct
Context: ... / PR 규칙 - 모든 변경은 feature 브랜치 → Pull Request 를 통해 머지. main 직접 커밋 금지. - 커밋 메시지는 [...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@00_meta/WORKFLOW.md` at line 71, Resolve the contradiction between the two
workflow rules by either removing the exception that allows direct commits for
typo/link fixes or clarifying the PR-only rule to explicitly permit that
exception; specifically, update the wording of the rule that reads "모든 변경은
feature 브랜치 → Pull Request 를 통해 머지. `main` 직접 커밋 금지" to append a clear exception
for "오탈자·링크 수정은 `main` 직접 커밋 허용" or delete the exception sentence "오탈자·링크 수정은
`main` 직접 커밋 허용" so both statements are consistent throughout the document.

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.

1 participant