Skip to content

ReSharper Command Line ToolsによるUnity C#コードフォーマット・命名規則チェック機能を実装#18

Closed
void2610 wants to merge 19 commits intomainfrom
ci-2
Closed

ReSharper Command Line ToolsによるUnity C#コードフォーマット・命名規則チェック機能を実装#18
void2610 wants to merge 19 commits intomainfrom
ci-2

Conversation

@void2610
Copy link
Copy Markdown
Member

@void2610 void2610 commented Jul 9, 2025

実装内容

  • ReSharperコマンドラインツールを使用したGitHub Actionsワークフロー
  • コードフォーマット検査(cleanupcode)
  • 命名規則違反検査(inspectcode)
  • Unity SerializeFieldの特別処理
  • 個別ファイル処理による安定性向上

主要ファイル

  • .github/workflows/resharper-code-check.yml: メインワークフロー
  • .editorconfig: コード規約とReSharper設定
  • Assembly-CSharp.csproj: Unity プロジェクト設定
  • void-red.sln: ソリューション設定

特徴

  • フォーマットと命名規則を独立してチェック
  • SerializeFieldの命名規則を適切に除外
  • 基本的なフォーマット(4スペースインデント)重視
  • 空行チェックを緩和して実用性を向上

🤖 Generated with Claude Code

実装内容

  • aの実装
  • bの実装

## 実装内容
- ReSharperコマンドラインツールを使用したGitHub Actionsワークフロー
- コードフォーマット検査(cleanupcode)
- 命名規則違反検査(inspectcode)
- Unity SerializeFieldの特別処理
- 個別ファイル処理による安定性向上

## 主要ファイル
- .github/workflows/resharper-code-check.yml: メインワークフロー
- .editorconfig: コード規約とReSharper設定
- Assembly-CSharp.csproj: Unity プロジェクト設定
- void-red.sln: ソリューション設定

## 特徴
- フォーマットと命名規則を独立してチェック
- SerializeFieldの命名規則を適切に除外
- 基本的なフォーマット(4スペースインデント)重視
- 空行チェックを緩和して実用性を向上

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

Co-Authored-By: Claude <noreply@anthropic.com>
@void2610 void2610 self-assigned this Jul 9, 2025
Copilot AI review requested due to automatic review settings July 9, 2025 16:08
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 では、各種ユーティリティおよびゲームのステータスクラスでのフィールド命名を PascalCase に統一し、シリアラブル辞書やサウンド管理周りのフィールド参照を更新しています。また、SerializeField のプライベートリストにも命名規則を適用しました。

  • SerializableDictionary の Pair クラスとシリアライズ用リスト名を更新
  • SeManager の SoundData フィールドと参照を PascalCase に統一
  • EvolutionConditions/EvolutionConditionGroup の公開フィールドを PascalCase に更新
  • PlayerModel のテスト用コメントを整理

Reviewed Changes

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

Show a summary per file
File Description
Assets/Scripts/Utils/SerializableDictionary.cs _serializedListserializedList に改名
Assets/Scripts/Utils/SeManager.cs SoundData フィールド名と参照を PascalCase 化
Assets/Scripts/Game/Stats/EvolutionConditions.cs 公開フィールドを PascalCase に更新
Assets/Scripts/Game/Stats/EvolutionConditionGroup.cs conditionsConditions に改名
Assets/Scripts/Game/Models/PlayerModel.cs テスト用フィールド削除コメントを追加
Comments suppressed due to low confidence (2)

Assets/Scripts/Utils/SerializableDictionary.cs:30

  • プライベートフィールドはアンダースコア接頭辞を付けるルールです。serializedList_serializedList に戻してください。
        private List<Pair> serializedList = new List<Pair>();

Assets/Scripts/Utils/SeManager.cs:62

  • プライベートフィールド soundData はアンダースコア入りの _soundData にすることで命名規則に準拠します。
            var data = this.soundData.FirstOrDefault(t => t.Name == seName);

