question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Double-Dollar assertion is overly aggressive

See original GitHub issue

The double dollar assertion: https://github.com/GoogleChrome/lighthouse/blob/e87a8b76e66208be0266c6e3a3b648dbebe79521/lighthouse-core/scripts/i18n/collect-strings.js#L344

Is a bit aggressive, it should check for basic $$ but allow $ICU_0$$ICU_1$. This should be validated with regex like \$([^$]*?)\$ and asserting that each capture group isn’t empty instead of a more basic \$\$.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
exterkampcommented, Feb 5, 2020

Sorry. From the Chromium slack:

Oh, hm. I think this is an overly aggressive assertion. We are trying to catch “$$” as an escape sequence for “$”. So something like “$5.00” being escaped as $$5.00 leads to a problem because that “placeholder” is empty and causes issues. But, as I read the internal comment on this check, it specifically calls out adjacent placeholders as valid like $ICU_0$$ICU_1$ . This is actually an error with the naive check in Lighthouse.

So, this test in Lighthouse is checking for $$ naively, when it really needs to be checking for $$ but not $ICU_0$$ICU_1$ which is valid.

1reaction
connorjclarkcommented, Feb 3, 2020

@piotrzarycki go for it. work involved is indeed “good first issue”-level assuming it is just doing what Shane said. it’s just the motivation that is opaque

Read more comments on GitHub >

github_iconTop Results From Across the Web

Assertion over Aggression - LinkedIn
Unnecessary aggressive behavior leads to toxic work environment. Being assertive instead of aggressive is definitely more natural for me too.
Read more >
A Comparison of Non-Assertive, Assertive, and Aggressive ...
Nonassertion is failing to stand up for oneself, or standing up for oneself in such an ineffectual manner that one's rights are easily...
Read more >
Differences in assertion and aggression between normal and ...
Abstract. Compared assertive and aggressive behavior of 12 normal and 12 neurotic family triads using the Interpersonal Behavior Schedule and a semi-automated ...
Read more >
Feline Behavior Problems: Aggression | Cornell University ...
Aggression, defined as hostile or violent behavior intended to dominate or intimidate another individual, is a fairly common behavioral problem in cats.
Read more >
Being assertive: Reduce stress, communicate better
Very aggressive people embarrass, intimidate and scare others and may even be physically threatening. You may think that being aggressive gets you what...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found