PowerShell / PowerShell/PSScriptAnalyzer
Extra level of indentation within #region/#endregion tags
まだ誰も着手していません。
- 主要言語
- C#
- スター
- 2.2k
- フォーク
- 414
- 平均マージ
- 13時間 1分
- マージ済み PR(30日)
- 2
説明
Support indenting an extra level inside regions, both with analyzing and auto-formatting, so it's possible to verify/auto-format code to look like this:
#region
Get-ChildItem
#endregion
Currently the formatter will do this (because #region/#endregion isn't a token that merits an indent
#region
Get-ChildItem
#endregion
After discussing in the PowerShell slack, I was pointed towards this area where the change would need to be made:
https://github.com/PowerShell/PSScriptAnalyzer/blob/c78f5a60c1f49a5e767286ff6323a2ec0788991a/Rules/UseConsistentIndentation.cs#L146
I believe specifically this would need to be handled in the default part of the switch block.
Per @bergmeister this would most likely get added as a configurable option for the PSUseConsistentIndentation rule.
I'm putting this here because I sort of volunteered to work on it, but it will be a very low priority for me, and also I don't want this information to disappear from the Slack buffer and be gone entirely.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Rules/UseConsistentIndentation.cs の、参照されている行付近にある switch ブロック、特にその default case から始めます。PSUseConsistentIndentation ルールが構成をどのように処理するかを調べ、そのうえで、解析と自動フォーマットの両方で #region/#endregion タグ内のコードをインデントできるように変更内容を定義します。示されているリージョンレイアウトが、意図された構成可能なオプションによってサポートされれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- csharp, powershell
- 領域
- tooling
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100