From 05669035fc9d80e13524d540baeb8315a7b94c05 Mon Sep 17 00:00:00 2001 From: Colin Hebert Date: Mon, 8 Jan 2018 12:06:06 +0100 Subject: [PATCH] Use docker image to run puppet-lint Use unibeautify/puppet-lint that provides puppet-lint in docker. --- src/beautifiers/puppet-fix.coffee | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/beautifiers/puppet-fix.coffee b/src/beautifiers/puppet-fix.coffee index 4ae96ed..cd01021 100644 --- a/src/beautifiers/puppet-fix.coffee +++ b/src/beautifiers/puppet-fix.coffee @@ -8,21 +8,28 @@ module.exports = class PuppetFix extends Beautifier # this is what displays as your Default Beautifier in Language Config name: "puppet-lint" link: "http://puppet-lint.com/" - isPreInstalled: false options: { Puppet: true } - cli: (options) -> - if not options.puppet_path? - return new Error("'puppet-lint' path is not set!" + - " Please set this in the Atom Beautify package settings.") - else - return options.puppet_path + executables: [ + { + name: "puppet-lint" + cmd: "puppet-lint" + homepage: "http://puppet-lint.com/" + installation: "http://puppet-lint.com/" + version: { + parse: (text) -> text.match(/puppet-lint (\d+\.\d+\.\d+)/)[1] + } + docker: { + image: "unibeautify/puppet-lint" + } + } + ] beautify: (text, language, options) -> - @run("puppet-lint", [ + @exe("puppet-lint", [ '--fix' tempFile = @tempFile("input", text) ], {