-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
errors,tools: ASCIIbetical instead of alphabetical #15578
Conversation
/cc @maclover7 |
02efe97
to
394d6b7
Compare
if (prev >= curr) { | ||
context.report({ | ||
node: node, | ||
message: message + ` - pref:${prev} < curr:${curr}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: pref -> prev
let tmp = ' '.repeat(j) + opStr + ' '.repeat(l - oLen - j); | ||
const k2 = k - lm.length + 1; | ||
const k3 = k2 + km.length; | ||
const message2 = tmp.substr(0, k2) + km + tmp.substr(k3) + lm; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it easier to just show the index where the two strings differ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not really readable. Especially the variable names are pretty bad. Without checking to closely I am also pretty sure this could probably be simplified a bit so it is better to read afterwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easy? 😤 easy for someone else...
yeah I was bored this morning
But seriously, I think it's a nice and informative feedback, and I don't assume this error should happen too often, so I can take it or leave it..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My point is that I don't care if _ >= O
for example. I find it sufficient to know the index where the issue happens (e.g. 7 for ERR_OUT_OF_RANGE
and ERR_OUTOFMEMORY
) but I understand this is very personal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack.
@refack interesting PR! Overall looks good, only concern is that the new "is there a problem" / message generating logic is a little bit hard to grok -- would it be possible to move these back to separate functions? |
Yeah a little bit overboard. Not sure if I could understand it in a week... |
443192c
to
e9f140d
Compare
Removed obfus code. Now the errors looks like:
and IMHO it's informative enough. Linter CI: https://ci.nodejs.org/job/node-test-linter/12025/ |
I'm not a collaborator, but 👍, much simpler now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the point but I'm not a fan of landing this right now. Perhaps after we get all of the codes migrated, otherwise it just ends up causing additional churn.
Other way around. It's already in and has been breaking the lint CI for over a week. I had to hack the lint machine to use |
@jasnell linter fails when it runs on the other (unpatched) machine |
hmm... ok. I'd just generally prefer that we not shuffle these ids around too much more until we get them all migrated as it makes getting those PRs landed much more difficult. |
e9f140d
to
5f46944
Compare
@nodejs/release you might want to cherry-pick to
|
PR-URL: nodejs/node#15578 Fixes: nodejs/node#15576 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: nodejs#15578 Fixes: nodejs#15576 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
I lied... need it one more time please open a new PR |
Fixes: #15576
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
errors,tools