Adding D support to Clang format

Johan j at j.nl
Sat Apr 29 21:27:51 UTC 2023


On Saturday, 29 April 2023 at 21:07:28 UTC, max haughton wrote:
> On Saturday, 29 April 2023 at 19:08:14 UTC, Zachary Yedidia 
> wrote:
>> It would also be great to have import sorting.
>
> Why is import sorting useful in practice? Anything more than ~3 
> top level imports for me is a pretty big red flag for me - D 
> has local imports, use them.

I think these kind of discussions should be kept to a minimum: a 
formatter should not force a specific formatting taste on the 
user, and instead provide options such that the user can tailor 
it to taste.
I would also appreciate import sorting (with option to separate 
stdlib imports from user libraries), including sorting symbols of 
specific imports.
Another wish is grouping all UDAs either before/after the 
function.
If I think longer, I'm sure I have other wishes that clash with 
someone else's taste, like you had 
(https://github.com/snazzy-d/sdc/issues/231) ;-)
Hence options options options!

cheers,
   Johan




More information about the Digitalmars-d mailing list