diff --git a/format-all.el b/format-all.el index c85d7e82..fc8f0dbb 100644 --- a/format-all.el +++ b/format-all.el @@ -71,6 +71,7 @@ ;; - Perl (perltidy) ;; - PHP (prettier plugin) ;; - Protocol Buffers (clang-format) +;; - Puppet (puppet-lint) ;; - PureScript (purty, purs-tidy) ;; - Python (black, yapf, isort) ;; - R (styler) @@ -174,6 +175,7 @@ ("Perl" perltidy) ("PHP" prettier) ("Protocol Buffer" clang-format) + ("Puppet" puppet-lint) ("PureScript" purty) ("Python" black) ("R" styler) @@ -1199,6 +1201,12 @@ Consult the existing formatters for examples of BODY." (:features) (:format (format-all--buffer-easy executable "format"))) +(define-format-all-formatter puppet-lint + (:executable "puppet-lint-wrapper") + (:install "gem install --global puppet-lint") + (:languages "Puppet") + (:format (format-all--buffer-easy executable))) + (define-format-all-formatter purty (:executable "purty") (:install "npm install --global purty") diff --git a/puppet-lint-wrapper b/puppet-lint-wrapper new file mode 100644 index 00000000..2c9846eb --- /dev/null +++ b/puppet-lint-wrapper @@ -0,0 +1,7 @@ +#! /bin/sh + +t=$(mktemp) +cat >$t +puppet-lint --fix $t | egrep -v "^(FIXED|WARNING|ERROR):" +cat $t +rm -f $t