add terraform

This commit is contained in:
Malte Brodersen 2017-10-09 21:39:54 +02:00
parent 96d71f8e01
commit 608846408d
5 changed files with 89 additions and 3 deletions

View File

@ -80,6 +80,7 @@ module.exports = class Beautifiers extends EventEmitter
'marko-beautifier'
'formatR'
'beautysh'
'terraform'
]
###

View File

@ -0,0 +1,24 @@
###
Requires terraform installed
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class Terraformfmt extends Beautifier
name: "terraformfmt"
link: "https://www.terraform.io/docs/commands/fmt.html"
isPreInstalled: false
options: {
Terraform: true
}
beautify: (text, language, options) ->
@run("terraform", [
"fmt"
tempFile = @tempFile("input", text)
])
.then(=>
@readFile(tempFile)
)

View File

@ -77,6 +77,7 @@ module.exports = class Languages
"xml"
"xtemplate"
"yaml"
"terraform"
]
###

View File

@ -0,0 +1,20 @@
module.exports = {
name: "Terraform"
namespace: "terraform"
fallback: ['js']
###
Supported Grammars
###
grammars: [
"Terraform"
]
###
Supported extensions
###
extensions: [
"tf"
]
}

View File

@ -4578,8 +4578,7 @@
"Lua"
],
"extensions": [
"lua",
"ttslua"
"lua"
],
"properties": {
"end_of_line": {
@ -6517,6 +6516,47 @@
"description": "Automatically beautify Rust files on save"
}
}
},
"terraform": {
"title": "Terraform",
"type": "object",
"description": "Options for language Terraform",
"collapsed": true,
"beautifiers": [
"terraformfmt"
],
"grammars": [
"Terraform"
],
"extensions": [
"tf"
],
"properties": {
"disabled": {
"title": "Disable Beautifying Language",
"order": -3,
"type": "boolean",
"default": false,
"description": "Disable Rust Beautification"
},
"default_beautifier": {
"title": "Default Beautifier",
"order": -2,
"type": "string",
"default": "terraformfmt",
"description": "Default Beautifier to be used for Terraform",
"enum": [
"terraformfmt"
]
},
"beautify_on_save": {
"title": "Beautify On Save",
"order": -1,
"type": "boolean",
"default": false,
"description": "Automatically beautify Terraform files on save"
}
}
},
"sass": {
"title": "Sass",
@ -9377,4 +9417,4 @@
}
}
}
}
}