Skip to content

chore: update .gitignore#51

Merged
shimomo merged 3 commits intogh-pagesfrom
chore/update-gitignore
Aug 30, 2025
Merged

chore: update .gitignore#51
shimomo merged 3 commits intogh-pagesfrom
chore/update-gitignore

Conversation

@shimomo
Copy link
Copy Markdown
Contributor

@shimomo shimomo commented Aug 29, 2025

.gitignore に PHP だけではなく汎用的な設定も追加しました。

Summary by CodeRabbit

  • チョア
    • .gitignore を大幅に拡張し、OS/IDE設定、一時ファイル・ログ・バックアップ、環境変数例の保護、ビルド成果物や言語/フレームワーク(Node/PHP/WordPress等)のキャッシュや生成物、Homestead 関連などを網羅的に除外。誤コミット抑制と開発・CIの安定化を目的。

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 29, 2025

Walkthrough

.gitignore を全面的に置き換え、OS/IDE/一時ファイル/環境変数例外/ビルド成果物/各種キャッシュ(PHPUnit, PHPStan, Psalm 等)や Node.js・PHP・Laravel・WordPress に特化した無視ルール群をセクションで整理して追加。コード変更はなし。

Changes

Cohort / File(s) Change Summary
Git ignore rules
/.gitignore
トップレベルの単純な無視エントリ(/.phpunit.cache, /build, /vendor)を削除し、OS依存、テンポラリ・ログ・バックアップ、環境変数例外(!.env.example!.env.*.example)、ビルド成果物・キャッシュ、IDE設定、Node.js、PHP(Composer、PHPUnit、PHPStan、Psalm、PHP-CS-Fixer など)、Laravel/Homestead、WordPress(wp-content/... 等)、コードカバレッジ、各種バイナリを含む大規模で構造化された無視ルール群に置換。セクション見出しを追加し、Homestead ファイル名や複数の重複パターンも含めて網羅。

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

ぽんぽん跳ねる、草のうえで
ぼくの.gitignore、ふわっと膨らんで
ログもキャッシュも、やさしくしまって
リポは軽やか、風が抜けるように
ぴょんと一回転、にんじんで乾杯 🐇✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/update-gitignore

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 4

🧹 Nitpick comments (2)
.gitignore (2)

46-46: 重複した .idea/ の無視エントリ

同一パターンが2回あります。片方を削除してスリム化しましょう(動作影響なし)。

適用差分:

-.idea/

Also applies to: 89-89


34-34: cache/ のスコープが広すぎる

リポジトリ内の任意の下位 cache/ まで無視されるため、意図せず必要ファイルを隠す恐れ。ルートに限定するのが安全です。

適用差分:

-cache/
+/cache/
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between df9c0d9 and 9f24b9b.

📒 Files selected for processing (1)
  • .gitignore (1 hunks)
🔇 Additional comments (1)
.gitignore (1)

30-37: dist/build/out の一律除外は配布形態に依存

ライブラリや WP テーマ/プラグイン等でビルド成果物を配布物に含める場合、ここを無視すると公開パッケージが壊れます。リリース/配布フローで成果物の生成と同梱方針を確認ください。必要ならパスをフレームワーク単位で限定してください(例: public/build/ のみ)。

Comment thread .gitignore
Comment thread .gitignore Outdated
Comment thread .gitignore
Comment thread .gitignore
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 29, 2025

Note

Unit test generation is an Early Access feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 29, 2025

UTG Post-Process Complete

No new issues were detected in the generated code and all check runs have completed. The unit test generation process has completed successfully.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 29, 2025

Creating a PR to put the unit tests in...

The changes have been created in this pull request: View PR

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: 0

♻️ Duplicate comments (2)
.gitignore (2)

65-69: PHPUnitキャッシュの互換パターンをもう1つ追加してください

古い生成名(ドットなし)も併記すると安全です。現在は .phpunit.result.cache のみなので phpunit.result.cache も追加を。

 .phpunit.cache
 .phpunit.result.cache
+phpunit.result.cache
 phpunit.xml

74-76: Psalm方針OK: .dist は追跡し、psalm.xml は無視

ベストプラクティスに沿っています。

🧹 Nitpick comments (3)
.gitignore (3)

48-48: 重複エントリの削除: .idea/ が2回記載されています

意味的には冗長なので片方を削除してください(どちらでも可。下段を削除する例を提示)。

 # Laravel特有
 ...
 Homestead.json
-.idea/

Also applies to: 91-91


