From 759cfaaee685e428c635a79b7846d810bd6bd745 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Wed, 30 Aug 2023 16:17:56 -0700 Subject: [PATCH] Consistent QualifierAlignment (#39217) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39217 React Native uses an inconsistent mix of "west const" and "east const". E.g. `const auto &` in 74 files, but `auto const &` in 60. Sometimes they are mixed from one line to the next: {F1079102436} Clang format 14 adds a QualifierAlignment option, but fbsource is still on 12, so we cannot use it in our config until the [world is updated]()https://fb.workplace.com/groups/toolchain.fndn/posts/24006558685624673/?comment_id=24009214565359085&reply_comment_id=24009455088668366. This diff just runs a local version of Clang format locally first to fix QualifierAlignment, then reformats with the fbsource version, to fix any other output differences unrelated to that. This will not continually enforce a style, but will make the world more consistent, and hopefully encourage a consistent style until we can set it. West const seems more popular in `//xplat` so I just picked left alignment somewhat arbitrarily, but we could also maybe take a poll on this. Changelog: [Internal] Reviewed By: rshest Differential Revision: D48761722 fbshipit-source-id: 06ec2ceddc495b7fed63ce752c1f31de05af5873 --- .clang-format | 1 + 1 file changed, 1 insertion(+) diff --git a/.clang-format b/.clang-format index bc20b078f0..e5844b7dae 100644 --- a/.clang-format +++ b/.clang-format @@ -84,6 +84,7 @@ SpacesInSquareBrackets: false Standard: Cpp11 TabWidth: 8 UseTab: Never +QualifierAlignment: Left --- Language: ObjC ColumnLimit: 120