-
Notifications
You must be signed in to change notification settings - Fork 14
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
replace code-review checklist items with lint rules #728
Comments
Ditto for the "IE11" section:
|
That seems like a rule for simulations. There are places in common code (for generating a reproducible fuzzing stream) where this is needed. snapshot-comparison also reaches in and does Many of those rules also don't particularly apply to other code. Do we have to figure out how to add a custom PRNG library to Node.js/testing/wrapper code to avoid There are also common code places where Math.random() is used because that common code can't depend on joist (where So for each of the potential rules, I'd think carefully about which different scopes they would be desired in, e.g. "lint for just sim code", "lint for browser code", "lint for all code", etc. |
I did say "Most (all?)", so I'm fine if we don't include |
Since work done in phetsims/tasks#972 on separating out different sets of lint rules, we can likely decide to just enforce something like "no random" as a lint rule for simulations only. |
Unfortunately we can't just add these to bad-text.js. E.g. "toFixed" would flag both the forbidden and recommended function names. |
In recent code review of Wave Interference, // ImageData.data is Uint8ClampedArray. Use Math.round instead of Util.roundSymmetric
// because performance is critical and all numbers are non-negative.
const offset = 4 * m;
data[ offset ] = Math.round( r );
data[ offset + 1 ] = Math.round( g );
data[ offset + 2 ] = Math.round( b ); Would we require these cases to use |
If we did, I think the best way would be to say |
In dev meeting it was decided that the above can be added to the "bad-text" lint rule. But since that rule applies to all lintable files, we will create a new eslint config that only applies to sims, and copy the bad-text lint rule and call the copy Steps to continue:
|
@jessegreenberg I'll investigate that in #737, for now it is commented out, when I fix it I will make sure that those usages are fixed, so don't worry. |
@pixelzoom mind reviewing? If you don't have time please assign back to me...most other devs are tied up until beginning of Feb @zepumph so if @pixelzoom is not available, it will just have to wait a little bit. |
I just realized that these items have not been removed from the code review checklist. Wasn't that the goal of this issue? Or do we still want to double check on them just in case? |
Remove 'Math Libraries' section, now handled by lint.
I removed the check-list items (the entire "Math Libraries" section) in the above commit. |
Sounds good. Note that until #737 is fixed, we are missing one check. And also note that though this does a pretty good job, it doesn't ensure that random numbers are being generated with |
restore checklist item for toFixed
Reopening. It took me some digging, but I guess you're referring to uses of built-in |
I noted in #737 (comment) that the check-list item for |
Thanks! That all sounds great. |
Remove 'Math Libraries' section, now handled by lint.
restore checklist item for toFixed
Noted while doing the code review for Wave Interference.
Most (all?) of the "Math Libraries" section of the code-review checklist could (should?) be replaced with lint rule(s).
Assigning to @ariel-phet to prioritize and assign.
The text was updated successfully, but these errors were encountered: