Skip to content

Commit 2fec321

Browse files
committed
Wrap bare URLs in doc comments in angle brackets.
1 parent 2e0fa7f commit 2fec321

File tree

6 files changed

+26
-16
lines changed

6 files changed

+26
-16
lines changed

.github/workflows/cargo-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Set up Python
2626
uses: actions/setup-python@v5.3.0
2727
with:
28-
python-version: "3.10"
28+
python-version: "3.11"
2929

3030
- name: Install Python dependencies
3131
run: |

generator/rust.stoneg.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import contextlib
22
from contextlib import contextmanager
3+
import re
34
from typing import Iterator, Optional, Sequence
45

56
from rust import RustHelperBackend, EXTRA_DISPLAY_TYPES, REQUIRED_NAMESPACES
@@ -824,8 +825,13 @@ def _emit_doc(self, doc_string: Optional[str], prefix: str = '///') -> None:
824825
if idx != 0:
825826
self.emit(prefix)
826827
docf = lambda tag, val: self._docf(tag, val)
828+
text = self.process_doc(chunk, docf)
829+
# Find bare URLs and wrap them in `<>`. This intentionlly only matches lowercase
830+
# letters so it doesn't match a problematic API example with a token which is part
831+
# of a curl command in files/get_temporary_upload_link :(
832+
text = re.sub(r"(?<!\()https://(?>[a-z0-9./-]+)(?=\.?(\)|\n|$))", r"<\g<0>>", text)
827833
self.emit_wrapped_text(
828-
self.process_doc(chunk, docf),
834+
text,
829835
prefix=prefix + ' ', width=100)
830836

831837
def _docf(self, tag: str, val: str) -> str:

src/generated/async_routes/files.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -880,10 +880,10 @@ pub fn paper_update<'a>(
880880
Some(crate::client_helpers::Body::from(body)))
881881
}
882882

883-
/// Permanently delete the file or folder at a given path (see https://www.dropbox.com/en/help/40).
884-
/// If the given file or folder is not yet deleted, this route will first delete it. It is possible
885-
/// for this route to successfully delete, then fail to permanently delete. Note: This endpoint is
886-
/// only available for Dropbox Business apps.
883+
/// Permanently delete the file or folder at a given path (see
884+
/// <https://www.dropbox.com/en/help/40>). If the given file or folder is not yet deleted, this
885+
/// route will first delete it. It is possible for this route to successfully delete, then fail to
886+
/// permanently delete. Note: This endpoint is only available for Dropbox Business apps.
887887
pub fn permanently_delete<'a>(
888888
client: &'a impl crate::async_client_trait::UserAuthClient,
889889
arg: &'a DeleteArg,

src/generated/async_routes/team.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,8 @@ pub fn member_space_limits_excluded_users_remove<'a>(
535535

536536
/// Get users custom quota. A maximum of 1000 members can be specified in a single call. Note: to
537537
/// apply a custom space limit, a team admin needs to set a member space limit for the team first.
538-
/// (the team admin can check the settings here: https://www.dropbox.com/team/admin/settings/space).
538+
/// (the team admin can check the settings here:
539+
/// <https://www.dropbox.com/team/admin/settings/space>).
539540
pub fn member_space_limits_get_custom_quota<'a>(
540541
client: &'a impl crate::async_client_trait::TeamAuthClient,
541542
arg: &'a CustomQuotaUsersArg,
@@ -551,7 +552,8 @@ pub fn member_space_limits_get_custom_quota<'a>(
551552

