aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md5
-rw-r--r--apheleia-formatters.el4
-rw-r--r--apheleia-utils.el2
3 files changed, 10 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bdf604f..29c6e36 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog].
## Unreleased
+### Enhancements
+* The `perltidy` formatter now supports Emacs indentation and line length
+ settings ([#261]).
+
### Formatters
* [`js-beautify`](https://github.com/beautify-web/js-beautify) for
[JavaScript](https://www.javascript.com/),
@@ -17,6 +21,7 @@ The format is based on [Keep a Changelog].
js, jsx, ts, tsx, json, jsonc, md files. ([#264])
[#229]: https://github.com/radian-software/apheleia/pull/229
+[#261]: https://github.com/radian-software/apheleia/pull/261
[#263]: https://github.com/radian-software/apheleia/pull/263
[#264]: https://github.com/radian-software/apheleia/pull/264
diff --git a/apheleia-formatters.el b/apheleia-formatters.el
index 49ffd7d..884a07b 100644
--- a/apheleia-formatters.el
+++ b/apheleia-formatters.el
@@ -91,7 +91,9 @@
(ocamlformat . ("ocamlformat" "-" "--name" filepath
"--enable-outside-detected-project"))
(ormolu . ("ormolu"))
- (perltidy . ("perltidy" "--quiet" "--standard-error-output"))
+ (perltidy . ("perltidy" "--quiet" "--standard-error-output"
+ (apheleia-formatters-indent "-t" "-i")
+ (apheleia-formatters-fill-column "-l")))
(pgformatter . ("pg_format"
(apheleia-formatters-indent "--tabs" "--spaces" 'tab-width)
(apheleia-formatters-fill-column "--wrap-limit")))
diff --git a/apheleia-utils.el b/apheleia-utils.el
index 2f9c92e..5e8b364 100644
--- a/apheleia-utils.el
+++ b/apheleia-utils.el
@@ -35,6 +35,7 @@ always returns nil to defer to the formatter."
(unless indent-var
(setq indent-var
(cl-case major-mode
+ (cperl-mode 'cperl-indent-level)
(css-mode 'css-indent-offset)
(css-ts-mode 'css-indent-offset)
(js-jsx-mode 'js-indent-level)
@@ -47,6 +48,7 @@ always returns nil to defer to the formatter."
(json-ts-mode 'json-ts-mode-indent-offset)
(nxml-mode 'nxml-child-indent)
(robot-mode 'robot-mode-basic-offset)
+ (perl-mode 'perl-indent-level)
(scss-mode 'css-indent-offset)
(web-mode 'web-mode-indent-style)
(tsx-ts-mode 'typescript-ts-mode-indent-offset)