Auto-formatting C code in astropy

1 view
Skip to first unread message

Thomas Robitaille

unread,
Oct 1, 2025, 5:34:55 AMOct 1
to astropy-dev mailing list
Hi everyone,

I just wanted to draw your attention to the following issue:


I am proposing enabling clang-format in pre-commit to auto-format C code in astropy core (except for files vendored from other packages such as in cextern). This will save time for people working on C code to avoid having to try and get e.g. all the indentation right and consistent with the rest of each file. We already do auto-formatting for Python code, so this would just be an extension of that.

If you have any opinions about this, please feel free to chime in!

Thanks,
Tom

Clément Robert

unread,
Oct 2, 2025, 2:37:50 AMOct 2
to astropy-dev
Hi Tom, thanks for proposing this. I think the biggest win from formatting with black (and latter, ruff format) was that we could embrace the defaults and stop discussing formatting (almost) entirely, so, even though clang-format *does* support configuration, I agree with going for defaults all the way.
Clément

Reply all
Reply to author
Forward
0 new messages