Skip to content

Commit f69634f

Browse files
committed
Add prettier to pre-commit
1 parent df9f111 commit f69634f

File tree

2 files changed

+42
-33
lines changed

2 files changed

+42
-33
lines changed

.gitpod.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ ports:
1414
onOpen: ignore
1515
- port: 9229
1616
onOpen: ignore
17-
# Go proxy
17+
# Go proxy
1818
- port: 9999
1919
onOpen: ignore
2020
- port: 13001
2121
onOpen: ignore
22-
# Werft
22+
# Werft
2323
- port: 7777
2424
onOpen: ignore
25-
# Dev Theia
25+
# Dev Theia
2626
- port: 13444
2727
tasks:
2828
- name: Add Harvester kubeconfig
@@ -40,6 +40,9 @@ tasks:
4040
- name: Go
4141
init: leeway exec --filter-type go -v -- go mod verify
4242
openMode: split-right
43+
- name: pre-commit
44+
# install pre-commit hooks into git
45+
before: pre-commit install
4346
vscode:
4447
extensions:
4548
- bradlc.vscode-tailwindcss

.pre-commit-config.yaml

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,40 @@
11
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.0.1
4-
hooks:
5-
#- id: check-yaml
6-
# args: [--allow-multiple-documents]
7-
# - id: end-of-file-fixer
8-
- id: trailing-whitespace
9-
exclude: .*/src/main/java/io/gitpod/supervisor/api/.*
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.1.0
4+
hooks:
5+
#- id: check-yaml
6+
# args: [--allow-multiple-documents]
7+
# - id: end-of-file-fixer
8+
- id: trailing-whitespace
9+
exclude: .*/src/main/java/io/gitpod/supervisor/api/.*
1010

11-
- id: check-symlinks
12-
- id: mixed-line-ending
13-
- id: check-case-conflict
14-
- id: check-executables-have-shebangs
15-
- id: check-shebang-scripts-are-executable
16-
- id: check-merge-conflict
11+
- id: check-symlinks
12+
- id: mixed-line-ending
13+
- id: check-case-conflict
14+
- id: check-executables-have-shebangs
15+
- id: check-shebang-scripts-are-executable
16+
- id: check-merge-conflict
1717

18+
# keep fork in sync!
19+
- repo: https://github.com/gitpod-io/pre-commit-hooks
20+
rev: "2.1.5"
21+
hooks:
22+
- id: forbid-binary
23+
exclude: |
24+
(?x)^(
25+
.*example-layer.tar.gz|
26+
.*\.(png|svg|ico|gpg)|
27+
dev/version-manifest/version-manifest|
28+
.*gradle-wrapper\.jar
29+
)$
30+
- id: script-must-have-extension
31+
- id: shellcheck
32+
args: [-e, "SC1090,SC1091"]
33+
exclude: .*/gradlew$
1834

19-
# keep fork in sync!
20-
- repo: https://github.com/gitpod-io/pre-commit-hooks
21-
rev: "2.1.5"
22-
hooks:
23-
- id: forbid-binary
24-
exclude: |
25-
(?x)^(
26-
.*example-layer.tar.gz|
27-
.*\.(png|svg|ico|gpg)|
28-
dev/version-manifest/version-manifest|
29-
.*gradle-wrapper\.jar
30-
)$
31-
- id: script-must-have-extension
32-
- id: shellcheck
33-
args: [-e, "SC1090,SC1091"]
34-
exclude: .*/gradlew$
35+
- repo: https://github.com/pre-commit/mirrors-prettier
36+
rev: "v2.5.1"
37+
hooks:
38+
- id: prettier
39+
# Only enabled for WebApp components initially, to build consensus and incrementally onboard others
40+
files: ^components\/(server|gitpod-protocol|gitpod-db|dashboard)\/.*\.ts(x?)$

0 commit comments

Comments
 (0)