Skip to content

Commit 103c4c9

Browse files
committed
feat: Adding VSCode settings and extensions
Signed-off-by: Michael Ethridge <[email protected]>
1 parent 79ac0d2 commit 103c4c9

File tree

5 files changed

+149
-12
lines changed

5 files changed

+149
-12
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
- id: check-merge-conflict
1515
- id: end-of-file-fixer
1616
- repo: https://github.com/antonbabenko/pre-commit-terraform
17-
rev: v1.83.5
17+
rev: v1.83.6
1818
hooks:
1919
- id: terraform_fmt
2020
- id: terraform_validate

.terraform.lock.hcl

Lines changed: 28 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.vscode/extensions.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4+
5+
// List of extensions which should be recommended for users of this workspace.
6+
"recommendations": [
7+
"hashicorp.hcl",
8+
"hashicorp.sentinel",
9+
"hashicorp.terraform",
10+
"oderwat.indent-rainbow",
11+
"byi8220.indented-block-highlighting",
12+
"cardinal90.multi-cursor-case-preserve"
13+
],
14+
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
15+
"unwantedRecommendations": []
16+
}

.vscode/settings.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"[sentinel]": {
3+
"editor.defaultFormatter": "hashicorp.terraform"
4+
},
5+
"[terraform]": {
6+
"editor.defaultFormatter": "hashicorp.terraform"
7+
},
8+
"[tfvars]": {
9+
"editor.defaultFormatter": "hashicorp.terraform"
10+
},
11+
"editor.bracketPairColorization.enabled": true,
12+
"editor.formatOnSave": true,
13+
"editor.rulers": [
14+
{
15+
"color": "#A5FF90",
16+
"column": 80
17+
},
18+
{
19+
"color": "#FF628C",
20+
"column": 100
21+
}
22+
],
23+
"editor.tabCompletion": "on",
24+
"editor.tabSize": 2,
25+
"files.associations": {
26+
"*.hcl": "terraform",
27+
"*.nomad": "terraform",
28+
"*.policy": "sentinel"
29+
},
30+
"terraform.indexing": {
31+
"delay": 500,
32+
"enabled": false,
33+
"exclude": [".terraform/**/*", "**/.terraform/**/*"],
34+
"liveIndexing": false
35+
},
36+
"terraform.languageServer.enable": true
37+
}

README.md

Lines changed: 67 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,68 @@ Here are a couple of tools I use to help with managing Terraform versions.
9090
constraints in your terraform code for core, providers and modules.
9191
- `brew install tfupdate`
9292

93+
### Code Editor
94+
95+
I use [Visual Studio Code](https://code.visualstudio.com/) as my code editor. I
96+
have included my settings and extensions in the .vscode directory, so they
97+
should be automatically installed when you open the project. They are also
98+
listed below.
99+
100+
#### Extensions
101+
102+
I use the following extensions for VS Code.
103+
104+
- [HashiCorp HCL](https://marketplace.visualstudio.com/items?itemName=HashiCorp.HCL)
105+
- [HashiCorp Sentinel](https://marketplace.visualstudio.com/items?itemName=HashiCorp.sentinel)
106+
- [HashiCorp Terraform](https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform)
107+
- [indent-rainbow](https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow)
108+
- [Indented Block Highlighting](https://marketplace.visualstudio.com/items?itemName=byi8220.indented-block-highlighting)
109+
- [Multiple cursor case preserve](https://marketplace.visualstudio.com/items?itemName=Cardinal90.multi-cursor-case-preserve)
110+
111+
#### Settings
112+
113+
I use the following settings for VS Code.
114+
115+
```json
116+
{
117+
"[sentinel]": {
118+
"editor.defaultFormatter": "hashicorp.terraform"
119+
},
120+
"[terraform]": {
121+
"editor.defaultFormatter": "hashicorp.terraform"
122+
},
123+
"[tfvars]": {
124+
"editor.defaultFormatter": "hashicorp.terraform"
125+
},
126+
"editor.bracketPairColorization.enabled": true,
127+
"editor.formatOnSave": true,
128+
"editor.rulers": [
129+
{
130+
"color": "#A5FF90",
131+
"column": 80
132+
},
133+
{
134+
"color": "#FF628C",
135+
"column": 100
136+
}
137+
],
138+
"editor.tabCompletion": "on",
139+
"editor.tabSize": 2,
140+
"files.associations": {
141+
"*.hcl": "terraform",
142+
"*.nomad": "terraform",
143+
"*.policy": "sentinel"
144+
},
145+
"terraform.indexing": {
146+
"delay": 500,
147+
"enabled": false,
148+
"exclude": [".terraform/**/*", "**/.terraform/**/*"],
149+
"liveIndexing": false
150+
},
151+
"terraform.languageServer.enable": true
152+
}
153+
```
154+
93155
## Example config files
94156

95157
I've included example config files for some of the tools.
@@ -116,14 +178,13 @@ The following two lines specify where the `terraform-docs` dynamic content will
116178
be placed.
117179

118180
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
119-
120181
## Requirements
121182

122-
| Name | Version |
123-
| --------- | ------- |
124-
| terraform | ~> 1.0 |
125-
| google | ~>4.55 |
126-
| hcp | ~>0.54 |
183+
| Name | Version |
184+
|------|---------|
185+
| terraform | ~> 1.0 |
186+
| google | ~>4.55 |
187+
| hcp | ~>0.54 |
127188

128189
## Providers
129190

@@ -144,5 +205,4 @@ No inputs.
144205
## Outputs
145206

146207
No outputs.
147-
148208
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

0 commit comments

Comments
 (0)