Skip to content

Commit 1f84614

Browse files
committed
Implemented pre-commit-hook setup, inline go mod decorations, onsave sast-scan
1 parent bfa3d05 commit 1f84614

19 files changed

Lines changed: 1801 additions & 502 deletions

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"activationEvents": [
2424
"onLanguage:json",
2525
"onLanguage:jsonc",
26-
"workspaceContains:**/package.json"
26+
"workspaceContains:**/package.json",
27+
"workspaceContains:**/go.mod"
2728
],
2829
"main": "./out/extension.js",
2930
"contributes": {
@@ -56,6 +57,14 @@
5657
{
5758
"command": "devguard.generateSbom",
5859
"title": "DevGuard: Generate SBOM (Run devguard-scanner SCA)"
60+
},
61+
{
62+
"command": "devguard.setupGitHooks",
63+
"title": "DevGuard: Setup Pre- and Post-Git-Commit-Hooks"
64+
},
65+
{
66+
"command": "devguard.removeGitHooks",
67+
"title": "DevGuard: Removes Pre- and Post-Git-Commit-Hooks that were previously setup by DevGuard"
5968
}
6069
],
6170
"configuration": {
@@ -107,6 +116,15 @@
107116
"type": "string",
108117
"default": "devguard-scanner",
109118
"description": "Path to the devguard-scanner CLI used by 'Generate SBOM'. Must be on PATH or an absolute path."
119+
},
120+
"devguard.sast.enabled": {
121+
122+
"type": "boolean",
123+
124+
"default": true,
125+
126+
"description": "Enable SAST and IaC scanning."
127+
110128
}
111129
}
112130
},

src/api/types.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,12 @@ export interface DependencyVulnFlat {
115115
// --- View model the UI consumes ---
116116

117117
export type DepType =
118-
| 'dependencies'
119-
| 'devDependencies'
120-
| 'optionalDependencies'
121-
| 'peerDependencies';
118+
| 'dependencies'
119+
| 'devDependencies'
120+
| 'optionalDependencies'
121+
| 'peerDependencies'
122+
| 'goDirectDependency'
123+
| 'goIndirectDependency';
122124

123125
export type VersionSource = 'lockfile' | 'node_modules' | 'range';
124126

@@ -163,3 +165,10 @@ export function toNpmPurl(name: string, version: string): string {
163165
export function encodePurlForPath(purl: string): string {
164166
return encodeURIComponent(purl);
165167
}
168+
169+
// Add this alongside toNpmPurl in api/types.ts:
170+
// pkg:golang/github.com/gin-gonic/gin@v1.9.1
171+
export function toGolangPurl(modulePath: string, version: string): string {
172+
return `pkg:golang/${modulePath}@${version}`;
173+
}
174+

0 commit comments

Comments
 (0)