Skip to content

Commit 4266d1b

Browse files
committed
chore: make pre-commit run -a pass
1 parent 58fb5d1 commit 4266d1b

18 files changed

+77
-77
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ For example:
3030
## PR check list
3131

3232
- [ ] As much as possible, the changes include tests
33-
- [ ] If the changes affect the end user (new feature, behavior change, bug fix) then the PR has a changelog entry.
34-
33+
- [ ] If the changes affect the end user (new feature, behavior change, bug fix) then the PR has a changelog entry.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Whether you’re a solo developer or part of a team, GitGuardian scales with you
2222

2323
- **Ignore Secrets**: After a scan, hover over the identified secret and select "GitGuardian: Ignore Secret" to add it to `.gitguardian.yaml`.
2424
- **Quota Tracking**: Run "GitGuardian: Show Quota" to monitor API call usage. Personal accounts include up to 10,000 monthly API calls.
25-
- **Check API Quota**: Stay aware of usage by running "GitGuardian: Show Quota."
25+
- **Check API Quota**: Stay aware of usage by running "GitGuardian: Show Quota."
2626

2727
### Support & Contributions
2828

@@ -33,4 +33,4 @@ Whether you’re a solo developer or part of a team, GitGuardian scales with you
3333
### Release Notes & License
3434

3535
- **Updates**: See the [Changelog](https://github.com/GitGuardian/gitguardian-vscode/blob/main/CHANGELOG.md).
36-
- **License**: GitGuardian CLI (`ggshield`) and this extension are MIT licensed.
36+
- **License**: GitGuardian CLI (`ggshield`) and this extension are MIT licensed.

src/extension.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,33 +39,33 @@ import {
3939

4040
function registerOpenViewsCommands(
4141
context: ExtensionContext,
42-
outputChannel: any
42+
outputChannel: any,
4343
) {
4444
const showOutputCommand = commands.registerCommand(
4545
"gitguardian.showOutput",
4646
() => {
4747
outputChannel.show();
48-
}
48+
},
4949
);
5050

5151
const openSidebarCommand = commands.registerCommand(
5252
"gitguardian.openSidebar",
5353
() => {
5454
commands.executeCommand("workbench.view.extension.gitguardian");
55-
}
55+
},
5656
);
5757

5858
const openProblemsCommand = commands.registerCommand(
5959
"gitguardian.openProblems",
6060
() => {
6161
commands.executeCommand("workbench.actions.view.problems");
62-
}
62+
},
6363
);
6464

6565
context.subscriptions.push(
6666
showOutputCommand,
6767
openSidebarCommand,
68-
openProblemsCommand
68+
openProblemsCommand,
6969
);
7070
}
7171

