Skip to content

Commit 0e3baad

Browse files
persidskiygithub-actions[bot]
authored andcommitted
Move more jobs from circle to gha, introduce maps-ios-ci
GitOrigin-RevId: 5a571369632f74b0aa73ca5e3bab100767272766
1 parent f3f22f6 commit 0e3baad

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

scripts/doc-generation/restrict-top-sections.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,22 @@ def main():
3333
with open(root_file_path) as f:
3434
root = json.load(f)
3535

36-
sectionTitles = list(map(lambda section: section["title"], root["topicSections"]))
37-
unexpectedTitles = list(
38-
filter(lambda title: title not in acceptedTopSectionTitles, sectionTitles)
39-
)
40-
41-
if len(unexpectedTitles) > 0:
42-
print(
43-
f"""
44-
Unexpected section titles found: {unexpectedTitles}
45-
This suggests that you've introduced new public symbols in your pull request, yet they don't seem to be reflected in any of the API catalog.
46-
"""
47-
)
36+
errors = []
37+
for section in root["topicSections"]:
38+
if section["title"] not in acceptedTopSectionTitles:
39+
errors.append(f"{section['title']}:")
40+
for identifier in section["identifiers"]:
41+
symbol = identifier.replace("doc://com.mapbox.MapboxMaps/documentation/MapboxMaps/", "")
42+
errors.append(f"- {symbol}")
43+
44+
if len(errors) > 0:
45+
print("❌ Unexpected sections found.")
46+
for error in errors:
47+
print(error)
48+
print("Please make sure these symbols are expected to be publicly available and list them in one of the Markdown files in Sources/MapboxMaps/Documentation.docc/API Catalogs")
4849
exit(1)
4950
else:
50-
print("Check passed.")
51+
print("Check passed.")
5152

5253

5354
main()

0 commit comments

Comments
 (0)