Automating formatting for official D repos

Jonathan M Davis newsgroup.d at jmdavisprog.com
Mon Jan 22 23:10:06 UTC 2024


On Monday, January 22, 2024 9:24:48 AM MST Richard (Rikki) Andrew Cattermole 
via Digitalmars-d wrote:
> On 23/01/2024 4:14 AM, Prajwal S N wrote:
> > I came across this suggestion from Rikki in one of the other threads,
> > and just wanna make sure I understand correctly - we'd ideally want a CI
> > job that runs dfmt on the PR, and in case of any reformatting, it pushes
> > a commit with those changes. Or are we just looking for a job that
> > detects if there is something that's not formatted correctly? (I think
> > we already have this? Not sure)
>
> Yes, we would commit the formatted code straight back.
>
> What we have now with the primitive formatting check is it creates
> opportunity for the PR to fail the CI.
>
> With an automatic formatting tool, we can simply fix the code and move
> on with our lives. No nitpicking, no asking how do I fix this error,
> just ready to merge code!

Please, no. Code formatters consistently make code look like garbage. Some
flexbility is needed if we want code to actually look nice.

- Jonathan M Davis





More information about the Digitalmars-d mailing list