diff --git a/README.md b/README.md index 601c4b1..c81cb1d 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ Some of the supported beautifiers are developed for Node.js and are automaticall | PHPCBF | :warning: 2 executables | :warning: Only 1 of 2 executables | :whale: With [Docker](https://www.docker.com/):
1. Install [PHPCBF (`phpcbf`)](https://github.com/squizlabs/PHP_CodeSniffer) with `docker pull unibeautify/phpcbf`

:bookmark_tabs: Manually:
1. Install [PHP (`php`)](http://php.net/) by following http://php.net/manual/en/install.php
2. Install [PHPCBF (`phpcbf`)](https://github.com/squizlabs/PHP_CodeSniffer) by following https://github.com/squizlabs/PHP_CodeSniffer#installation
| | Pretty Diff | :white_check_mark: | :ok_hand: Not necessary | :smiley: Nothing! | | Pug Beautify | :white_check_mark: | :ok_hand: Not necessary | :smiley: Nothing! | -| puppet-lint | :warning: Manual installation | :construction: Not an executable | :page_facing_up: Go to http://puppet-lint.com/ and follow the instructions. | +| puppet-lint | :warning: 1 executable | :white_check_mark: :100:% of executables | :whale: With [Docker](https://www.docker.com/):
1. Install [puppet-lint (`puppet-lint`)](http://puppet-lint.com/) with `docker pull unibeautify/puppet-lint`

:bookmark_tabs: Manually:
1. Install [puppet-lint (`puppet-lint`)](http://puppet-lint.com/) by following http://puppet-lint.com/
| | pybeautifier | :warning: Manual installation | :construction: Not an executable | :page_facing_up: Go to https://github.com/guyskk/pybeautifier and follow the instructions. | | Remark | :white_check_mark: | :ok_hand: Not necessary | :smiley: Nothing! | | Rubocop | :warning: Manual installation | :construction: Not an executable | :page_facing_up: Go to https://github.com/bbatsov/rubocop and follow the instructions. | diff --git a/docs/options.md b/docs/options.md index 7f3311d..273168a 100644 --- a/docs/options.md +++ b/docs/options.md @@ -334,6 +334,23 @@ Options for PHPCBF executable. 2. Go into *Packages* and search for "*Atom Beautify*" package. 3. Find the option "*PHPCBF*" and change it to your desired configuration. +##### [puppet-lint](#puppet-lint) + +**Important**: This option is only configurable from within Atom Beautify's setting panel. + +**Type**: `object` + +**Description**: + +Options for puppet-lint executable. + +**How to Configure** + +1. You can open the [Settings View](https://github.com/atom/settings-view) by navigating to +*Edit > Preferences (Linux)*, *Atom > Preferences (OS X)*, or *File > Preferences (Windows)*. +2. Go into *Packages* and search for "*Atom Beautify*" package. +3. Find the option "*puppet-lint*" and change it to your desired configuration. + ##### [Rscript](#rscript) **Important**: This option is only configurable from within Atom Beautify's setting panel. diff --git a/src/beautifiers/puppet-fix.coffee b/src/beautifiers/puppet-fix.coffee index 4ae96ed..4a22325 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").run([ '--fix' tempFile = @tempFile("input", text) ], { diff --git a/src/options.json b/src/options.json index 0eca25e..d82a0c8 100644 --- a/src/options.json +++ b/src/options.json @@ -9368,6 +9368,22 @@ } } }, + "puppet-lint": { + "key": "puppet-lint", + "title": "puppet-lint", + "type": "object", + "collapsed": true, + "description": "Options for puppet-lint executable.", + "properties": { + "path": { + "key": "path", + "title": "Binary/Script Path", + "type": "string", + "default": "", + "description": "Absolute path to the \"puppet-lint\" executable's binary/script." + } + } + }, "sass-convert": { "key": "sass-convert", "title": "SassConvert",