Skip to content

formatter with JuliaFormatter#1987

Closed
mmikhasenko wants to merge 4 commits into
JuliaStats:masterfrom
mmikhasenko:juliaformatter-format
Closed

formatter with JuliaFormatter#1987
mmikhasenko wants to merge 4 commits into
JuliaStats:masterfrom
mmikhasenko:juliaformatter-format

Conversation

@mmikhasenko

@mmikhasenko mmikhasenko commented Jun 23, 2025

Copy link
Copy Markdown

Formatting cleanup using JuliaFormatter.format(".") to ensure consistent code style across the package. This reduces noisy diffs in future changes and improves readability. No functional changes.

Closes #1401

Modifications

  • add .formating with scripts
  • modified README.md. Added formatting rules
  • added .git-blame-ignore-revs to
  • applied formatting

Tests

  • are passing

Once merged:

Update .git-blame-ignore-revs to point to the merge commit

@mmikhasenko mmikhasenko marked this pull request as draft June 23, 2025 14:42
@devmotion

Copy link
Copy Markdown
Member

I'd actually prefer Runic, it seems to work fine in StatsFuns and PDMats and I've been bitten by JuliaFormatter 2 problems a few times. GLM uses JuliaFormatter though, so there is no agreed on standard in JuliaStats yet.

@mmikhasenko

Copy link
Copy Markdown
Author

I'd actually prefer Runic, it seems to work fine in StatsFuns and PDMats and I've been bitten by JuliaFormatter 2 problems a few times. GLM uses JuliaFormatter though, so there is no agreed on standard in JuliaStats yet.

completely fine with me, I do not have preference

@codecov-commenter

codecov-commenter commented Jun 23, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.13384% with 294 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.43%. Comparing base (f1ff9e8) to head (56d05d2).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
src/samplers/obsoleted.jl 0.00% 26 Missing ⚠️
src/univariate/continuous/kolmogorov.jl 39.47% 23 Missing ⚠️
src/univariate/continuous/chernoff.jl 52.77% 17 Missing ⚠️
src/multivariate/mvnormal.jl 72.97% 10 Missing ⚠️
src/univariate/continuous/ksdist.jl 75.00% 10 Missing ⚠️
src/univariate/continuous/triweight.jl 56.52% 10 Missing ⚠️
src/univariates.jl 77.27% 10 Missing ⚠️
src/multivariate/dirichlet.jl 71.87% 9 Missing ⚠️
src/multivariate/mvtdist.jl 65.38% 9 Missing ⚠️
src/mixtures/mixturemodel.jl 78.78% 7 Missing ⚠️
... and 73 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1987      +/-   ##
==========================================
- Coverage   86.44%   86.43%   -0.01%     
==========================================
  Files         147      147              
  Lines        8838     8861      +23     
==========================================
+ Hits         7640     7659      +19     
- Misses       1198     1202       +4     

☔ 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.

@mmikhasenko mmikhasenko changed the title formatter with JuliaFormatter formatter with Runic Jun 23, 2025
@mmikhasenko mmikhasenko marked this pull request as ready for review June 23, 2025 16:35
@mmikhasenko

Copy link
Copy Markdown
Author

The work is complete. Tests are passing.
Could you please review?

@mmikhasenko

Copy link
Copy Markdown
Author

ping @st-- , the author of original issue #1401, for an opinion.

Comment thread .formatting/Project.toml Outdated
Comment thread .git-blame-ignore-revs
Comment thread .github/workflows/CI.yml Outdated
Comment thread .github/workflows/CI.yml Outdated
Comment thread .github/workflows/CI.yml Outdated
Comment on lines +41 to +42
- "min"
- "1"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to change these lines:

Suggested change
- "min"
- "1"
- 'min'
- '1'

Comment thread .github/workflows/CI.yml Outdated
Comment thread README.md Outdated
@devmotion

Copy link
Copy Markdown
Member

Maybe let's merge #1905 before changing the formatting.

@ararslan ararslan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been bitten by JuliaFormatter 2 problems a few times

You can pin to v1, which the JuliaFormatter README recommends if you run into issues with v2. My employer uses JuliaFormatter v2 with YASGuide extensively and have generally only run into issues in very unusual code, in which case you can surround in #!format off/on. MixedModels uses JuliaFormatter with BlueStyle on CI and that works fine.

The formatting implemented by Runic is largely inconsistent with the prevailing, albeit historically ad hoc, formatting in JuliaStats. I also find that some of its choices actively hinder readability vs. YAS or Blue.

I'd be fine with this PR if we use JuliaFormatter as initially proposed with one of the aforementioned styles, but I do not agree with using Runic.

@mmikhasenko mmikhasenko force-pushed the juliaformatter-format branch from 3bede98 to a16029f Compare February 13, 2026 20:56
@mmikhasenko mmikhasenko changed the title formatter with Runic formatter with JuliaFormatter Feb 13, 2026
@mmikhasenko

Copy link
Copy Markdown
Author

Switched back to JuliaFormatting and adopted the MixedModels approach to formatting.
Hope the tests pass, it it can be merged

@devmotion

devmotion commented Feb 13, 2026

Copy link
Copy Markdown
Member

Switched back to JuliaFormatting

I'd still prefer Runic. PDMats, StatsFuns and possibly soon StatsBase use Runic. Outside of StatsBase, it is used quite a lot as well - the whole SciML ecosystem recently switched to Runic, Documenter uses Runic, DifferentiationInterface uses Runic.... Generally, there seems to be a significant movement towards Runic

@mmikhasenko

Copy link
Copy Markdown
Author

I have an idea -- you can create a competing PR, and see which one gets merged first.
I can also do it, if you like.

Would be good to close the story, that it does not hang in my open pull requests

@rsenne

rsenne commented Jul 3, 2026

Copy link
Copy Markdown

significant movement towards Runic

My unsolicited two cents is that some of the movement toward Runic may be because JuliaFormatter v2 is not considered stable yet, which the package maintainers have acknowledged and is part of why they do not recommend using v2 for testing purposes yet.

Runic is great, but pinning JuliaFormatter to v1.0.62 removes the burden of formatter behavior changing between minor releases. This used to be a bigger issue as this caused conflicts with JET but JuliaSyntax v1 is supported on JET. JuliaFormatter also seems to be more steadily maintained now, so I don’t think people necessarily need to give up on it yet. That said, if people simply prefer Runic’s style, that is totally reasonable too.

Edit: I missed the earlier comment making the same point. Sorry about that. Leaving this up since it adds a bit on pinning JuliaFormatter and the JET/JuliaSyntax compatibility issue.

@devmotion

Copy link
Copy Markdown
Member

There's no consensus but also no pressing need for a change, so this PR or a rebased version of it is not expected to be merge in the near future. Therefor I'm closing the PR as it is outdated anyways.

@devmotion devmotion closed this Jul 3, 2026
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.

Add JuliaFormatter to workflow

5 participants