Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine indent level from more modes #258

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog].
* Use `perltidy` as default formatter for `cperl-mode` ([#260]).
* The `perltidy` formatter now supports Emacs indentation and line length
settings ([#261]).
* Indent level is now determined for `graphql-mode`, `html-mode`, `ruby-mode`,
`ruby-ts-mode`, `svelte-mode`, and `yaml-mode` ([#258]).

### Formatters
* [`dprint`](https://dprint.dev) for various (depending on
Expand All @@ -31,6 +33,7 @@ The format is based on [Keep a Changelog].
[#209]: https://github.com/radian-software/apheleia/pull/209
[#229]: https://github.com/radian-software/apheleia/pull/229
[#257]: https://github.com/radian-software/apheleia/pull/257
[#258]: https://github.com/radian-software/apheleia/pull/258
[#260]: https://github.com/radian-software/apheleia/pull/260
[#261]: https://github.com/radian-software/apheleia/pull/261
[#263]: https://github.com/radian-software/apheleia/pull/263
Expand Down
8 changes: 7 additions & 1 deletion apheleia-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ always returns nil to defer to the formatter."
(cperl-mode 'cperl-indent-level)
(css-mode 'css-indent-offset)
(css-ts-mode 'css-indent-offset)
(graphql-mode 'graphql-indent-level)
(html-mode 'sgml-basic-offset)
(js-jsx-mode 'js-indent-level)
(js-ts-mode 'js-indent-level)
(js-mode 'js-indent-level)
Expand All @@ -50,11 +52,15 @@ always returns nil to defer to the formatter."
(robot-mode 'robot-mode-basic-offset)
(perl-mode 'perl-indent-level)
(python-mode 'python-indent-offset)
(ruby-mode 'ruby-indent-level)
(ruby-ts-mode 'ruby-indent-level)
(scss-mode 'css-indent-offset)
(svelte-mode 'svelte-basic-offset)
(web-mode 'web-mode-indent-style)
(tsx-ts-mode 'typescript-ts-mode-indent-offset)
(typescript-mode 'typescript-indent-level)
(typescript-ts-mode 'typescript-ts-mode-indent-offset))))
(typescript-ts-mode 'typescript-ts-mode-indent-offset)
(yaml-mode 'yaml-indent-offset))))

(when-let ((indent (and indent-var
(boundp indent-var)
Expand Down