Skip to content

Ci 2#17

Merged
void2610 merged 75 commits intomainfrom
ci-2
Jul 9, 2025
Merged

Ci 2#17
void2610 merged 75 commits intomainfrom
ci-2

Conversation

@void2610
Copy link
Copy Markdown
Member

@void2610 void2610 commented Jul 9, 2025

実装内容

  • aの実装
  • bの実装

Copilot AI review requested due to automatic review settings July 9, 2025 05:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

このPRでは、ReSharperを用いた静的解析ジョブをCIに追加し、ビルドジョブの前にコード品質チェックを実行するように変更しています。

  • .github/workflows/resharper-code-check.yml を新規追加し、ReSharper CLIで静的解析を実行
  • build.yml に再利用可能ワークフロー呼び出しを追加し、build ジョブを code-quality に依存させる

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/resharper-code-check.yml ReSharper静的解析のCIワークフローを定義
.github/workflows/build.yml buildジョブに code-quality ジョブの依存関係を追加

void2610 and others added 26 commits July 9, 2025 14:26
- ReSharper Command Line Tools による静的解析の実装
- Unity プロジェクトファイル (.sln, .csproj) をリポジトリに含める
- .gitignore を修正して必要なファイルのみコミット対象に
- Unity 専用の extensions と除外設定を追加
- 詳細なレポート生成とアーティファクト保存機能
- エラー・警告・提案の分類表示とCI失敗制御

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- 存在しないプロジェクトファイル参照を解決
- Assembly-CSharpプロジェクトのみを含むvoid-red-analysis.slnを追加
- ワークフローでクリーンなソリューションファイルを使用
- dotnet restore と ReSharper inspectcode で同じファイルを参照

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- dotnet-jb コマンドが見つからない問題を解決
- ~/.dotnet/tools を PATH に追加する処理を改善
- ReSharper インストール確認ステップを追加
- jb コマンドの存在確認とテスト実行
- 各ステップでの PATH 設定を確実に実行
- レポートファイル生成の確認処理を追加

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Unity extension 不在の警告に対応
- --no-build オプションで依存関係解決をスキップ
- NuGet restore 失敗時も解析を続行
- 標準C#解析でコード品質チェックを実行
- 大量の参照解決警告を解決
- 実用的な静的解析環境を構築

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- エラー・警告・提案・情報レベルの詳細カウント表示
- 問題のファイル名・行番号・メッセージを整理して表示
- 初期段階ではエラーレベルでもCIを継続する設定
- レポート内容の分析結果を見やすく整理
- Artifactダウンロードの案内を追加

実行結果: エラー2件、警告116件、提案11件を検出
レポートサイズ: 488K (2916行)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- <Issue> タグから実際の問題詳細を抽出
- ファイル名・行番号・メッセージ・エラータイプを個別取得
- IssueType定義ではなく実際のIssueエントリを解析
- デバッグ情報でレポート構造を確認
- エラー詳細の抽出失敗時のフォールバック処理
- より詳細で実用的なエラー情報を提供

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
問題分析:
- CSharpErrors の原因は Assets\Samples\LitMotion\LitMotionTutorial.cs
- UnityEngine, Cysharp, LitMotion, MonoBehaviour が解決できない
- これらは Unity のサンプルファイルで参照関係が複雑