void2610 and others added 12 commits July 10, 2025 01:13
実行時間を短縮するため、フォーマット対象を最初の10ファイルのみに制限

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

Co-Authored-By: Claude <noreply@anthropic.com>
- 空行のインデント削除を無効化
- C#ファイル専用の設定を追加
- 空行の末尾空白を保持する設定

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

Co-Authored-By: Claude <noreply@anthropic.com>
- フォーマット前にファイルをバックアップ
- Pythonスクリプトで空行のインデントのみを復元
- 非空行はフォーマット後の結果を使用
- .editorconfigに空行処理の無効化設定を追加

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

Co-Authored-By: Claude <noreply@anthropic.com>
過剰なPythonスクリプトを削除し、基本的なReSharperフォーマットのみに戻す

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

Co-Authored-By: Claude <noreply@anthropic.com>
C#専用の設定を追加:
- resharper_csharp_keep_blank_lines_in_code = 100
- resharper_csharp_remove_blank_lines_near_braces_in_code = false
- 空行の自動追加・削除を無効化
- trim_trailing_whitespace = false で空行のインデントを保持

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

Co-Authored-By: Claude <noreply@anthropic.com>
- プロファイルを「Built-in: Minimal cleanup」に変更
- 空行処理を「keep」に設定して現在の状態を維持
- formatter on/off タグを設定

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

Co-Authored-By: Claude <noreply@anthropic.com>
- プロジェクトファイルをベースに--includeで個別ファイルを処理
- エラーメッセージを詳しく確認するため2>&1を追加
- プロジェクトコンテキストを維持して依存関係を解決

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

Co-Authored-By: Claude <noreply@anthropic.com>
Built-in: Minimal cleanup → Built-in: Reformat Code
存在しないプロファイル名が原因でエラーが発生していた問題を修正

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

Co-Authored-By: Claude <noreply@anthropic.com>
- 結果をキャプチャしてメッセージを解析
- 「No items were found to cleanup」は成功として処理
- 適切なログメッセージを表示

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

Co-Authored-By: Claude <noreply@anthropic.com>
- インデントの欠如
- スペースの欠如 (var test=1;)
- ブレースの形式違反
- ReSharperフォーマットテスト用

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

Co-Authored-By: Claude <noreply@anthropic.com>
- exit code 3はフォーマットが適用された成功を意味
- set +e/-eでexit codeを適切にキャプチャ
- 詳細なexit code情報を表示

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

Co-Authored-By: Claude <noreply@anthropic.com>
- 基本的なフォーマット(インデント、スペース)は適用
- 空行の削除のみを無効化
- ReSharperが明らかなフォーマット違反を検出・修正できるように

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

Co-Authored-By: Claude <noreply@anthropic.com>
void2610 and others added 6 commits July 10, 2025 08:29
- ファイル内容の表示
- ReSharperの詳細出力を表示
- VERBOSEモードで詳しい処理情報
- 問題の特定のため

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

Co-Authored-By: Claude <noreply@anthropic.com>
- --includeパラメータが機能しないため、プロジェクト全体を処理
- 個別ファイルの変更をdiffで確認
- 実際のフォーマット結果を表示

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

Co-Authored-By: Claude <noreply@anthropic.com>
- インデント設定(4スペース)を明示的に指定
- 演算子周りのスペースを必須に設定
- if文の後のスペースを必須に設定
- ブレースの配置を設定

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

Co-Authored-By: Claude <noreply@anthropic.com>
--no-buildが原因でC#ファイルが処理されていない可能性があるため、
プロジェクトの依存関係を適切に解決できるようにビルドを有効化

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

Co-Authored-By: Claude <noreply@anthropic.com>
ビルドエラーやその他の問題を特定するため、
VERBOSEログとexit codeを表示するように変更

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

Co-Authored-By: Claude <noreply@anthropic.com>
@void2610 void2610 closed this Jul 10, 2025
@void2610 void2610 deleted the ci-2 branch July 23, 2025 23: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.

2 participants