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

Impose JuliaFormatter code style on the code #2338

Open
uncomfyhalomacro opened this issue Nov 9, 2023 · 5 comments · May be fixed by #2404
Open

Impose JuliaFormatter code style on the code #2338

uncomfyhalomacro opened this issue Nov 9, 2023 · 5 comments · May be fixed by #2404
Labels
Status: Speculative It's unknown if this is something that we wan't to do Type: Maintenance

Comments

@uncomfyhalomacro
Copy link
Contributor

I have a question if the code of Documenter.jl has a JuliaFormatter configuration. I feel like it's needed since I don't want to annoy the maintainers of this project when contributing and also from future contributors. I just noticed this since I set up my Julia LSP to autoformat and caused a huge diff. Would anyone be interested on setting up at least their own JuliaFormatter config here so people will just use the config when formatting if they contribute?

@mortenpi
Copy link
Member

mortenpi commented Nov 9, 2023

Long-term, I'd say yes. @fredrikekre and I also discussed this at some point. But not sure we have the bandwidth to bikeshed a code style overhaul right now. It might be interesting to see what the diff would be with e.g. default JuliaFormatter settings.

We definitely don't want unrelated major formatting changes in a feature or bugfix PR though.

@mortenpi mortenpi added Type: Maintenance Status: Speculative It's unknown if this is something that we wan't to do and removed Type: Question labels Nov 9, 2023
@mortenpi mortenpi changed the title question: formatter config in codebase Impose JuliaFormatter code style on the code Nov 9, 2023
@goerz
Copy link
Member

goerz commented Nov 9, 2023

I have one in https://github.com/JuliaDocs/DocumenterCitations.jl/blob/master/.JuliaFormatter.toml (and DocumenterCitations has a CI step to check the code formatting, and make codestyle for auto-formatting everything locally).

The settings I’m using are pretty permissive, but Documenter might want to make some further tweaks to minimize the diff to the existing code. That’s pretty much the only drawback to adopting an automatic style: we’ll have one pretty big “reformat” commit.

@uncomfyhalomacro
Copy link
Contributor Author

i just accidentally made a huge diff on my recent PR lmao

@uncomfyhalomacro
Copy link
Contributor Author

I will try to restart and only add the changes with the formatting off tomorrow. need to sleep.

@odow
Copy link
Collaborator

odow commented Nov 11, 2023

This is JuMP's format: https://github.com/jump-dev/JuMP.jl/blob/master/.JuliaFormatter.toml

It's great. We don't have arguments anymore.

@mortenpi mortenpi linked a pull request Jan 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Speculative It's unknown if this is something that we wan't to do Type: Maintenance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants