Skip to content

Commit

Permalink
Add perltidy indent level and line length support
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Nov 29, 2023
1 parent 5665172 commit ca24c90
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/),
Expand All @@ -15,6 +19,7 @@ The format is based on [Keep a Changelog].
([#263]).

[#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

## 4.0 (released 2023-11-23)
Expand Down
4 changes: 3 additions & 1 deletion apheleia-formatters.el
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,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")))
Expand Down
2 changes: 2 additions & 0 deletions apheleia-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit ca24c90

Please sign in to comment.