Skip to content

Commit 5797426

Browse files
authored
Upgrade clang-format to v18 (#12483)
1 parent 89526bf commit 5797426

File tree

9 files changed

+17
-20
lines changed

9 files changed

+17
-20
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ To develop Firebase software, **install**:
132132
To install [clang-format] and [mint] using [Homebrew]:
133133

134134
```console
135-
brew install clang-format@17
135+
brew install clang-format@18
136136
brew install mint
137137
```
138138

FirebaseDatabase/Tests/Integration/FData.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,10 @@ - (void)testWriteLeafNodeOverwriteAtParentMultipleTimesVerifyExpectedEvents {
314314
ios - sdk / firebase - ios -
315315
sdk / Example / Database / Tests / Helpers /
316316
FEventTester
317-
.m : 123 because it was raised inside test case -[FEventTester(null)] which has no
318-
associated XCTestRun object.This may happen when test cases are
319-
constructed and invoked independently of standard XCTest infrastructure,
317+
.m : 123 because it was raised inside test case -
318+
[FEventTester(
319+
null)] which has no associated XCTestRun object.This may happen when test cases
320+
are constructed and invoked independently of standard XCTest infrastructure,
320321
or when the test has already finished
321322
." - Expected http://localhost:9000/-M8IJYWb68MuqQKKz2IY/a aa (0) to match "
322323
"http://localhost:9000/-M8IJYWb68MuqQKKz2IY/a (null) (4)' from "

FirebaseDatabase/Tests/Integration/FIRDatabaseQueryTests.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4192,9 +4192,7 @@ - (void)testGetForParentReturnsCorrectValue {
41924192

41934193
[ref getDataWithCompletionBlock:^(NSError* err, FIRDataSnapshot* snapshot) {
41944194
XCTAssertNil(err);
4195-
XCTAssertEqualObjects(
4196-
[snapshot value],
4197-
@{@"a" : @1});
4195+
XCTAssertEqualObjects([snapshot value], @{@"a" : @1});
41984196
done = YES;
41994197
}];
42004198
}

FirebaseDatabase/Tests/Integration/FOrderByTests.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,7 @@ - (void)testFiresChildMovedEvents {
235235
moved = YES;
236236
XCTAssertEqualObjects(snapshot.key, @"greg", @"");
237237
XCTAssertEqualObjects(prevName, @"rob", @"");
238-
XCTAssertEqualObjects(
239-
snapshot.value,
240-
@{@"nuggets" : @57}, @"");
238+
XCTAssertEqualObjects(snapshot.value, @{@"nuggets" : @57}, @"");
241239
}];
242240

243241
[ref setValue:initial];

Firestore/core/src/immutable/keys_view.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ auto KeysView(const Range& range) -> KeysRange<decltype(std::begin(range))> {
4747
}
4848

4949
template <typename Range, typename K>
50-
auto KeysViewFrom(const Range& range, const K& key)
51-
-> KeysRange<decltype(range.lower_bound(key))> {
50+
auto KeysViewFrom(const Range& range,
51+
const K& key) -> KeysRange<decltype(range.lower_bound(key))> {
5252
auto keys_begin = util::make_iterator_first(range.lower_bound(key));
5353
auto keys_end = util::make_iterator_first(std::end(range));
5454
return util::make_range(keys_begin, keys_end);

Firestore/core/src/util/hashing.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ auto RankedInvokeHash(const Range& range, HashChoice<3>)
190190
* value can itself be hashed.
191191
*/
192192
template <typename K>
193-
auto RankedInvokeHash(const absl::optional<K>& option, HashChoice<4>)
194-
-> decltype(InvokeHash(*option)) {
193+
auto RankedInvokeHash(const absl::optional<K>& option,
194+
HashChoice<4>) -> decltype(InvokeHash(*option)) {
195195
return option ? InvokeHash(*option) : -1171;
196196
}
197197

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

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ GitHub Actions will verify that any code changes are done in a style-compliant
153153
way. Install `clang-format` and `mint`:
154154

155155
```console
156-
brew install clang-format@17
156+
brew install clang-format@18
157157
brew install mint
158158
```
159159

scripts/setup_check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fi
3535

3636
# install clang-format
3737
brew update
38-
brew install clang-format@17
38+
brew install clang-format@18
3939

4040
# mint installs tools from Mintfile on demand.
4141
brew install mint

scripts/style.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ version="${version/ (*)/}"
5656
version="${version/.*/}"
5757

5858
case "$version" in
59-
17)
59+
18)
6060
;;
6161
google3-trunk)
6262
echo "Please use a publicly released clang-format; a recent LLVM release"
@@ -65,7 +65,7 @@ case "$version" in
6565
exit 1
6666
;;
6767
*)
68-
echo "Please upgrade to clang-format version 17."
68+
echo "Please upgrade to clang-format version 18."
6969
echo "If it's installed via homebrew you can run:"
7070
echo "brew upgrade clang-format"
7171
exit 1

0 commit comments

Comments
 (0)