解決策:
- --exclude に **/Samples/** を追加
- メインゲームコードの品質に集中
- Unity 参照エラーを実用的に回避
- サンプルコードではなく本体コードの解析を優先

期待結果: CSharpErrors が大幅に削減される

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
解析結果の詳細分析:
- Samples除外の成功を確認(LitMotionTutorial.cs エラー消失)
- メインコードでUnity参照エラーが大量発生(1,785件)
- 警告116件・提案11件は変化なし(実用的な品質指標)

実装改善:
- Unity/参照関連エラーを分離して実用的な判定に変更
- 実際のコード問題数の算出(Unity制約エラーを除外)
- CI判定ロジックの改善(参照エラーは正常範囲)
- 解析の有効性と推奨事項を明示

Unity プロジェクトでの現実的な品質チェック環境を構築

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
機能変更:
- inspectcode → cleanupcode に変更(コード整形)
- 静的解析 → 自動フォーマット機能
- エラー検出 → フォーマット準拠チェック
- コミット機能を削除(エラー出力のみ)

実装内容:
- jb cleanupcode による自動コード整形
- フォーマット差分の検出と表示
- フォーマット非準拠時のCI失敗
- 修正方法の詳細ガイド表示
- Unity プロジェクトに最適化

目的: コンパイルエラーではなくコードスタイルの統一

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
問題解決:
- Unity 参照警告の大量出力を抑制
- cleanupcode は正常に動作中
- フォーマット結果に集中できる環境を構築

実装改善:
- --verbosity=ERROR で警告レベルを抑制
- grep で Unity 関連警告をフィルタリング
- 実際のフォーマット変更をプレビュー表示
- 変更内容の詳細を20行まで表示

結果: cleanupcode の実行結果が見やすくなり、
実際のコードフォーマットに集中可能

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- ScoreCalculator.cs で意図的にスペースを削除
- ReSharper cleanupcode によるCI失敗をテスト
- フォーマット検出機能の動作確認

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- プロファイルを "Built-in: Reformat Code" に変更
- 利用可能なプロファイルの確認機能を追加
- verbosity を WARN に変更して詳細情報を表示
- cleanupcode 実行後の Git 状態を即座に確認

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- .DotSettings ファイルでフォーマット設定を明示的に指定
- 詳細なデバッグ情報を追加
- フォーマット前後の状態比較
- verbosity=INFO で実行詳細を確認

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- HEREDOCをecho文の組み合わせに変更
- XML設定ファイルをYAMLと競合しないように修正
- 長い行を分割してYAML構文エラーを回避

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Built-in: Full Cleanup プロファイルを明示的に指定
- スペース設定を詳細化(代入演算子、論理演算子、等価演算子)
- SPACE_AROUND_ASSIGNMENT など追加設定でフォーマット検出を強化
- 意図的に崩したフォーマットをより確実に検出

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- ビルドエラーによるcleanupcode阻害を回避
- VERBOSE モードで詳細な実行情報を出力
- 手動フォーマット確認のため期待される結果を明示
- Git差分をより詳細に確認

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Built-in: Reformat Code プロファイルに変更(軽微なフォーマットのみ)
- using文削除やコメント変更を無効化
- KEEP_USER_LINEBREAKS で既存の改行を維持
- 基本的なスペース設定のみ適用
- テスト用にわずかなフォーマット問題を再導入

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Scripts以下の全ファイルを対象に設定
- 既存の改行・インデントスタイルを完全に維持
- using文の順序変更を無効化
- 空行削除機能を無効化
- 基本的なスペース問題のみを修正(カンマ後、演算子周り)
- 過度なフォーマット変更を防止して既存スタイルを尊重

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- KEEP_BLANK_LINES_IN_CODE を99に設定
- KEEP_BLANK_LINES_IN_DECLARATIONS を99に設定
- 既存の空行パターンを完全に維持
- フォーマット変更を最小限に抑制

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- 複雑な.DotSettings設定を削除
- 既存の.editorconfigファイルを活用
- ReSharperの公式推奨アプローチを採用
- プロジェクト標準のコードスタイルを適用
- より保守しやすく標準的な設定に

📋 主要設定:
- csharp_space_after_comma = true
- csharp_space_around_binary_operators = before_and_after
- csharp_preserve_single_line_blocks = true

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- 実行前後のファイル状態を比較
- 単一ファイルでのテスト実行を追加
- .editorconfigファイルの設定を明示的に表示
- VERBOSEモードで詳細な実行情報を出力
- 段階的な実行で問題箇所を特定

🎯 目標: ReSharperがファイルを実際に変更しているかを確認

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Set resharper_space_after_triple_slash = false to prevent extra spaces after ///
- Added deliberate formatting issues to test the fix:
  * Removed space before return statement
  * Removed spaces around multiplication operators
- ReSharper should fix spacing issues but preserve XML comment formatting

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove unnecessary Unity-generated .csproj files from root directory
- Update .gitignore to exclude Unity-generated .csproj files while keeping main Assembly-CSharp ones
- Fix resharper_space_after_triple_slash = false to prevent XML comment indentation
- Add test formatting issues to verify the fix works correctly

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Change from void-red-analysis.sln to Assembly-CSharp.csproj to avoid multiple project file issues
- Add cleanup step to remove Unity-generated .csproj files during CI build
- Add debugging output to show all .csproj files found in the environment
- This should resolve the "Specify which project file to use" error

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Change to home directory before installing ReSharper to avoid project file interference
- This should resolve the "Specify which project file to use" error during installation
- Simplified approach instead of temporary file moving

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Set resharper_align_multiline_comments = false to prevent comment content indentation
- Set resharper_indent_comment = false to preserve original comment formatting
- Keep resharper_space_after_triple_slash = true to maintain /// spacing
- Add test formatting issue to verify XML comments are preserved correctly

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
void2610 and others added 29 commits July 9, 2025 22:16
- 意図的に作成した命名規則違反を削除
- 実際のプロジェクトでは19件の軽微な違反のみ
- SerializeFieldフィルタリングが正常に動作(102件除外)
- 実用的なコード品質チェックシステムが完成

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- 軽量なソリューションフィルタ(void-red-minimal.slnf)を追加
- 包括的なexcludeパターンを追加してライブラリファイルを除外
- XML、JSON、shader、hlslファイルなど非C#ファイルを除外
- 解析時間を大幅に短縮

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- 包括的なexcludeパターンを追加(100以上のファイル拡張子)
- Unity、ライブラリ、アセットファイルを全て除外
- 必要なC#ファイルのみにincludeを限定
- 不要なカスタムプロジェクトファイルを削除
- 解析時間の大幅短縮を実現

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Assembly-CSharp-Minimal.csprojを作成してC#ファイルのみを含める
- 複雑なinclude/excludeパターンを削除
- 不要なXML、TXT、JSONファイルの分析を完全に排除
- .gitignoreにMinimalプロジェクトファイルを追加

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
private_fields_underscoreルールからconstフィールドを除外し、
MAX_MENTAL_POWERのような定数がUPPER_CASE_WITH_UNDERSCORESのまま
維持されるよう設定を修正

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Riderの設定に合わせてpublicシリアライズフィールドを
PascalCaseに統一:
- conditions → Conditions
- requiredPlayStyle → RequiredPlayStyle
- requiredCount → RequiredCount
- requiredWinRate → RequiredWinRate

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- EvolutionConditions: minimumGames → MinimumGames
- SeManager.SoundData: name, audioClip, volume → Name, AudioClip, Volume
- SerializableDictionary.Pair: key, value → Key, Value

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
UI, NPC, TMP等のゲーム開発で頻繁に使用される略語を
resharper_acronyms_listに追加し、命名規則違反として
検出されないよう設定

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
UIPresenterとTMPInputFieldCaretFixerをワークフロー内で
除外するフィルタを追加。これらは一般的な略語(UI、TMP)を
含むため、命名規則違反として扱わない。

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
以下の違反を追加:
- test_multiplier (アンダースコア付きstatic field)
- max_score (小文字のconst)
- currentLevel (アンダースコアなしのprivate field)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
命名規則チェックが正常に動作することを確認:
- private instanceフィールドの検出 ✅
- SerializeFieldフィルタリング ✅
- ワークフローロジック ✅

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…lations

- Assembly-CSharp.csprojを使用(Minimalではglob patternが動作しない)
- excludeでプロジェクトファイル等を除外
- フォーマット違反を追加してテスト用:
  - スペース不足: if(move==null||\!theme)return 0f;
  - 演算子周りのスペース: var attributeMultiplier=theme.GetMultiplier...
  - 余分な空行と余分なスペース

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
診断により問題が判明:
- excludeパターンが過度に厳格でC#ファイルを除外していた
- Unity固有ファイルのみ除外する設定に変更
- 不要な診断コードを削除してクリーンなワークフローに

期待される結果:
- フォーマット違反を正しく検出
- C#ファイルが適切に処理される

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- 属性を別行に配置(Unity慣例に従う)
- 空行パターンを調整
- 意図的なフォーマット違反を修正してベースラインを作成

これで既存コードベースのスタイルが保たれ、
真のフォーマット違反のみが検出される

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- 空行に関するReSharperの設定を緩和
- 基本的なフォーマット(スペース4つのインデント)のみを適用
- 自動的な空行挿入を無効化

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@void2610 void2610 merged commit c9c9985 into main Jul 9, 2025
0 of 2 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.

2 participants