diff options
| author | Ville Skyttä <ville.skytta@iki.fi> | 2023-11-29 21:26:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-29 19:26:19 +0000 |
| commit | fe27888c6b3f546054b00e7da0b65f2f2f5d5d20 (patch) | |
| tree | f5c59d0b455465def080b255faf9d57a2fc138c0 | |
| parent | c8d9ad43ba99bb3b8703e6810fca357cf96c05ad (diff) | |
Add `perltidy` indent level and line length support (#261)
| -rw-r--r-- | CHANGELOG.md | 5 | ||||
| -rw-r--r-- | apheleia-formatters.el | 4 | ||||
| -rw-r--r-- | apheleia-utils.el | 2 |
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) |
