-
Notifications
You must be signed in to change notification settings - Fork 455
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
Check formatting #5760
Check formatting #5760
Conversation
799f01b
to
ad22c1f
Compare
scripts/rescript_format.js
Outdated
hasError = true; | ||
var incorrectlyFormattedFiles = 0; | ||
try { | ||
const _promises = await Promise.all( |
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 noticed - and this applies to the old as well as the new implementation - that bsc -format
is run in parallel for all files.
Not sure how far this will scale. Maybe this should be changed to processing in batches, but that's probably out of the scope of this PR?
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'd say it's indeed out of scope of this PR, especially if we don't have any report of issues caused by this.
scripts/rescript_format.js
Outdated
if (!write) { | ||
process.stdout.write(stdout); | ||
try { | ||
const formatted = child_process.execFileSync(bsc_exe, flags); |
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.
As discussed on Discord, please add a comment explaining why processing is sync here, but async above.
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.
Side comment: do we have a discord community channel? 😲
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.
@mattdamon108 haha no dm
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.
@tsnobip Ah! haha
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.
@mattdamon108 What's your Discord handle?
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.
@cknitt moondaddi#2730
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.
As discussed on Discord, please add a comment explaining why processing is sync here, but async above.
now that I think about it, I don't know if the asynchronous processing we had before actually created any issue? I'll indeed add some comments about my reasoning.
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 rewrote it to use the same logic, there's no reason why the output would be mixed anyway.
Ah, I forgot: @tsnobip could you also add an entry to the changelog? |
8b9d3b9
to
19871aa
Compare
Fixes #4780.
This PR also fixes a few bugs:
rescript format
usage was not being displayed