Skip to content

Commit

Permalink
Merge pull request #45 from GitGuardian/jgriffe/run-all-precommit
Browse files Browse the repository at this point in the history
chore: run all pre-commit hooks on all files
  • Loading branch information
gg-jonathangriffe authored Nov 6, 2024
2 parents 9db9df0 + ecf004d commit 6935c3b
Show file tree
Hide file tree
Showing 25 changed files with 252 additions and 234 deletions.
38 changes: 16 additions & 22 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": [
"out",
"dist",
"**/*.d.ts"
]
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": ["out", "dist", "**/*.d.ts"]
}
9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report copy.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
name: Support
about: If you have any questions—whether about unclear features or insufficient documentation—feel free to reach out.
title: ''
labels: ''
assignees: ''

---
title: ""
labels: ""
assignees: ""
---
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
title: ""
labels: bug
assignees: ''

assignees: ""
---

## Environment
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: vsixbuilder

on:
push:
branches: [ main ]
branches: [main]

permissions:
contents: read
Expand All @@ -13,12 +13,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Setup VSCE
run: sudo yarn global add vsce@latest

Expand All @@ -29,11 +29,9 @@ jobs:
run: |
vsce package --baseContentUrl https://github.com/GitGuardian/gitguardian-vscode/ --allow-missing-repository
mv *.vsix gitguardian-vscode.vsix
- name: Upload extension package
uses: actions/upload-artifact@v4
with:
name: gitguardian-vscode.vsix
path: gitguardian-vscode.vsix


8 changes: 3 additions & 5 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint"
]
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": ["dbaeumer.vscode-eslint"]
}
50 changes: 22 additions & 28 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,26 @@
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
18 changes: 9 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,38 @@
# GitGuardian Secret Security Changelog

## [0.4.0]

### Modified

- Load .env configuration and ensure environment specific settings are applied
- Prevent scanning gitignored files
- Status bar displays error when scanning ignored files
- Status bar displays error when scanning ignored files

### Fixed

- Stop displaying error when scanning file ignored in .gitguardian.yaml

## [0.3.0]

### Modified

- Remove API key from settings
- Improve logging for invalid settings

### Fixed

- Handled Authentication if the .gitguardian.yaml is malformed

## [0.2.0]

### modified

- Do not display CLI path in settings

## [0.1.0]

### Added

- One-Click Authentication
- Automatic Secret Scanning on Save
- Custom Remediation Guidelines
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Leave a message on the issue tracker that you're interested in fixing this bug.

## Proposing a new feature

Open an issue on the [issue tracker](https://github.com/GitGuardian/gitguardian-vscode/issues/new?assignees=&labels=Feature+request&projects=&template=feature_request.md&title=) with a `feature request` label.
Open an issue on the [issue tracker](https://github.com/GitGuardian/gitguardian-vscode/issues/new?assignees=&labels=Feature+request&projects=&template=feature_request.md&title=) with a `feature request` label.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,14 @@ With a free personal account, you have access to 10,000 API calls each month.

## Support, Feedback, Contributing

This project is open to feature requests/suggestions, bug reports etc.
This project is open to feature requests/suggestions, bug reports etc.

If you need support or found a bug : https://github.com/GitGuardian/gitguardian-vscode/issues/new/choose

For ideas and general discussions : https://github.com/GitGuardian/gitguardian-vscode/discussions

Security reports : Please report it using our [Vulnerability Disclosure Portal](https://vdp.gitguardian.com).


## Release Notes

See [Change log](https://github.com/GitGuardian/gitguardian-vscode/blob/main/CHANGELOG.md)
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ If you believe you have found a security vulnerability in any GitGuardian-owned

## Preferred Languages

We prefer all communications to be in English or French.
We prefer all communications to be in English or French.
4 changes: 2 additions & 2 deletions SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Support

If you have a question or need help you can reach out to us via :
If you have a question or need help you can reach out to us via :

- The [issue tracker](https://github.com/GitGuardian/gitguardian-vscode/issues) if you found a bug, do not understand something, etc ..
- or the [Discussion tab](https://github.com/GitGuardian/gitguardian-vscode/discussions) where you can open a new thread for a feature idea or anything else
- or the [Discussion tab](https://github.com/GitGuardian/gitguardian-vscode/discussions) where you can open a new thread for a feature idea or anything else
35 changes: 17 additions & 18 deletions media/main.css
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
body {
height: 100vh;
font-size: 16px;
height: 100vh;
font-size: 16px;
}

body.vscode-light {
color: black;
color: black;
}

body.vscode-dark {
color: white;
color: white;
}

h1 {
font-size: 1.3em;
font-size: 1.3em;
}


.anonymous {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}

button.large {
background-color: #1b2d55;
color: white;
border: none;
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
border-radius: 5px;
margin: 2em 0;
background-color: #1b2d55;
color: white;
border: none;
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
border-radius: 5px;
margin: 2em 0;
}
5 changes: 4 additions & 1 deletion src/ggshield-webview/gitguardian-quota-webview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ export class GitGuardianQuotaWebviewProvider
}

private async checkAuthenticationStatus() {
this.isAuthenticated = this.context.globalState.get("isAuthenticated", false);
this.isAuthenticated = this.context.globalState.get(
"isAuthenticated",
false
);
}

private async updateQuota() {
Expand Down
22 changes: 14 additions & 8 deletions src/ggshield-webview/gitguardian-remediation-message-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import * as vscode from "vscode";
export class GitGuardianRemediationMessageWebviewProvider
implements vscode.WebviewViewProvider
{
public static readonly viewType = "gitguardian.gitguardianRemediationMessageView";
public static readonly viewType =
"gitguardian.gitguardianRemediationMessageView";
private _view?: vscode.WebviewView;
private isAuthenticated: boolean = false;
private remediationMessage: string = "";
Expand Down Expand Up @@ -37,12 +38,17 @@ export class GitGuardianRemediationMessageWebviewProvider
}

private async checkAuthenticationStatus() {
this.isAuthenticated = this.context.globalState.get("isAuthenticated", false);
this.isAuthenticated = this.context.globalState.get(
"isAuthenticated",
false
);
}

private async updateRemediationMessage() {
if (this.isAuthenticated) {
this.remediationMessage = await getRemediationMessage(this.ggshieldConfiguration);
this.remediationMessage = await getRemediationMessage(
this.ggshieldConfiguration
);
}
}

Expand All @@ -54,11 +60,11 @@ export class GitGuardianRemediationMessageWebviewProvider

private escapeHtml(unsafe: string): string {
return unsafe
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
}

private getHtmlForWebview(): string {
Expand Down
Loading

0 comments on commit 6935c3b

Please sign in to comment.