77-82: var/*.cache の広範無視は影響が大きい可能性があります

Symfony等では妥当ですが、他用途の var/ を使う場合は誤除外になり得ます。必要に応じて粒度を下げる選択肢も検討ください(例)。

-var/
+var/cache/
+var/log/
 # 必要に応じて他のサブディレクトリを追加

53-56: Node系デバッグログの網羅性を少し補完しませんか

pnpmyarn の debug ログも拾うと便利です。

 node_modules/
 npm-debug.log
 yarn-error.log
+yarn-debug.log*
+pnpm-debug.log*
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9f24b9b and bd3fb60.

📒 Files selected for processing (1)
  • .gitignore (1 hunks)
🔇 Additional comments (3)
.gitignore (3)

22-25: 良い対応: .env テンプレートを誤って無視しない否定パターンが追加されています

.env.example/.env.*.example を保持できる構成になっており問題ありません。


32-35: gh-pages 運用との整合性を確認してください(dist/build/out を無視)

Pages にビルド成果物を「コミットして配信」する運用なら、ここでの無視が配信を阻害します。CIで別ブランチにデプロイするなら現状でOKです。


68-68: phpunit.xml.dist がリポジトリルートに存在するか手動でご確認ください
phpunit.xml を .gitignore に追加するのは問題ありませんが、デフォルト設定ファイルである phpunit.xml.dist が未コミットの場合、新規環境でのテスト実行時に設定が欠落します。

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: 0

🧹 Nitpick comments (8)
.gitignore (8)

22-28: env テンプレートのホワイトリストはOK。direnv も追加を推奨

.env/.env.* の否定パターンは適切です。direnv 系も合わせて無視すると安全です。

 .env
 .env.*
 !.env.example
 !.env.*.example
 *.key
 *.pem
+ # direnv
+ .envrc
+ .direnv/

32-39: ビルド/キャッシュ系のパターンが広すぎる — ルート限定と隠し .cache を併記

現状だと任意階層の cache/ や tmp/ まで除外します。サンプル配下などのサブプロジェクトを誤って隠さないよう、意図がルートなら先頭にスラッシュを付け、ツールの隠し .cache ディレクトリも網羅しましょう。

-dist/
-build/
-out/
-tmp/
-cache/
+ /dist/
+ /build/
+ /out/
+ /tmp/
+ /cache/
+ .cache/

44-46: .vscode/ は全面除外ではなく共有したい設定を許可する案

ワークスペース固有は除外しつつ、推奨拡張やタスクは共有する運用が便利です。

- .vscode/
+ .vscode/*
+ !.vscode/extensions.json
+ !.vscode/settings.json
+ !.vscode/tasks.json

53-58: npm デバッグログのワイルドカード不足

npm は接尾辞付きのログを吐くことがあるため、npm-debug.log* を推奨します。

- npm-debug.log
+ npm-debug.log*
  yarn-error.log
  yarn-debug.log*
  pnpm-debug.log*

80-86: グローバルな *.cache は過剰除外のリスク — 目的別に絞るかディレクトリに限定

*.cache は任意の拡張子 .cache ファイルまで隠すため、誤除外の可能性があります。ディレクトリに限定するか、既知ツールのパターンに絞ることを検討してください。

-*.cache
+# 既知のディレクトリキャッシュのみ
+.cache/

96-101: WordPress 追加候補(任意)

Wordfence など一般的な生成物も無視対象にできます。

 wp-content/uploads/
 wp-content/cache/
 wp-content/upgrade/
 wp-content/debug.log
+wp-content/wflogs/
+wp-content/backup-db/

105-107: lcov パターンの修正と一般的なレポート追加

実ファイル名は lcov.info が一般的です。JUnit/Clvoer なども合わせて除外可。

 coverage/
-*.lcov
+lcov.info
+coverage/lcov-report/
+coverage.xml
+clover.xml
+junit.xml

88-91: .env.* と個別 .env.local 等の二重指定は冗長

意味は重なっているため片方で十分です。保守性観点で整理を提案します(機能的には問題なし)。

-.env.backup
-.env.local
-.env.production
-.env.testing
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between bd3fb60 and 1a10ada.

📒 Files selected for processing (1)
  • .gitignore (1 hunks)
🔇 Additional comments (1)
.gitignore (1)

67-72: PHPUnit の除外は妥当。補足で OK

.phpunit.result.cachephpunit.result.cache の両対応と phpunit.xml の除外で問題ありません。

@shimomo shimomo merged commit 0350d02 into gh-pages Aug 30, 2025
6 checks passed
@shimomo shimomo deleted the chore/update-gitignore branch August 30, 2025 19:29
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