Skip to content

formatting: add support for JuliaFormatter#284

Merged
aviatesk merged 1 commit intomasterfrom
avi/jlfmt
Oct 26, 2025
Merged

formatting: add support for JuliaFormatter#284
aviatesk merged 1 commit intomasterfrom
avi/jlfmt

Conversation

@aviatesk
Copy link
Copy Markdown
Owner

@aviatesk aviatesk commented Oct 23, 2025

This commit extends the formatting system to support multiple formatter backends beyond Runic.jl. Users can now choose between preset formatters ("runic" or "jlfmt") or configure custom formatters with their own executables.

The formatter configuration has been redesigned from a nested structure (formatter.runic.executable) to a simpler top-level formatter setting that accepts either:

  • A preset name string: "runic" or "jlfmt"
  • A custom formatter defined under formatter.custom with executable and optional executable_range fields

Due to limitations in Configurations.jl, custom formatters must be specified in the [formatter.custom] section rather than directly as the formatter value. Custom formatters can specify separate executables for document and range formatting operations.

Additionally, FormattingOptions from LSP requests are now propagated through the formatting pipeline, enabling formatters to respect client-provided settings like tab size. For JuliaFormatter, the tab size option is passed via the --indent flag. This client-wise setting will be overwritten by .JuliaFormatter.toml configuration if it's found since we are using the --prioritize-config-file option.

Requires domluna/JuliaFormatter.jl#947 to be merged.

@aviatesk aviatesk requested a review from abap34 October 23, 2025 13:42
@aviatesk aviatesk force-pushed the avi/jlfmt branch 2 times, most recently from 5fac5d0 to eed69d9 Compare October 23, 2025 13:54
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 23, 2025

Codecov Report

❌ Patch coverage is 0% with 82 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.73%. Comparing base (ff5d927) to head (5a2caa4).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/formatting.jl 0.00% 73 Missing ⚠️
src/types.jl 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #284      +/-   ##
==========================================
- Coverage   69.47%   68.73%   -0.74%     
==========================================
  Files          39       39              
  Lines        3685     3723      +38     
==========================================
- Hits         2560     2559       -1     
- Misses       1125     1164      +39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@abap34 abap34 force-pushed the abap34/config-schema branch from 2fc4281 to 3667cb2 Compare October 23, 2025 15:19
Base automatically changed from abap34/config-schema to master October 23, 2025 16:06
Comment thread src/formatting.jl Outdated
Comment thread src/types.jl Outdated
@aviatesk aviatesk force-pushed the avi/jlfmt branch 2 times, most recently from 0029580 to 9292668 Compare October 24, 2025 10:59
@aviatesk aviatesk changed the base branch from master to avi/workspace/configuration October 24, 2025 10:59
@aviatesk aviatesk force-pushed the avi/workspace/configuration branch from 4804031 to fe2a63d Compare October 24, 2025 12:53
@aviatesk aviatesk force-pushed the avi/workspace/configuration branch from fe2a63d to bff164c Compare October 24, 2025 13:44
@aviatesk aviatesk force-pushed the avi/jlfmt branch 2 times, most recently from 5404191 to 66ea7ea Compare October 24, 2025 13:56
Base automatically changed from avi/workspace/configuration to master October 26, 2025 02:50
@aviatesk aviatesk force-pushed the avi/jlfmt branch 2 times, most recently from 773a855 to 96ba7b1 Compare October 26, 2025 03:29
This commit extends the formatting system to support multiple formatter
backends beyond Runic.jl. Users can now choose between preset formatters
("Runic" or "JuliaFormatter") or configure custom formatters with their
own executables.

The formatter configuration has been redesigned from a nested structure
(`formatter.runic.executable`) to a simpler top-level `formatter`
setting that accepts either:
- A preset name string: "Runic" or "JuliaFormatter"
- A custom formatter defined under `formatter.custom` with `executable`
  and optional `executable_range` fields

The preset names use proper package names for clarity, while executables
remain as `runic`/`jlfmt` to match the actual binary names.

Due to limitations in Configurations.jl, custom formatters must be
specified in the `[formatter.custom]` section rather than directly as
the `formatter` value. Custom formatters can specify separate
executables for document and range formatting operations.

Additionally, `FormattingOptions` from LSP requests are now propagated
through the formatting pipeline, enabling formatters to respect
client-provided settings like tab size. For JuliaFormatter, the tab size
option is passed via the `--indent` flag. This client-wise setting will
be overwritten by .JuliaFormatter.toml configuration if it's found since
we are using the `--prioritize-config-file` option.

Requires domluna/JuliaFormatter.jl#947 to be merged.
@aviatesk aviatesk merged commit 98013ac into master Oct 26, 2025
7 of 10 checks passed
@aviatesk aviatesk deleted the avi/jlfmt branch October 26, 2025 06:30
@aviatesk aviatesk mentioned this pull request Nov 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants