Skip to content

Commit

Permalink
Added PSRule problem matcher (microsoft#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
BernieWhite committed Jun 1, 2021
1 parent 345d416 commit e1c1181
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 80 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Continue reading to see the changes included in the latest version.
- Added `PSRule: Run analysis` quick task to call `Assert-PSRule` for the current workspace. [#226](https://github.com/microsoft/PSRule-vscode/issues/226)
- To configure set `path`, `inputPath`, `baseline`, `module`, and `outcome` per task.
- The default task will run analysis in the current workspace using rules in `.ps-rule/`.
- Added `$PSRule` problem matcher for analysis tasks. [#234](https://github.com/microsoft/PSRule-vscode/issues/234)
- Source locations for rules failures are detected when using the `VisualStudioCode` style.
- General improvements:
- Preview channel will notify that a stable version is available. [#235](https://github.com/microsoft/PSRule-vscode/issues/235)
- Engineering:
Expand Down
205 changes: 129 additions & 76 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 39 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,42 @@
"fileMatch": "**/*.Rule.yaml",
"url": "./schemas/PSRule-language.schema.json"
}
],
"problemMatchers": [
{
"name": "PSRule",
"label": "PSRule",
"owner": "PSRule",
"source": "PSRule",
"severity": "error",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"pattern": [
{
"regexp": "^\\s+(FAIL)\\s+(.*)$",
"code": 2
},
{
"regexp": "^$"
},
{
"regexp": "^\\s+(.*)$",
"message": 1
},
{
"regexp": "^$"
},
{
"regexp": "^\\s+(.*): (.*):(\\d+):(\\d+)$",
"file": 2,
"line": 3,
"column": 4,
"loop": true
}
]
}
]
},
"scripts": {
Expand Down Expand Up @@ -210,8 +246,8 @@
"@types/mocha": "^8.2.2",
"@types/node": "^15.6.1",
"@types/vscode": "1.56.0",
"@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.25.0",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"esbuild": "^0.12.5",
"eslint": "^7.27.0",
"glob": "^7.1.7",
Expand All @@ -220,7 +256,7 @@
"minimist": ">=1.2.5",
"mocha": "^8.4.0",
"typescript": "^4.3.2",
"vsce": "^1.88.0",
"vsce": "^1.91.0",
"vscode-test": "^1.5.2"
}
}
3 changes: 2 additions & 1 deletion src/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ export class PSRuleTaskProvider implements vscode.TaskProvider {
if (definition === undefined) {
definition = {
type: PSRuleTaskProvider.taskType,
matcher: '$PSRule',
};
}

Expand Down Expand Up @@ -273,7 +274,7 @@ export class PSRuleTaskProvider implements vscode.TaskProvider {
executable: pwsh.path,
shellArgs: ['-NoLogo', '-NoProfile', '-NonInteractive', '-Command'],
env: {
PSRULE_OUTPUT_STYLE: 'Client',
PSRULE_OUTPUT_STYLE: 'VisualStudioCode',
PSRULE_OUTPUT_AS: outputAs.toString(),
PSRULE_OUTPUT_CULTURE: vscode.env.language,
PSRULE_OUTPUT_BANNER: 'Minimal',
Expand Down

0 comments on commit e1c1181

Please sign in to comment.