Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade clang-format to v18 #12483

Merged
merged 3 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ To develop Firebase software, **install**:
To install [clang-format] and [mint] using [Homebrew]:

```console
brew install clang-format@17
brew install clang-format@18
brew install mint
```

Expand Down
7 changes: 4 additions & 3 deletions FirebaseDatabase/Tests/Integration/FData.m
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,10 @@ - (void)testWriteLeafNodeOverwriteAtParentMultipleTimesVerifyExpectedEvents {
ios - sdk / firebase - ios -
sdk / Example / Database / Tests / Helpers /
FEventTester
.m : 123 because it was raised inside test case -[FEventTester(null)] which has no
associated XCTestRun object.This may happen when test cases are
constructed and invoked independently of standard XCTest infrastructure,
.m : 123 because it was raised inside test case -
[FEventTester(
null)] which has no associated XCTestRun object.This may happen when test cases
are constructed and invoked independently of standard XCTest infrastructure,
or when the test has already finished
." - Expected http://localhost:9000/-M8IJYWb68MuqQKKz2IY/a aa (0) to match "
"http://localhost:9000/-M8IJYWb68MuqQKKz2IY/a (null) (4)' from "
Expand Down
4 changes: 1 addition & 3 deletions FirebaseDatabase/Tests/Integration/FIRDatabaseQueryTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -4192,9 +4192,7 @@ - (void)testGetForParentReturnsCorrectValue {

[ref getDataWithCompletionBlock:^(NSError* err, FIRDataSnapshot* snapshot) {
XCTAssertNil(err);
XCTAssertEqualObjects(
[snapshot value],
@{@"a" : @1});
XCTAssertEqualObjects([snapshot value], @{@"a" : @1});
done = YES;
}];
}
Expand Down
4 changes: 1 addition & 3 deletions FirebaseDatabase/Tests/Integration/FOrderByTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,7 @@ - (void)testFiresChildMovedEvents {
moved = YES;
XCTAssertEqualObjects(snapshot.key, @"greg", @"");
XCTAssertEqualObjects(prevName, @"rob", @"");
XCTAssertEqualObjects(
snapshot.value,
@{@"nuggets" : @57}, @"");
XCTAssertEqualObjects(snapshot.value, @{@"nuggets" : @57}, @"");
}];

[ref setValue:initial];
Expand Down
4 changes: 2 additions & 2 deletions Firestore/core/src/immutable/keys_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ auto KeysView(const Range& range) -> KeysRange<decltype(std::begin(range))> {
}

template <typename Range, typename K>
auto KeysViewFrom(const Range& range, const K& key)
-> KeysRange<decltype(range.lower_bound(key))> {
auto KeysViewFrom(const Range& range,
const K& key) -> KeysRange<decltype(range.lower_bound(key))> {
auto keys_begin = util::make_iterator_first(range.lower_bound(key));
auto keys_end = util::make_iterator_first(std::end(range));
return util::make_range(keys_begin, keys_end);
Expand Down
8 changes: 4 additions & 4 deletions Firestore/core/src/util/hashing.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ auto RankedInvokeHash(const Range& range, HashChoice<3>)
* value can itself be hashed.
*/
template <typename K>
auto RankedInvokeHash(const absl::optional<K>& option, HashChoice<4>)
-> decltype(InvokeHash(*option)) {
auto RankedInvokeHash(const absl::optional<K>& option,
HashChoice<4>) -> decltype(InvokeHash(*option)) {
return option ? InvokeHash(*option) : -1171;
}

Expand All @@ -202,8 +202,8 @@ size_t RankedInvokeHash(K value, HashChoice<5>) {
}

template <typename K>
auto RankedInvokeHash(const std::unique_ptr<K>& ptr, HashChoice<6>)
-> decltype(InvokeHash(*ptr)) {
auto RankedInvokeHash(const std::unique_ptr<K>& ptr,
HashChoice<6>) -> decltype(InvokeHash(*ptr)) {
return ptr ? InvokeHash(*ptr) : 23631;
}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ GitHub Actions will verify that any code changes are done in a style-compliant
way. Install `clang-format` and `mint`:

```console
brew install clang-format@17
brew install clang-format@18
brew install mint
```

Expand Down
2 changes: 1 addition & 1 deletion scripts/setup_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fi

# install clang-format
brew update
brew install clang-format@17
brew install clang-format@18

# mint installs tools from Mintfile on demand.
brew install mint
Expand Down
4 changes: 2 additions & 2 deletions scripts/style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ version="${version/ (*)/}"
version="${version/.*/}"

case "$version" in
17)
18)
;;
google3-trunk)
echo "Please use a publicly released clang-format; a recent LLVM release"
Expand All @@ -65,7 +65,7 @@ case "$version" in
exit 1
;;
*)
echo "Please upgrade to clang-format version 17."
echo "Please upgrade to clang-format version 18."
echo "If it's installed via homebrew you can run:"
echo "brew upgrade clang-format"
exit 1
Expand Down
Loading