-
Notifications
You must be signed in to change notification settings - Fork 38.2k
Closed
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionalitygitGIT issuesGIT issuesgood first issueIssues identified as good for first-time contributorsIssues identified as good for first-time contributorshelp wantedIssues identified as good community contribution opportunitiesIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insiderson-release-notesIssue/pull request mentioned in release notesIssue/pull request mentioned in release notesverification-neededVerification of issue is requestedVerification of issue is requestedverifiedVerification succeededVerification succeeded
Milestone
Description
Issue Type: Bug
I'm using git pre-commit hooks via Husky to run the Prettier code formatter on my project. Sometimes I try to commit code that has a syntax error and when that happens the pre-commit hooks fail. If I commit from the terminal I get an informative error message like the following:
$ git commit -am "test"
husky > pre-commit (node v10.19.0)
Preparing... [started]
Preparing... [completed]
Running tasks... [started]
Running tasks for *.{ts,js,json,html,scss,md} [started]
prettier --write [started]
prettier --write [failed]
→
Running tasks for *.{ts,js,json,html,scss,md} [failed]
→
Running tasks... [failed]
Applying modifications... [started]
Applying modifications... [skipped]
→ Skipped because of errors from tasks.
Reverting to original state... [started]
Reverting to original state... [completed]
Cleaning up... [started]
Cleaning up... [completed]
× prettier found some errors. Please fix them and try committing again.
[error] packages\site\src\app\app.component.ts: SyntaxError: '{' expected. (9:3)
[error] 7 | })
[error] 8 | export class AppComponent
[error] > 9 | title = "site";
[error] | ^
[error] 10 | }
[error] 11 |
husky > pre-commit hook failed (add --no-verify to bypass)However when I commit via VSCode's built-in commands I get a much less informative error dialog which requires me to click "Open Git Log" and scroll back through a page or two of git output to find the detailed error message.

VS Code version: Code 1.43.2 (0ba0ca5, 2020-03-24T07:38:38.248Z)
OS version: Windows_NT x64 10.0.18363
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 x 2208) |
| GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: disabled_off protected_video_decode: enabled rasterization: enabled skia_renderer: disabled_off_ok video_decode: enabled viz_display_compositor: enabled_on viz_hit_test_surface_layer: disabled_off_ok webgl: enabled webgl2: enabled |
| Load (avg) | undefined |
| Memory (System) | 31.77GB (12.20GB free) |
| Process Argv | |
| Screen Reader | no |
| VM | 0% |
Extensions (43)
| Extension | Author (truncated) | Version |
|---|---|---|
| project-manager | ale | 10.11.0 |
| ng-template | Ang | 0.901.0 |
| spellright | ban | 3.0.50 |
| scratchpads | bue | 0.0.7 |
| find-related | eam | 0.9.0 |
| gitlens | eam | 10.2.1 |
| EditorConfig | Edi | 0.14.5 |
| prettier-vscode | esb | 4.1.1 |
| kotlin | fwc | 0.2.11 |
| todo-tree | Gru | 0.0.171 |
| rest-client | hum | 0.23.2 |
| search-node-modules | jas | 1.3.0 |
| svg | joc | 1.1.7 |
| escape-regexp | kir | 1.0.0 |
| vscode-commitizen | Kni | 0.8.4 |
| vscode-duplicate | mrm | 1.2.1 |
| vscode-scss | mrm | 0.9.0 |
| vscode-azureappservice | ms- | 0.16.4 |
| mssql | ms- | 1.9.0 |
| python | ms- | 2020.3.71659 |
| remote-containers | ms- | 0.106.0 |
| remote-ssh | ms- | 0.51.0 |
| remote-ssh-edit | ms- | 0.51.0 |
| remote-wsl | ms- | 0.42.4 |
| vscode-remote-extensionpack | ms- | 0.20.0 |
| azure-account | ms- | 0.8.9 |
| vscode-typescript-tslint-plugin | ms- | 1.2.3 |
| vsliveshare | ms- | 1.0.1891 |
| debugger-for-chrome | msj | 4.12.6 |
| java | red | 0.59.1 |
| vscode-xml | red | 0.11.0 |
| vscode-yaml | red | 0.7.2 |
| vscode-open | san | 0.1.0 |
| reveal | smu | 1.2.7 |
| highlight-matching-tag | vin | 0.9.6 |
| vscodeintellicode | Vis | 1.2.6 |
| vscode-java-debug | vsc | 0.25.1 |
| vscode-java-dependency | vsc | 0.9.0 |
| vscode-java-pack | vsc | 0.8.1 |
| vscode-java-test | vsc | 0.22.3 |
| vscode-maven | vsc | 0.21.2 |
| vim | vsc | 1.13.1 |
| material-theme | zhu | 3.2.5 |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionalitygitGIT issuesGIT issuesgood first issueIssues identified as good for first-time contributorsIssues identified as good for first-time contributorshelp wantedIssues identified as good community contribution opportunitiesIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insiderson-release-notesIssue/pull request mentioned in release notesIssue/pull request mentioned in release notesverification-neededVerification of issue is requestedVerification of issue is requestedverifiedVerification succeededVerification succeeded