PowerShell / PowerShell/PSScriptAnalyzer
[RULE] PSScriptAnalyzerSettingsSchema
まだ誰も着手していません。
- 主要言語
- C#
- スター
- 2.2k
- フォーク
- 414
- 平均マージ
- 13時間 1分
- マージ済み PR(30日)
- 2
説明
User Story
- As a writer of PSScriptAnalyzer settings files
- I want static code checking of the structure of PSScriptAnalyzer settings files
- so that I can catch schematic violations early and easily.
Specification Details
The static schema for an Invoke-ScriptAnalyzer -Settings hashtable is not formally documented in a rigorous format at present. However, the current implementation implicitly adheres to the following as expressed using JSON Schema (with the exception of case-sensitivity):
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "PSScriptAnalyzerSettings",
"type": "object",
"definitions": {
"SeverityString": {
"type": "string",
"pattern": "Error|Warning|Information"
},
"stringOrStrings": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"properties": {
"CustomRulePath": {
"$ref": "#/definitions/stringOrStrings"
},
"ExcludeRules": {
"$ref": "#/definitions/stringOrStrings"
},
"IncludeDefaultRules": {
"type": "boolean"
},
"IncludeRules": {
"$ref": "#/definitions/stringOrStrings"
},
"RecurseCustomRulePath": {
"type": "boolean"
},
"Rules": {
"type": "object",
"additionalProperties": {
"type": "object"
}
},
"Severity": {
"oneOf": [
{
"$ref": "#/definitions/SeverityString"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/SeverityString"
}
}
]
}
},
"additionalProperties": false
}
The static schema of an Invoke-ScriptAnalyzer -Settings hashtable, as currently implemented and as expressed above (but with the addition of global case-insensitivity), shall serve as the specification for the proposed "PSScriptAnalyzerSettingsSchema" rule. Additional requirements are as follows:
- The schema utilized by the "PSScriptAnalyzerSettingsSchema" rule MUST be enforced by the
Invoke-ScriptAnalyzercommand. - The implementation of the "PSScriptAnalyzerSettingsSchema" rule SHOULD share source code for validation logic with the
Invoke-ScriptAnalyzercommand in an appropriately modular fashion such that changes to the aforementioned schema's specification correspond one-to-one to changes in the source code.
PSScriptAnalyzer Version
The latest version of PSScriptAnalyzer as of this writing is 1.18.1.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず Invoke-ScriptAnalyzer コマンドと提案されている PSScriptAnalyzerSettingsSchema ルールを見つけ、次に設定が現在どのように検証されているかを追跡します。指定された大文字と小文字を区別しないスキーマがコマンドによって適用され、必要に応じてルールがコマンドと検証ロジックを共有すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- powershell
- 領域
- tooling
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100