This is an archive of the discontinued LLVM Phabricator instance.

Fix ambiguous variable names
ClosedPublic

Authored by thopre on Jan 15 2021, 9:22 AM.

Details

Summary

Fix Flake8's E741 errors (ambiguous variable name). This prevents
confusion when reading code with a font that does not distinguish
clearly between l, 1 and I.

Event Timeline

thopre created this revision.Jan 15 2021, 9:22 AM
thopre requested review of this revision.Jan 15 2021, 9:22 AM
tnfchris accepted this revision.Jan 15 2021, 9:27 AM
tnfchris added inline comments.
lnt/server/reporting/report.py
11–12

lol, think it would have been about as much effort to fix :)

This revision is now accepted and ready to land.Jan 15 2021, 9:27 AM
thopre added inline comments.Jan 15 2021, 9:31 AM
lnt/server/reporting/report.py
11–12

That's what I went for initially but change it for what? list is a keyword and creates more confusion since it's gonna be color-coded in any sensible IDE. And since the function is for any kind of list I'm not sure what else to use. I thought about "elems" but l is quite common for list comprehension AFAIK.

I welcome suggestion, I'd prefer avoiding noqa hints.

tnfchris added inline comments.Jan 15 2021, 9:33 AM
lnt/server/reporting/report.py
11–12

how about src? I mentioned because like on Phab, the highlight is quite subtle.

thopre updated this revision to Diff 317021.Jan 15 2021, 10:33 AM

Rename variable in pairs() to avoid noqa hint

thopre closed this revision.Jan 15 2021, 11:16 AM