Skip to content

Commit 41fa1ea

Browse files
committed
Merge branch 'main' into rust-wrp-alpha
2 parents 8231201 + 18245ef commit 41fa1ea

File tree

9 files changed

+99
-59
lines changed

9 files changed

+99
-59
lines changed

.github/workflows/rust-ci.yaml

+9-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,20 @@ on:
99

1010
defaults:
1111
run:
12-
shell: bash
1312
working-directory: rustutils/
1413

1514
jobs:
1615
test:
1716
name: Rust tests
18-
runs-on: ubuntu-latest
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: true
20+
matrix:
21+
include:
22+
- os: macos-latest # M-series CPU
23+
- os: macos-13 # x64 CPU
24+
- os: windows-latest
25+
- os: ubuntu-latest
1926
steps:
2027
- uses: taiki-e/install-action@v2
2128
with: { tool: just }

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,8 @@ cache.sqlite
5252
cache.sqlite-journal
5353
out.png
5454
/test/android/app/build
55+
56+
# Rust
57+
**/target/
58+
**/*.rs.bk
59+
**/*.profraw

.pre-commit-config.yaml

+47-32
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,56 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
14
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
36
rev: v5.0.0
47
hooks:
5-
- id: check-yaml
6-
args: [--allow-multiple-documents, --unsafe]
7-
- id: end-of-file-fixer
8-
- id: trailing-whitespace
9-
# FIXME: these autogenerate files contain trailing whitespace. Need to fix generator.
10-
exclude: 'platform/android/MapLibreAndroid/src/main/java/org/maplibre/android/(location/LocationIndicatorLayer|style/layers/PropertyFactory)\.java'
11-
- repo: https://github.com/pre-commit/mirrors-clang-format
12-
rev: v19.1.7
13-
hooks:
14-
- id: clang-format
15-
files: '.*\.(hpp|cpp|h)'
16-
exclude: 'vendor/.*'
17-
- repo: https://github.com/keith/pre-commit-buildifier
18-
rev: 8.0.1
19-
hooks:
20-
- id: buildifier
21-
- repo: https://github.com/Mateusz-Grzelinski/actionlint-py
22-
rev: v1.7.7.23
23-
hooks:
24-
- id: actionlint
25-
additional_dependencies: [shellcheck-py]
26-
- repo: https://github.com/nicklockwood/SwiftFormat
27-
rev: "0.55.5"
28-
hooks:
29-
- id: swiftformat
30-
args: [--swiftversion, "5.8"]
31-
- repo: local
8+
- id: check-added-large-files
9+
- id: check-toml
10+
- id: check-yaml
11+
args: [ --allow-multiple-documents, --unsafe ]
12+
- id: end-of-file-fixer
13+
- id: mixed-line-ending
14+
args: [ --fix=lf ]
15+
# these are generated by Gradle
16+
exclude: 'gradlew\.bat$'
17+
- id: trailing-whitespace
18+
# FIXME: these autogenerate files contain trailing whitespace. Need to fix generator.
19+
exclude: 'platform/android/MapLibreAndroid/src/main/java/org/maplibre/android/(location/LocationIndicatorLayer|style/layers/PropertyFactory)\.java$'
20+
21+
- repo: https://github.com/pre-commit/mirrors-clang-format
22+
rev: v19.1.7
3223
hooks:
33-
- id: rustfmt
24+
- id: clang-format
25+
files: '.*\.(hpp|cpp|h)'
26+
exclude: 'vendor/.*'
27+
28+
- repo: https://github.com/keith/pre-commit-buildifier
29+
rev: 8.0.1
30+
hooks:
31+
- id: buildifier
32+
33+
- repo: https://github.com/Mateusz-Grzelinski/actionlint-py
34+
rev: v1.7.7.23
35+
hooks:
36+
- id: actionlint
37+
additional_dependencies: [ shellcheck-py ]
38+
39+
- repo: https://github.com/nicklockwood/SwiftFormat
40+
rev: "0.55.5"
41+
hooks:
42+
- id: swiftformat
43+
args: [ --swiftversion, "5.8" ]
44+
45+
- repo: local
46+
hooks:
47+
- id: rustfmt
3448
name: rustfmt
35-
entry: bash -c 'cd rustutils && cargo fmt' --
49+
entry: sh -c 'cd rustutils && cargo fmt --all'
3650
language: rust
37-
types: [rust]
51+
types: [ rust ]
52+
3853
ci:
3954
# sometimes fails https://github.com/keith/pre-commit-buildifier/issues/13
40-
skip: [buildifier]
55+
skip: [ buildifier ]
4156
autoupdate_schedule: monthly

docs/mdbook/src/ios/ios-tests.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# iOS Tests
22

3+
## iOS Unit Tests
4+
5+
To run the iOS unit tests via XCTest, run tests for the `ios_test` target in Xcode
6+
or use the following bazel command:
7+
8+
```
9+
bazel test //platform/ios/test:ios_test --test_output=errors --//:renderer=metal
10+
```
11+
312
## Render Tests
413

514
To run the render tests, run the `RenderTest` target from iOS.

include/mbgl/util/tile_server_options.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ class TileServerOptions final {
265265
TileServerOptions& withDefaultStyles(std::vector<mbgl::util::DefaultStyle> styles);
266266

267267
/**
268-
* @brief Sets the default style by name. The style name must exists in
268+
* @brief Sets the default style by name. The style name must exist in
269269
* defaultStyles collection
270270
*
271271
* @param defaultStyle The style name
+11-11
Loading

platform/darwin/src/MLNAttributionInfo.mm

+6-2
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,13 @@ @implementation MLNAttributionInfo
104104
[attributedString removeAttribute:NSStrokeWidthAttributeName range:range];
105105
}
106106

107-
// Omit whitespace-only strings.
107+
// Clean up strings by stripping punctuation and whitespace (often present for the web).
108+
NSMutableCharacterSet *charset = [NSMutableCharacterSet whitespaceAndNewlineCharacterSet];
109+
[charset formUnionWithCharacterSet:[NSCharacterSet punctuationCharacterSet]];
108110
NSAttributedString *title = [[attributedString attributedSubstringFromRange:range]
109-
mgl_attributedStringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
111+
mgl_attributedStringByTrimmingCharactersInSet:charset];
112+
113+
// Omit strings that are empty after cleaning.
110114
if (!title.length) {
111115
return;
112116
}

platform/darwin/test/MLNAttributionInfoTests.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ - (void)tearDown {
2020
- (void)testParsing {
2121
static NSString * const htmlStrings[] = {
2222
@"<a href=\"https://www.mapbox.com/about/maps/\" target=\"_blank\">&copy; Mapbox</a> "
23-
@"<a href=\"http://www.openstreetmap.org/about/\" target=\"_blank\">©️ OpenStreetMap</a> "
23+
@"<a href=\"http://www.openstreetmap.org/about/\" target=\"_blank\">©️ OpenStreetMap</a>, "
2424
@"CC&nbsp;BY-SA "
2525
@"<a class=\"mapbox-improve-map\" href=\"https://apps.mapbox.com/feedback/\" target=\"_blank\">Improve this map</a>",
2626
};
+10-10
Loading

0 commit comments

Comments
 (0)