I'll put this in needs_review once CI passes.
Thanks! I skimmed it. It mostly looks good, but I didn't do extensive verification. I commented on the pull request about a few places where a now-undefined macro remained referenced.
I think options_validate_dirauth_mode(), set_server_advertised(), options_validate_server_transport() and options_validate_relay_mode() all introduce similar dependencies to authdir_mode_v3(). (Mostly on or_options_t.)
But they only add those dependencies in disable relay/dirauth mode, so you might not have seen any compilation issues after header re-ordering?
I'd like to see a test branch with these changes, and the header re-ordering, so that we can check all our standard builds in CI.
I tried building with modules disabled, and didn't hit the errors you expect. I've made a test branch demo_clang_format_20191218 to try it out on CI, as you suggest above.
At first glance at the CI, it appears that the compilation is succeeding, but check-spaces is failing (as expected). There are also some coccinelle warnings, which are not what I had expected.
But from a "does it compile" POV I think maybe we can call the pre_formatter_cleanups branch tested, perhaps.