@@ -76,50 +76,50 @@ export async function activate(context: ExtensionContext) {
7676
const ggshieldResolver = new GGShieldResolver(
7777
outputChannel,
7878
context,
79-
configuration
79+
configuration,
8080
);
8181
const ggshieldViewProvider = new GitGuardianWebviewProvider(
8282
configuration,
8383
context.extensionUri,
84-
context
84+
context,
8585
);
8686

8787
const ggshieldRemediationMessageViewProvider =
8888
new GitGuardianRemediationMessageWebviewProvider(
8989
configuration,
9090
context.extensionUri,
91-
context
91+
context,
9292
);
9393
const ggshieldQuotaViewProvider = new GitGuardianQuotaWebviewProvider(
9494
configuration,
9595
context.extensionUri,
96-
context
96+
context,
9797
);
9898
window.registerWebviewViewProvider("gitguardianView", ggshieldViewProvider);
9999
window.registerWebviewViewProvider(
100100
"gitguardianRemediationMessageView",
101-
ggshieldRemediationMessageViewProvider
101+
ggshieldRemediationMessageViewProvider,
102102
);
103103
window.registerWebviewViewProvider(
104104
"gitguardianQuotaView",
105-
ggshieldQuotaViewProvider
105+
ggshieldQuotaViewProvider,
106106
);
107107
context.subscriptions.push(
108108
ggshieldViewProvider,
109109
ggshieldRemediationMessageViewProvider,
110-
ggshieldQuotaViewProvider
110+
ggshieldQuotaViewProvider,
111111
);
112112

113113
createStatusBarItem(context);
114114

115115
//generic commands to open correct view on status bar click
116116
registerOpenViewsCommands(context, outputChannel);
117117
commands.registerCommand("gitguardian.refreshQuota", () =>
118-
ggshieldQuotaViewProvider.refresh()
118+
ggshieldQuotaViewProvider.refresh(),
119119
);
120120

121121
context.subscriptions.push(
122-
languages.registerHoverProvider("*", new GitGuardianSecretHoverProvider())
122+
languages.registerHoverProvider("*", new GitGuardianSecretHoverProvider()),
123123
);
124124

125125
if (!checkGitInstalled()) {
@@ -149,12 +149,12 @@ export async function activate(context: ExtensionContext) {
149149
scanFile(
150150
textDocument.fileName,
151151
textDocument.uri,
152-
ggshieldResolver.configuration
152+
ggshieldResolver.configuration,
153153
);
154154
}
155155
}),
156156
workspace.onDidCloseTextDocument((textDocument) =>
157-
cleanUpFileDiagnostics(textDocument.uri)
157+
cleanUpFileDiagnostics(textDocument.uri),
158158
),
159159
commands.registerCommand("gitguardian.quota", () => {
160160
showAPIQuota(ggshieldResolver.configuration);
@@ -173,12 +173,12 @@ export async function activate(context: ExtensionContext) {
173173
ignoreSecret(
174174
ggshieldResolver.configuration,
175175
diagnosticData.secretSha,
176-
secretName
176+
secretName,
177177
);
178178
scanFile(
179179
currentFile,
180180
Uri.file(currentFile),
181-
ggshieldResolver.configuration
181+
ggshieldResolver.configuration,
182182
);
183183
}),
184184
commands.registerCommand("gitguardian.authenticate", async () => {
@@ -187,7 +187,7 @@ export async function activate(context: ExtensionContext) {
187187
ggshieldResolver.configuration,
188188
outputChannel,
189189
ggshieldViewProvider.getView() as WebviewView,
190-
context
190+
context,
191191
)
192192
.then(async () => {
193193
await updateAuthenticationStatus(context, configuration);
@@ -212,8 +212,8 @@ export async function activate(context: ExtensionContext) {
212212
ggshieldViewProvider.refresh();
213213
ggshieldRemediationMessageViewProvider.refresh();
214214
ggshieldQuotaViewProvider.refresh();
215-
}
216-
)
215+
},
216+
),
217217
);
218218
}
219219

src/ggshield-webview/gitguardian-quota-webview.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ export class GitGuardianQuotaWebviewProvider
1515
constructor(
1616
private ggshieldConfiguration: GGShieldConfiguration,
1717
private readonly _extensionUri: vscode.Uri,
18-
private context: vscode.ExtensionContext
18+
private context: vscode.ExtensionContext,
1919
) {}
2020

