Unicode tricks in pull requests: Do review tools warn us?

https://semanticdiff.com/blog/pull-request-unicode-tricks/

86 points · 17 comments · view on lemmy.world

17 Comments

monk@lemmy.unboiled.info · 44 pts · 2y (12 replies)

Homoglyphs? Invisible text? Bidirectional text? Just highlight every line that goes beyond ASCII with yellow warning colors and require to vet it. Maybe make localization data an exception.

cbarrick@lemmy.world · 12 pts · 2y (5 replies)

This doesn't work for code bases written in non-English languages. Especially east asian languages.

Any line containing an identifier that is also a word would be highlighted.

More and more programming languages are supporting unicode identifiers for this use case.

mrkite@programming.dev · 11 pts · 2y (2 replies)

So it won't work for 0.0001% of all github projects.

sndrtj@feddit.nl · 6 pts · 2y

I'd suggest to have the occasional look at the "most popular repos" ranking. It's about 50% Chinese.

Super-interesting sometimes as it shows completely different tech trends.

cbarrick@lemmy.world · 1 pts · 2y

I know right.

It's wild that an American company primarily doing business in the West would have a bias towards English.

monk@lemmy.unboiled.info · 6 pts · 2y

Yeah, just don't. Allowing to code in anything other than English is a disservice, plain and simple.

Inb4, I'm not being US-centric, Latin ain't even my native alphabet.

MonkderZweite@feddit.ch · 1 pts · 2y
[ removed ]
actual_patience@programming.dev · 6 pts · 2y (2 replies)

Very simple solution actually. Here I was thinking we'd need AI to solve it.

DudeDudenson@lemmings.world · 16 pts · 2y

People would call that solution AI these days. If it has at least one if statement then they call it AI

slacktoid@lemmy.ml · 3 pts · 2y

We say we have AI to get VC funding

arthur@lemmy.zip · 1 pts · 2y (2 replies)

Or the non-ascii character itself.

monk@lemmy.unboiled.info · 3 pts · 2y (1 reply)

Doesn't work if it's invisible.

xilophor@programming.dev · 1 pts · 2y

what about a box around it?

snowe@programming.dev · 15 pts · 2y (4 replies)

Website really struggled on mobile. Anytime I swipe to view the longer code lines in the code blocks it would open the sidebar. Very annoying.

superbirra@lemmy.world · 3 pts · 2y

yeah I also hated it

MonkderZweite@feddit.ch · 1 pts · 2y
[ removed ]
ReluctantMuskrat@lemmy.world · 1 pts · 2y (1 reply)

Had no trouble here on mobile.

superbirra@lemmy.world · 0 pts · 2y

thank you for letting us know? :)

ck_@discuss.tchncs.de · 10 pts · 2y
[ removed ]
hh93@lemm.ee · 3 pts · 2y

Very interesting read