Skip to content

chore: setup pre-commit#91

Merged
miyakoshi-3854 merged 5 commits into
mainfrom
chore/setup-pre-commit
Mar 11, 2026
Merged

chore: setup pre-commit#91
miyakoshi-3854 merged 5 commits into
mainfrom
chore/setup-pre-commit

Conversation

@miyakoshi-3854

Copy link
Copy Markdown
Contributor

close #85

Summary

タイトル通り

Changes

install pre-commit
add config file

Notes

ruffv0.15.1 の理由は、下記記事にそろえた方がいいと書いてあったから。
別に ruffv0.15.5 にしてもいいと思う。

参照: 2次ソース

動作テスト

meshiban=chore-setup-pre-commit on  chore/setup-pre-commit [!+] is 📦 v0.1.0 via 🐍 v3.12.12 
❯ uv run pre-commit run end-of-file-fixer
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing .pre-commit-config.yaml


meshiban=chore-setup-pre-commit on  chore/setup-pre-commit [!+] is 📦 v0.1.0 via 🐍 v3.12.12 took 6s 
❯ uv run pre-commit run trailing-whitespace
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing .pre-commit-config.yaml
Fixing src/main.py

@miyakoshi-3854 miyakoshi-3854 self-assigned this Mar 11, 2026
@miyakoshi-3854 miyakoshi-3854 requested a review from a team as a code owner March 11, 2026 14:32
@coderabbitai

coderabbitai Bot commented Mar 11, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b0888ca8-d84e-4e3c-8bc5-49450dae0081

📥 Commits

Reviewing files that changed from the base of the PR and between b4aab49 and ce245be.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • .pre-commit-config.yaml
  • pyproject.toml

📝 Walkthrough

Walkthrough

プロジェクトに pre-commit フレームワークを導入し、自動フォーマット・リント検証を設定する。.pre-commit-config.yaml で pre-commit-hooks と ruff-pre-commit を登録し、pyproject.toml に dev 依存として pre-commit パッケージを追加。

Changes

Cohort / File(s) Summary
Pre-commit Configuration
.pre-commit-config.yaml
Pre-commit フレームワークを設定。end-of-file-fixer、trailing-whitespace、check-merge-conflict、detect-private-key、check-yaml、check-toml、check-json の各フックと、ruff-check (--fix オプション付き)、ruff-format を登録。
Development Dependencies
pyproject.toml
dev 依存グループに pre-commit>=4.5.1 を追加。

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Pre-commit の魔法が舞い込み
フォーマット忘れもさよならだ
Ruff と hooks が見張り役
コミット前に きれいに整う
🌟 自動の手が優しく
コードの美しさ守るため

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed タイトルは pull request の主要な変更内容(pre-commit の設定)を簡潔に反映しており、明確で説明的です。
Description check ✅ Passed 説明は必須セクション(Summary、Changes、Notes)をすべて含み、構造化されており十分完成しています。
Linked Issues check ✅ Passed 変更内容は issue #85 の「pre-commit 導入してフォーマット忘れを無くす」という要件を満たしており、設定ファイルの追加と依存関係の導入が適切に実装されています。
Out of Scope Changes check ✅ Passed すべての変更は issue #85 の要件に関連し、pre-commit の導入という定義された範囲内に収まっています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/setup-pre-commit

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@nkoji21 nkoji21 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Image

@miyakoshi-3854 miyakoshi-3854 merged commit 2f8b26d into main Mar 11, 2026
2 checks passed
@miyakoshi-3854 miyakoshi-3854 deleted the chore/setup-pre-commit branch March 11, 2026 15:00
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.

pre-commit導入してフォーマット忘れを無くす

2 participants