2121
public resolveWebviewView(
2222
webviewView: vscode.WebviewView,
2323
context: vscode.WebviewViewResolveContext,
24-
_token: vscode.CancellationToken
24+
_token: vscode.CancellationToken,
2525
) {
2626
this._view = webviewView;
2727
this.refresh();

src/ggshield-webview/gitguardian-remediation-message-view.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ export class GitGuardianRemediationMessageWebviewProvider
1414
constructor(
1515
private ggshieldConfiguration: GGShieldConfiguration,
1616
private readonly _extensionUri: vscode.Uri,
17-
private context: vscode.ExtensionContext
17+
private context: vscode.ExtensionContext,
1818
) {
1919
this.updateRemediationMessage();
2020
}
2121

2222
public resolveWebviewView(
2323
webviewView: vscode.WebviewView,
2424
context: vscode.WebviewViewResolveContext,
25-
_token: vscode.CancellationToken
25+
_token: vscode.CancellationToken,
2626
) {
2727
this._view = webviewView;
2828
this.refresh();
@@ -38,7 +38,7 @@ export class GitGuardianRemediationMessageWebviewProvider
3838
private checkAuthenticationStatus() {
3939
this.isAuthenticated = this.context.workspaceState.get(
4040
"authenticationStatus",
41-
false
41+
false,
4242
);
4343
}
4444

src/ggshield-webview/gitguardian-webview-view.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import { AuthenticationStatus, ConfigSource } from "../lib/authentication";
33
import { GGShieldConfiguration } from "../lib/ggshield-configuration";
44

55
const projectDiscussionUri = vscode.Uri.parse(
6-
"https://github.com/GitGuardian/gitguardian-vscode/discussions"
6+
"https://github.com/GitGuardian/gitguardian-vscode/discussions",
77
);
88
const projectIssuesUri = vscode.Uri.parse(
9-
"https://github.com/GitGuardian/gitguardian-vscode/issues"
9+
"https://github.com/GitGuardian/gitguardian-vscode/issues",
1010
);
1111
const feedbackFormUri = vscode.Uri.parse(
12-
"https://docs.google.com/forms/d/e/1FAIpQLSc_BemGrdQfxp6lg7KgeDoB32XZg8yMfapk2gbemu0mVfskDQ/viewform"
12+
"https://docs.google.com/forms/d/e/1FAIpQLSc_BemGrdQfxp6lg7KgeDoB32XZg8yMfapk2gbemu0mVfskDQ/viewform",
1313
);
1414
const documentationUri = vscode.Uri.parse(
15-
"https://docs.gitguardian.com/ggshield-docs/configuration"
15+
"https://docs.gitguardian.com/ggshield-docs/configuration",
1616
);
1717

1818
export class GitGuardianWebviewProvider implements vscode.WebviewViewProvider {
@@ -22,13 +22,13 @@ export class GitGuardianWebviewProvider implements vscode.WebviewViewProvider {
2222
constructor(
2323
private ggshieldConfiguration: GGShieldConfiguration,
2424
private readonly _extensionUri: vscode.Uri,
25-
private context: vscode.ExtensionContext
25+
private context: vscode.ExtensionContext,
2626
) {}
2727

2828
public resolveWebviewView(
2929
webviewView: vscode.WebviewView,
3030
context: vscode.WebviewViewResolveContext,
31-
_token: vscode.CancellationToken
31+
_token: vscode.CancellationToken,
3232
) {
3333
this._view = webviewView;
3434

@@ -61,14 +61,14 @@ export class GitGuardianWebviewProvider implements vscode.WebviewViewProvider {
6161
const webview = this._view.webview;
6262

6363
const styleUri = webview.asWebviewUri(
64-
vscode.Uri.joinPath(this._extensionUri, "media", "main.css")
64+
vscode.Uri.joinPath(this._extensionUri, "media", "main.css"),
6565
);
6666
const logoUri = webview.asWebviewUri(
6767
vscode.Uri.joinPath(
6868
this._extensionUri,
6969
"images",
70-
"gitguardian-icon-primary700-background.svg"
71-
)
70+
"gitguardian-icon-primary700-background.svg",
71+
),
7272
);
7373

7474
console.log(authenticationStatus);

src/gitguardian-interface/gitguardian-hover-provider.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export class GitGuardianSecretHoverProvider implements vscode.HoverProvider {
44
public provideHover(
55
document: vscode.TextDocument,
66
position: vscode.Position,
7-
token: vscode.CancellationToken
7+
token: vscode.CancellationToken,
88
): vscode.ProviderResult<vscode.Hover> {
99
const diagnostics = vscode.languages.getDiagnostics(document.uri);
1010

@@ -20,7 +20,7 @@ export class GitGuardianSecretHoverProvider implements vscode.HoverProvider {
2020
const encodedDiagnosticData = encodeURIComponent(diagnosticData);
2121

2222
hoverMessage.appendMarkdown(
23-
`[GitGuardian: Ignore Secret (update .gitguardian.yaml)](command:gitguardian.ignoreSecret?${encodedDiagnosticData} "Click to ignore this incident")`
23+
`[GitGuardian: Ignore Secret (update .gitguardian.yaml)](command:gitguardian.ignoreSecret?${encodedDiagnosticData} "Click to ignore this incident")`,
2424
);
2525
return new vscode.Hover(hoverMessage, diagnostic.range);
2626
}
@@ -65,9 +65,9 @@ function extractInfosFromMessage(message: string): {
6565

6666
export function generateSecretName(
6767
currentFile: string,
68-
uriDiagnostic: any
68+
uriDiagnostic: any,
6969
): string {
7070
return `${uriDiagnostic.detector} - ${vscode.workspace.asRelativePath(
71-
currentFile
71+
currentFile,
7272
)}:l.${uriDiagnostic.startLine}`;
7373
}

src/lib/authentication.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function getSource(sourceString: string, isInstance: boolean): ConfigSource {
6060
*/
6161
export async function updateAuthenticationStatus(
6262
context: ExtensionContext,
63-
configuration: GGShieldConfiguration
63+
configuration: GGShieldConfiguration,
6464
): Promise<void> {
6565
const proc = runGGShieldCommand(configuration, ["api-status", "--json"]);
6666

@@ -103,7 +103,7 @@ export async function loginGGShield(
103103
configuration: GGShieldConfiguration,
104104
outputChannel: any,
105105
webviewView: WebviewView,
106-
context: ExtensionContext
106+
context: ExtensionContext,
107107
): Promise<void> {
108108
const { ggshieldPath } = configuration;
109109

@@ -162,7 +162,7 @@ export async function loginGGShield(
162162

163163
export async function logoutGGShield(
164164
configuration: GGShieldConfiguration,
165-
context: ExtensionContext
165+
context: ExtensionContext,
166166
): Promise<void> {
167167
let cmd = ["auth", "logout"];
168168
const authStatus: AuthenticationStatus | undefined =

src/lib/ggshield-api.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function getAPIquota(configuration: GGShieldConfiguration): number {
5757
* Show error message on failure
5858
*/
5959
export function ignoreLastFound(
60-
configuration: GGShieldConfiguration
60+
configuration: GGShieldConfiguration,
6161
): undefined {
6262
if (!configuration) {
6363
window.showErrorMessage("ggshield: Missing settings");
@@ -86,7 +86,7 @@ export function ignoreLastFound(
8686
export function ignoreSecret(
8787
configuration: GGShieldConfiguration,
8888
secretSha: string,
89-
secretName: string
89+
secretName: string,
9090
): boolean {
9191
const proc = runGGShieldCommand(configuration, [
9292
"secret",
@@ -132,7 +132,7 @@ export function cleanUpFileDiagnostics(fileUri: Uri): void {
132132
export function scanFile(
133133
filePath: string,
134134
fileUri: Uri,
135-
configuration: GGShieldConfiguration
135+
configuration: GGShieldConfiguration,
136136
): void {
137137
if (isFileGitignored(filePath)) {
138138
updateStatusBarItem(StatusBarStatus.ignoredFile);
@@ -151,7 +151,7 @@ export function scanFile(
151151
.split("\n")
152152
.filter(
153153
(stderrLine) =>
154-
stderrLine.length > 0 && !stderrLine.includes("Scanning Path...") // ggshield outputs this info message on stderr, ignore it
154+
stderrLine.length > 0 && !stderrLine.includes("Scanning Path..."), // ggshield outputs this info message on stderr, ignore it
155155
)
156156
.join("\n");
157157
if (errorMessage.length > 0) {
@@ -164,7 +164,7 @@ export function scanFile(
164164
// or when the file is ignored in the .gitguardian.yaml
165165
if (
166166
proc.stderr.includes(
167-
"Error: An ignored file or directory cannot be scanned"
167+
"Error: An ignored file or directory cannot be scanned",
168168
)
169169
) {
170170
updateStatusBarItem(StatusBarStatus.ignoredFile);

src/lib/ggshield-configuration.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ export class GGShieldConfiguration {
66
constructor(
77
ggshieldPath: string = "",
88
apiUrl: string = "",
9-
allowSelfSigned: boolean = false
9+
allowSelfSigned: boolean = false,
1010
) {
1111
this.ggshieldPath = ggshieldPath;
1212
this.apiUrl = apiUrl;
1313
this.allowSelfSigned = allowSelfSigned;
1414
}
1515
}
16-

0 commit comments

Comments
 (0)