Skip to content

Commit 6763638

Browse files
committed
Disallow smart quotes in activities.yml
1 parent 5066bda commit 6763638

File tree

2 files changed

+30
-7
lines changed

2 files changed

+30
-7
lines changed

activities.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,36 @@ def validate_literal_block(self, data: CommentedMap, key: str, field: str):
4242
if not isinstance(value, LiteralScalarString):
4343
if self.fix:
4444
data[key][field] = LiteralScalarString(value)
45+
value = data[key][field]
4546
else:
4647
self.log_error(f"'{field}' must use literal block syntax (|).", key)
47-
elif not value.endswith('\n'):
48+
return
49+
if not value.endswith('\n'):
4850
if self.fix:
4951
data[key][field] = LiteralScalarString(f"{value}\n")
52+
value = data[key][field]
5053
else:
5154
self.log_error(f"'{field}' must end with a newline to use '|' syntax.", key)
55+
return
56+
57+
smart_to_straight = {
58+
'”': '"',
59+
'“': '"',
60+
'’': "'",
61+
'‘': "'",
62+
}
63+
s = str(value)
64+
replaced = s
65+
for k, v in smart_to_straight.items():
66+
replaced = replaced.replace(k, v)
67+
if replaced != s:
68+
if self.fix:
69+
data[key][field] = LiteralScalarString(replaced)
70+
else:
71+
self.log_error(
72+
f"'{field}' contains smart quotes; replace them with straight quotes (\" or ').",
73+
key
74+
)
5275

5376
def validate_item(self, data: CommentedMap, key: str):
5477
item = data[key]

activities.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ Constructable Stylesheet Objects:
461461
Contact Picker API:
462462
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1756767
463463
description: |
464-
This proposal adds an API for prompting and querying the users contacts for one or more items with a handful of contact properties.
464+
This proposal adds an API for prompting and querying the user's contacts for one or more items with a handful of contact properties.
465465
id: contact-picker
466466
issue: 153
467467
position: defer
@@ -522,7 +522,7 @@ Credential Management Level 1:
522522
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1156047
523523
caniuse: https://caniuse.com/credential-management
524524
description: |
525-
This specification describes an imperative API enabling a website to request a users credentials from a user agent, and to help the user agent correctly store user credentials for future use.
525+
This specification describes an imperative API enabling a website to request a user's credentials from a user agent, and to help the user agent correctly store user credentials for future use.
526526
id: credman
527527
issue: 172
528528
position: defer
@@ -654,7 +654,7 @@ Federated Credential Management API:
654654
issue: 618
655655
position: neutral
656656
rationale: |
657-
Federated login is a widely-used feature on the web with significant user benefits in usability and security. Unfortunately, federated identity on the web relies on the same techniques that are used to track web users. Federated Credential Management API provides an opportunity to put the browser in control of managing cross-site logins. However, FedCM currently gives too much power to the identity providers it works for and fails to facilitate other identity providers’ flows. The current FedCM API is designed with a lot of consideration for click-through rate optimization, which is a chief concern of social-login providers. One key design choice that has constrained subsequent decisions is that the initial UI rendered in the browser must be able to show the accounts available from the identity provider, facilitating single click account-linking. Mozilla would not render account information across information contexts before the user makes the choice to link those contexts. However, Google currently does, providing a browser-controlled UI that looks very similar to Google Identity Services’ OneTap widget where third-party cookies are already shared. This is evidence of a bug in the specification, not a feature of “engine freedom” to develop innovative UI. We believe the reduced scope of the Lightweight FedCM proposal is much closer to appropriately balancing the interests of developers and users and is much more likely to reach a solution all browsers would implement.
657+
Federated login is a widely-used feature on the web with significant user benefits in usability and security. Unfortunately, federated identity on the web relies on the same techniques that are used to track web users. Federated Credential Management API provides an opportunity to put the browser in control of managing cross-site logins. However, FedCM currently gives too much power to the identity providers it works for and fails to facilitate other identity providers' flows. The current FedCM API is designed with a lot of consideration for click-through rate optimization, which is a chief concern of social-login providers. One key design choice that has constrained subsequent decisions is that the initial UI rendered in the browser must be able to show the accounts available from the identity provider, facilitating single click account-linking. Mozilla would not render account information across information contexts before the user makes the choice to link those contexts. However, Google currently does, providing a browser-controlled UI that looks very similar to Google Identity Services' OneTap widget where third-party cookies are already shared. This is evidence of a bug in the specification, not a feature of "engine freedom" to develop innovative UI. We believe the reduced scope of the Lightweight FedCM proposal is much closer to appropriately balancing the interests of developers and users and is much more likely to reach a solution all browsers would implement.
658658
url: https://w3c-fedid.github.io/FedCM/
659659
venues:
660660
- W3C
@@ -959,7 +959,7 @@ Keyboard Map:
959959
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1469017
960960
caniuse: https://caniuse.com/mdn-api_keyboardlayoutmap
961961
description: |
962-
This specification defines an API that allows websites to convert from a given code value to a valid key value that can be shown to the user to identify the given key. The conversion from code to key is based on the users currently selected keyboard layout. It is intended to be used by web applications that want to treat the keyboard as a set of buttons and need to describe those buttons to the user.
962+
This specification defines an API that allows websites to convert from a given code value to a valid key value that can be shown to the user to identify the given key. The conversion from code to key is based on the user's currently selected keyboard layout. It is intended to be used by web applications that want to treat the keyboard as a set of buttons and need to describe those buttons to the user.
963963
id: keyboard-map
964964
issue: 300
965965
position: negative
@@ -1325,7 +1325,7 @@ Private Click Measurement:
13251325
Private Network Access:
13261326
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1481298
13271327
description: |
1328-
This document specifies modifications to Fetch which are intended to mitigate the risks associated with unintentional exposure of devices and servers on a clients internal network to the web at large.
1328+
This document specifies modifications to Fetch which are intended to mitigate the risks associated with unintentional exposure of devices and servers on a client's internal network to the web at large.
13291329
id: cors-and-rfc1918
13301330
issue: 143
13311331
position: positive
@@ -1974,7 +1974,7 @@ WebDriver BiDi:
19741974
issue: 632
19751975
position: positive
19761976
rationale: |
1977-
Automation is an important capability for the web platform - for example, reliable automated testing makes it easier for websites to offer a functional user experience. The current standard protocol for building these tools has fallen behind demonstrated needs, which has in part led to new tools being built on Chrome DevTools Protocol. This makes it harder to automate across multiple browsers and versions of browsers - itd be better for the standard protocol to support these needs.
1977+
Automation is an important capability for the web platform - for example, reliable automated testing makes it easier for websites to offer a functional user experience. The current standard protocol for building these tools has fallen behind demonstrated needs, which has in part led to new tools being built on Chrome DevTools Protocol. This makes it harder to automate across multiple browsers and versions of browsers - it'd be better for the standard protocol to support these needs.
19781978
url: https://w3c.github.io/webdriver-bidi/
19791979
venues:
19801980
- W3C

0 commit comments

Comments
 (0)