Skip to content

Commit 816b609

Browse files
chore(settings): remove ggshield path from settings
1 parent 1d0cf12 commit 816b609

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131
"configuration": {
3232
"title": "GitGuardian",
3333
"properties": {
34-
"gitguardian.GGShieldPath": {
35-
"type": "string",
36-
"default": null,
37-
"markdownDescription": "You can override the embedded GitGuardian CLI binary (ggshield) with a custom path"
38-
},
3934
"gitguardian.apiUrl": {
4035
"type": "string",
4136
"default": "",

src/lib/ggshield-configuration-utils.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ export function getConfiguration(
1818
const apiUrl: string | undefined = config.get("apiUrl");
1919
const allowSelfSigned: boolean = config.get("allowSelfSigned", false);
2020
return new GGShieldConfiguration(
21-
ggshieldPath
22-
? ggshieldPath
23-
: getBinaryAbsolutePath(os.platform(), os.arch(), context),
21+
getBinaryAbsolutePath(os.platform(), os.arch(), context),
2422
apiUrl,
2523
allowSelfSigned || false
2624
);

src/test/suite/lib/ggshield-configuration-utils.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ suite("getConfiguration", () => {
1616
});
1717

1818
test("Vscode settings are correctly read", () => {
19+
const context = {} as ExtensionContext;
20+
simple.mock(context, "asAbsolutePath").returnWith("");
1921
getConfigurationMock.returnWith({
2022
get: (key: string) => {
21-
if (key === "GGShieldPath") {
22-
return "path/to/ggshield";
23-
}
2423
if (key === "apiUrl") {
2524
return "https://custom-url.com";
2625
}
@@ -29,7 +28,7 @@ suite("getConfiguration", () => {
2928
}
3029
},
3130
});
32-
const configuration = getConfiguration({} as ExtensionContext);
31+
const configuration = getConfiguration(context);
3332

3433
// Assert both workspace.getConfiguration and GGShieldConfiguration constructor were called
3534
assert(
@@ -38,7 +37,6 @@ suite("getConfiguration", () => {
3837
);
3938

4039
// Assert that the configuration has the expected values
41-
assert.strictEqual(configuration.ggshieldPath, "path/to/ggshield");
4240
assert.strictEqual(configuration.apiUrl, "https://custom-url.com");
4341
assert.strictEqual(configuration.allowSelfSigned, true);
4442
});

0 commit comments

Comments
 (0)