Automating formatting for official D repos

Basile B. b2.temp at gmx.com
Mon Jan 22 16:33:42 UTC 2024


On Monday, 22 January 2024 at 16:24:48 UTC, Richard (Rikki) 
Andrew Cattermole 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!

You really want a bot to commit in the author branch ? Maybe you 
mean that this should be done as part of the merge process ? BTW 
authors have an option to prevent external modifications even if 
the "external agent" has the permissions to modify, e.g in the 
context of an organization.


More information about the Digitalmars-d mailing list