-
Notifications
You must be signed in to change notification settings - Fork 51
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
Added Prettier as source code formatter #50
Conversation
This PR is ready for review, but I haven't finish all the tasks yet and need some feedback. I'm a bit unsure about the files/directory included inside |
@mqnguyen5 LGTM! |
I have included some changes, specifically:
Please have a look and let me know if I need to fix anything. |
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.
Most of this looks good, but there are a few places that I don't understand what it's doing.
I also wonder if we should wait to do this until after all the other PRs land for 0.3, since this will be pretty disruptive to everyone's current work.
docs/A-Introduction/information.md
Outdated
* Exa or E (=1024P): 1 Exabyte = 1024 * 1024 * 1024 * 1024 * 1024 * 1024 bytes ~ 10<sup>18</sup> bytes | ||
- Kilo or k (=1024): 1 Kilobyte = 1024 bytes ~ 10<sup>3</sup> bytes | ||
- Mega or M (=1024k): 1 Megabyte = 1024 \* 1024 bytes ~ 10<sup>6</sup> bytes | ||
- Giga or G (=1024M): 1 Gigabyte = 1024 _ 1024 _ 1024 bytes ~ 10<sup>9</sup> bytes |
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.
But look at this change, it's changed *
to _
which is semantically not the same thing. I don't understand it. I wonder if we need to embed this code in backticks to have it not get changed?
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.
Somehow Prettier thought the *
in 1024 * 1024 * 1024
as an indication for bulleted list or something and changed it into _
.
For the Prettier formatting bug, I just reverted the formatting commit. I think we should double check the special characters used in the docs, specifically in For the extensions comment by @Kevan-Y and based on the suggestion of @humphd , I removed |
In my opinion, I think the best option is to escape those characters. We will have to check each .md file and escape special characters.
Looks good. Thanks |
Good point. Since we have a lot of files that need formatting, I think we can file a separate issue for it, and merge what we have at the moment:
@humphd what do you think about this? |
The minute we land the prettier stuff, we also need to format the whole tree at the same time. We have to be ready to deal with the edge cases before this goes in. I would file issues on the specific things that Prettier is breaking, get those fixed and merged, rebase this, and then run prettier over the whole tree and land. |
Alright, I'll ran the docs against prettier again, and file issues explaining what to fix. Hopefully we can get it done by today. |
A note that we'll circle back on this early next week once we've cleared the current PRs. |
@mqnguyen5 let's rebase this and re-run so we can review it again. |
Will do. |
* installed prettier * added prettier config file and defined several formatting rules * added prettier ignore file * added scripts for running prettier * installed husky * installed pretty-quick and added script for pre-commit hook * added pre-commit hook * added vscode integration with settings and suggested extensions
@mqnguyen5 we just merged the last of the PRs that were blocking this, do you want to rebase and try running it again to see how it is? I think we can merge soon. |
@humphd I just pull the latest changes and run them through Prettier. |
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 looks great, I have no concerns. Well done.
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.
LGTM
@CameronGray1210 I'm going to merge this, and it will mean that you need to pull from the upstream repo and then re-run In a follow-up, I'll file an issue to add the Also note: this change will recommend that people install the following VSCode extensions, which will help with the editing process, and run Prettier every time you save: |
Fixes #24.
Current progress: