-
Notifications
You must be signed in to change notification settings - Fork 293
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
code base clean up #583
code base clean up #583
Conversation
Pull Request Test Coverage Report for Build 772
💛 - Coveralls |
unbelievable, the eol is tricky, took me quite a few rounds to get it working (hopefully) for Travis windows env. @stephtr when you get a chance please see if there is any unexpected consequence on windows. If you have git Now there are so many files touched, made me wonder maybe it is more efficient to just do the rest "non-code" mass-migration (adopting semicolon and tslint=>eslint), so we get it over in one shot instead of multiple PRs/reviews... @seanpoulter @stephtr do you guys have any objection? BTW, I assume we are all ok switching to semicolon, but figure I should confirm again... |
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.
Nice work! 👏
There's a few lines that are getting close to that 120 character limit I object to but it isn't worth any effort to debate code formatting. If you're happy, we're happy. The one thing to point out is this may affect our 4 open PRs. It's a small risk.
@seanpoulter thanks for taking the time to review! 👍
I agree the auto-formatting sometimes looked silly. I figure developers can always change it later if it bothers them, provided prettier check passes.
there is actually only 1 "active" PR, which is small, so hopefully, merge/rebase should not be too bad... I will merge this in, as there is another large-scale baseline change coming up: semicolon and eslint migration... then we can start to work on the more interesting problems in v4... I didn't hear your opinions regarding semicolon, I take it as "no objection"? In that case, I will pull the trigger in the next PR... |
Sounds good for the PRs then. I have no objection to semi-colons. I haven't heard if Babel or TypeScript have solved the ambiguity in the grammar that Douglas Crockford has complained about. It was something like: function f() {
return
{
key: 'value'
}
}
// f() => undefined I'm happy to review smaller MRs if you get a chunk of work done every day or so. |
didn't merge as I originally proposed... thinking it might be better to put all these internal changes in one PR so other PRs/developers don't have to merge/rebase it multiple times...
I will commit the rest of the changes in multiple commits within this PR, so you can do progressive reviews, knowing you have seen the priors... hope that will work. @seanpoulter once again, thanks for helping and pushing forward the v4! |
Can I suggest another strategy? Since you're motivated and driving these changes for v4, why don't we prioritize keeping you unblocked. I find big PRs are hard to find time to review, so I'd say get this merged. We could use a long-lived "v4 work in progress" branch but that's also going to slow you/us down if we have any PRs go in. Again, if we're prioritizing keeping you unblocked this isn't the best approach. What about our PRs? Most of these broad changes are (hopefully) automated. That means we should be able to revive our PRs with a process like:
I think that subset of files looks like:
If that sounds good, I'll move this into a living document that we can all edit (in the Wiki?). What do you think? |
@seanpoulter sorry just saw your reply after the eslint migration commit... I would admit that I do not fully grasp the strategy you are suggesting...? yes large change is harder to review, but most of the changes here are sort of "mechanical", should not have much logic implication, hopefully, should be easier to glance over for the most part. I plan to finish this PR this weekend, after that there should be no "massive" code change, just regular smaller scale PRs probably. Knowing this, can you elaborate on your proposal? I definitely like the idea to have a shorter cycle of code change, discussion, review... how do we make that happen? |
Ah, yea, more code. 🤷 I was suggesting we should merge what's already approved and keep the PRs separate. That way it's easier for me to review what's changed, and easier for anyone else to review the next MR without having to tackle the whole thing. |
hahaha, that was funny, nice emoji! Sorry that I misunderstood your point, but hey, you only have to look at them, I have to do the actual work to research and write (well, lost of copy/paste actually)... ok, seriously, I will make you a deal, do this review and I won't make you do the semi-colon review, which is pretty safe to just check-in as long as it passed all the tests.
You can see diff between 2 commits, for example, to see the eslint migration change vs the previous commit that you have reviewed: 7e8e3a6^...7e8e3a6 Migration to eslint is actually a fun process, I learned a few new things along the way, for example, some of our tests "cheated" and that they actually did not work 😂 ; It is impossible to partially mock module function declarations like in our |
@seanpoulter just wondering if you get a chance to look at the last commit yet, I was waiting to hear from you before proceeding to the semi-colon... |
Hey @connectdotz, no, sorry. I gave it a quick skim but haven't reviewed the non-obvious changes like the tests that you mentioned. Feel free to add it as another commit or PR against this branch? |
Done. There's no blocking comments. Nicely done. |
decided to wrap prettier under eslint, so all format errors will be shown just like lint error. Together with eslint's auto fix on save and ci check, don't think we need lint-staged during pre-commit anymore, so it is gone too... I think the package.json looked reasonably clean now. If no objection, I am going to pull the trigger for the following format changes (prettier):
|
I think I have touched enough files in this PR 😱 Ready to merge now. Last call for questions/concerns... @seanpoulter @stephtr |
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.
Approving again after skimming the last 4 commits. That's a lot of code churn. 🤣
Thanks for that effort @connectdotz! 👏
* run prttier for the whole project * adding .gitattribute to spcify eol for all platform * move .gitattributes to the right location * Update .travis.yml * fix prettier on windows * fix typo * eslint migration * remove API snapshot tests * wrap prettier inside eslint and removed lint-staged * prettier format change * fix the .js file format as well
motivation:
part of 4.0 initiative
we had some inconsistent eol problem, some are LF, and the other CRLF, which made GitHub diff going crazy... And since we upgraded prettier there are new defaults, such as Arrow Function parentheses that made our code inconsistent as well. Therefore, I think it is best to run prettier for the whole project to bring it up to a consistent base.
summary
eol
(LF) for all platforms when checking into github (added.gitattributes
).test
besides the normal unit test, I also did some simple test with my local workspaces, they seem fine.