552553
/// Remove users custom quota. A maximum of 1000 members can be specified in a single call. Note: to
553554
/// apply a custom space limit, a team admin needs to set a member space limit for the team first.
554-
/// (the team admin can check the settings here: https://www.dropbox.com/team/admin/settings/space).
555+
/// (the team admin can check the settings here:
556+
/// <https://www.dropbox.com/team/admin/settings/space>).
555557
pub fn member_space_limits_remove_custom_quota<'a>(
556558
client: &'a impl crate::async_client_trait::TeamAuthClient,
557559
arg: &'a CustomQuotaUsersArg,
@@ -568,7 +570,7 @@ pub fn member_space_limits_remove_custom_quota<'a>(
568570
/// Set users custom quota. Custom quota has to be at least 15GB. A maximum of 1000 members can be
569571
/// specified in a single call. Note: to apply a custom space limit, a team admin needs to set a
570572
/// member space limit for the team first. (the team admin can check the settings here:
571-
/// https://www.dropbox.com/team/admin/settings/space).
573+
/// <https://www.dropbox.com/team/admin/settings/space>).
572574
pub fn member_space_limits_set_custom_quota<'a>(
573575
client: &'a impl crate::async_client_trait::TeamAuthClient,
574576
arg: &'a SetCustomQuotaArg,

src/generated/sync_routes/files.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -979,10 +979,10 @@ pub fn paper_update(
979979
)
980980
}
981981

982-
/// Permanently delete the file or folder at a given path (see https://www.dropbox.com/en/help/40).
983-
/// If the given file or folder is not yet deleted, this route will first delete it. It is possible
984-
/// for this route to successfully delete, then fail to permanently delete. Note: This endpoint is
985-
/// only available for Dropbox Business apps.
982+
/// Permanently delete the file or folder at a given path (see
983+
/// <https://www.dropbox.com/en/help/40>). If the given file or folder is not yet deleted, this
984+
/// route will first delete it. It is possible for this route to successfully delete, then fail to
985+
/// permanently delete. Note: This endpoint is only available for Dropbox Business apps.
986986
pub fn permanently_delete(
987987
client: &impl crate::client_trait::UserAuthClient,
988988
arg: &DeleteArg,

src/generated/sync_routes/team.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,8 @@ pub fn member_space_limits_excluded_users_remove(
605605

606606
/// Get users custom quota. A maximum of 1000 members can be specified in a single call. Note: to
607607
/// apply a custom space limit, a team admin needs to set a member space limit for the team first.
608-
/// (the team admin can check the settings here: https://www.dropbox.com/team/admin/settings/space).
608+
/// (the team admin can check the settings here:
609+
/// <https://www.dropbox.com/team/admin/settings/space>).
609610
pub fn member_space_limits_get_custom_quota(
610611
client: &impl crate::client_trait::TeamAuthClient,
611612
arg: &CustomQuotaUsersArg,
@@ -623,7 +624,8 @@ pub fn member_space_limits_get_custom_quota(
623624

624625
/// Remove users custom quota. A maximum of 1000 members can be specified in a single call. Note: to
625626
/// apply a custom space limit, a team admin needs to set a member space limit for the team first.
626-
/// (the team admin can check the settings here: https://www.dropbox.com/team/admin/settings/space).
627+
/// (the team admin can check the settings here:
628+
/// <https://www.dropbox.com/team/admin/settings/space>).
627629
pub fn member_space_limits_remove_custom_quota(
628630
client: &impl crate::client_trait::TeamAuthClient,
629631
arg: &CustomQuotaUsersArg,
@@ -642,7 +644,7 @@ pub fn member_space_limits_remove_custom_quota(
642644
/// Set users custom quota. Custom quota has to be at least 15GB. A maximum of 1000 members can be
643645
/// specified in a single call. Note: to apply a custom space limit, a team admin needs to set a
644646
/// member space limit for the team first. (the team admin can check the settings here:
645-
/// https://www.dropbox.com/team/admin/settings/space).
647+
/// <https://www.dropbox.com/team/admin/settings/space>).
646648
pub fn member_space_limits_set_custom_quota(
647649
client: &impl crate::client_trait::TeamAuthClient,
648650
arg: &SetCustomQuotaArg,

0 commit comments

Comments
 (0)