Skip to content

Setup oxfmt#2

Merged
amotarao merged 11 commits intomainfrom
setup-oxfmt
Jan 31, 2026
Merged

Setup oxfmt#2
amotarao merged 11 commits intomainfrom
setup-oxfmt

Conversation

@amotarao
Copy link
Member

@amotarao amotarao commented Jan 31, 2026

Summary

  • oxfmt(Prettier 互換の高速フォーマッター)をセットアップ
  • package.json にフォーマットスクリプトを追加
  • GitHub Actions に Format Check ワークフローを追加
  • husky と lint-staged を導入し、pre-commit フックを設定

Test plan

  • CI の Format Check が正常に動作することを確認
  • pre-commit フックが正常に動作することを確認

🤖 Generated with Claude Code

Summary by CodeRabbit

チョア

  • 自動コードフォーマット機能を導入し、プロジェクト全体のコード一貫性を強化しました。
  • プリコミットでの自動整形とフォーマットチェックを追加し、コミット前に品質を自動検証します。
  • エディタ推奨設定とワークフローを設定して、開発環境での自動整形とチェックを容易にしました。

✏️ Tip: You can customize this high-level summary in your review settings.

amotarao and others added 10 commits January 31, 2026 16:35
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Jan 31, 2026

Walkthrough

開発ワークフローにコードフォーマットとプリコミットチェックを導入する変更。oxfmt、lint-staged、Husky、VSCode 推奨設定、pnpm による依存管理、および GitHub Actions のフォーマットチェックを追加します。 (49語)

変更内容(Changes)

コホート / ファイル 概要
CI ワークフロー
​.github/workflows/format-check.yml
プルリクエストおよび main へのプッシュで oxfmt チェックを実行する GitHub Actions ワークフローを追加。pnpm セットアップと pnpm run format:check を実行。
パッケージとスクリプト
package.json
pnpm 管理の package.json を追加。devDependencies に husky, lint-staged, oxfmt を追加し、format / format:check / prepare スクリプトを定義。
Git フックとステージング設定
.husky/pre-commit, .lintstagedrc
Husky のプリコミットフックに lint-staged を呼び出す行を追加。lint-staged は全ファイルに対して oxfmt --no-error-on-unmatched-pattern を適用する設定を追加。
フォーマッタ設定
.oxfmtrc.json
oxfmt の設定ファイルを追加("$schema" と "experimentalSortImports")。
IDE 設定
.vscode/extensions.json, .vscode/settings.json
VSCode 推奨拡張(oxc.oxc-vscode)と既定フォーマッターおよび保存時の自動整形を設定。
バージョン管理除外
.gitignore
node_modules/ を追加して依存ディレクトリを除外。

Sequence Diagram(s)

sequenceDiagram
    rect rgba(200,230,201,0.5)
    participant Dev as 開発者
    end
    rect rgba(187,222,251,0.5)
    participant Git as Git/リポジトリ
    participant Husky as Husky (pre-commit)
    participant Lint as lint-staged
    participant Oxfmt as oxfmt
    end
    rect rgba(255,224,178,0.5)
    participant GH as GitHub Actions
    participant Runner as CI ランナー (pnpm)
    end

    Dev->>Git: コミット/プッシュ
    Git->>Husky: pre-commit フック起動
    Husky->>Lint: lint-staged 実行
    Lint->>Oxfmt: `oxfmt --no-error-on-unmatched-pattern` を適用
    Dev->>Git: push -> ワークフロー トリガー
    Git->>GH: イベント通知 (push/PR)
    GH->>Runner: ワークフロー実行 (セットアップ pnpm + node)
    Runner->>Runner: `pnpm install --frozen-lockfile`
    Runner->>Runner: `pnpm run format:check` (oxfmt --check)
    Runner-->>GH: 結果報告
Loading

推定レビュー時間(Estimated code review effort)

🎯 2 (Simple) | ⏱️ ~15 分

詩(Poem)

🐰✨ 新しいフックで跳ねるように、
コードの道をぴかっと整え、
oxfmt がそっと並べ替え、
CI が見守る朝の散歩、
さあ、コミット—心は軽やか! 🌱

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Setup oxfmt' directly and clearly reflects the main objective of the pull request, which is to configure oxfmt and related formatting tools.
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 setup-oxfmt

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

@amotarao amotarao merged commit a36ca1f into main Jan 31, 2026
2 checks passed
@amotarao amotarao deleted the setup-oxfmt branch January 31, 2026 08:10
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