Граф коммитов

6 Коммитов

Автор SHA1 Сообщение Дата
Nick Gerleman d1e8328f7e Add QualifierAlignment to Clang Format Config (#44098)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44098

This sets `QualiferAlignment` so that code is automatically formatted to west const.

I did a pass at this before, but now that we are on new Clang Format, we can enforce it automatically, and I think a couple more cases not previously changed now are.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D56143678

fbshipit-source-id: 8f12b288476ea6019fd7d7a93a39b4fe2e75af14
2024-04-15 16:03:26 -07:00
Nick Gerleman d2e91599c8 PointerAlignment: Left
Summary:
This changes Clang format config to enforce left pointer alignment instead of right, in accordance with https://www.internalfb.com/intern/wiki/Cpp/CppStyle/

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: sammy-SC

Differential Revision: D48952040

fbshipit-source-id: 108329b2f11d2041a31dee3334c7801d69a3f1ad
2023-09-04 10:55:18 -07:00
Nick Gerleman 6d05aa54bf Remove extra QualifierAlignment
Summary: Accidentally left erroneously

Reviewed By: shwanton

Differential Revision: D48851833

fbshipit-source-id: a7f4436e9283148585f9b2b1596f4afc64c4f4b5
2023-08-30 16:39:12 -07:00
Nick Gerleman 759cfaaee6 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
2023-08-30 16:17:56 -07:00
Valentin Shergin 64d6ea8b0d Moving ObjC specific clang-format rules to the common config
Summary: I found that clang-format config file allows to specify rules on a per-language basis, so I moved Objective-C specific rules to the unified config. Now we have only one clang-format file. Yay!

Reviewed By: JoshuaGross

Differential Revision: D14018902

fbshipit-source-id: 45c1e185b8f2b8151ea202b3d9a68a3886597198
2019-02-11 13:07:09 -08:00
David Aurelio 5319cb29a8 Move `.clang-format` to repo root (#23328)
Summary:
Moves `.clang-format` to repo root to allow for easier discoverability, and integration with auto-format plugins for editors and IDEs.
Pull Request resolved: https://github.com/facebook/react-native/pull/23328

Differential Revision: D13986715

Pulled By: davidaurelio

fbshipit-source-id: fcfda59842da10cd4bc02e4550b74782fbb59e0d
2019-02-07 04:19:49 -08:00