Skip to content

Commit

Permalink
Merge pull request #14 from aquasecurity/owenr-dont-use-terminal-for-…
Browse files Browse the repository at this point in the history
…command

Switch to not use the terminal
  • Loading branch information
Owen Rumney authored Jan 10, 2022
2 parents 124b9a8 + 33178ac commit e57cdc2
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 129 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ dist
node_modules
.vscode-test/
*.vsix
*.js
*.js
package-lock.json
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to the "tfsec" extension will be documented in this file.

### 1.4.0
- Use output channel instead of terminal for better cross platform command support
- Remove explicit run command and use refresh to update the list with a fresh run
- Add ignore all severity
- Fix the refresh after ignores have been completed
- Add more information to the update output

### 1.3.1
- Update the repository link

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ Ignore codes will be automatically resolved and the description of the error wil

## Release Notes

### 1.4.0
- Use output channel instead of terminal for better cross platform command support
- Remove explicit run command and use refresh to update the list with a fresh run
- Add ignore all severity
- Fix the refresh after ignores have been completed
- Add more information to the update output

### 1.3.1
- Update the repository link

Expand Down
Binary file removed media/tfesc.png
Binary file not shown.
18 changes: 9 additions & 9 deletions package-lock.json

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

29 changes: 14 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "tfsec",
"publisher": "tfsec",
"description": "tfsec integration for Visual Studio Code",
"version": "1.3.1",
"version": "1.4.0",
"engines": {
"vscode": "^1.54.0"
},
Expand Down Expand Up @@ -67,17 +67,13 @@
"command": "tfsec.run",
"title": "tfsec: Run tfsec against workspace",
"icon": {
"light": "resources/light/run.svg",
"dark": "resources/dark/run.svg"
"light": "resources/light/refresh.svg",
"dark": "resources/dark/refresh.svg"
}
},
{
"command": "tfsec.refresh",
"title": "tfsec: Refresh the issue list",
"icon": {
"light": "resources/light/refresh.svg",
"dark": "resources/dark/refresh.svg"
}
"title": "tfsec: Refresh the issue list"
},
{
"command": "tfsec.updatebinary",
Expand All @@ -95,6 +91,10 @@
"command": "tfsec.ignoreAll",
"title": "Ignore all instances"
},
{
"command": "tfsec.ignoreSeverity",
"title": "Ignore all instances of severity"
},
{
"command": "tfsec.version",
"title": "tfsec: Get the current version of tfsec"
Expand Down Expand Up @@ -149,15 +149,10 @@
"when": "view == tfsec.issueview",
"group": "navigation@1"
},
{
"command": "tfsec.refresh",
"when": "view == tfsec.issueview",
"group": "navigation@2"
},
{
"command": "tfsec.updatebinary",
"when": "view == tfsec.issueview",
"group": "navigation@3"
"group": "navigation@2"
}
],
"view/item/context": [
Expand All @@ -168,6 +163,10 @@
{
"command": "tfsec.ignoreAll",
"when": "view == tfsec.issueview && viewItem == TFSEC_CODE"
},
{
"command": "tfsec.ignoreSeverity",
"when": "view == tfsec.issueview && viewItem == TFSEC_SEVERITY"
}
]
}
Expand All @@ -189,7 +188,7 @@
"eslint": "^7.27.0",
"glob": "^7.1.7",
"mocha": "^8.4.0",
"typescript": "^4.2.4",
"typescript": "^4.5.4",
"vscode-test": "^1.5.0"
},
"repository": {
Expand Down
10 changes: 1 addition & 9 deletions src/explorer/issues_treeview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,13 @@ export class TfsecIssueProvider implements vscode.TreeDataProvider<TfsecTreeItem
if (!fs.existsSync(this.resultsStoragePath)) {
fs.closeSync(fs.openSync(this.resultsStoragePath, 'w'));
}
// create the file watcher to refresh the tree when changes are made
fs.watch(this.resultsStoragePath, (eventType) => {
if (eventType !== "change") {
return;
}
vscode.window.showInformationMessage("tfsec run complete, results file updated");
// short wait for the file to be written before refreshing the tree
setTimeout(() => { vscode.commands.executeCommand("tfsec.refresh"); }, 250);
});
}
}

refresh(): void {
this.taintResults = true;
this._onDidChangeTreeData.fire();
vscode.window.showInformationMessage("tfsec results updated");
}

// when there is a tfsec output file, load the results
Expand Down
Loading

0 comments on commit e57cdc2

Please sign in to comment.