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
Use prettier for code style guide #578
Comments
I like it. Enforcing a style guide would help eliminate a bunch of unnecessary back-n-forth on nitpick style comments, and consistency is great. I would suggest we explore two options here:
Between the two, I think my preference is (1) as it results in less surprises to folks committing code, even though it requires a bit more work from them. |
I agree, great thoughts. I wonder if there's a way to have it block the PR but give the option of having a bot autoformat it for them if they don't want to bother figuring it out for themselves. I'll take a closer look at the options when I find the time. |
Indeed, that would be ideal, but I wouldn't consider that a blocker. We could check-in a formatter config and provide some instructions on how to install and run it. Thanks for digging into this! |
I've submitted a PR... unfortunately, it does not accomplish blocking an ill-formatted PR though. I couldn't figure out how to do that (I'd love to learn if you have some suggestions of where I can look). I have come up with what I'm hoping is an acceptable compromise of creating a pre-commit hook |
I think creating a full fledged style guide, or even expecting contributors to adhere to a common style guide is probably too much for a project of this size. That said, I do think the code base could benefit greatly from improved styling. Today there are a lot of minor formatting errors like mismatched indentation levels, etc. These have no impact on the functionality of the code, but it certainly makes contributing more difficult.
For these reasons I think some kind of easy to follow style guide should be chosen for the project. I think the best option may be using something like the prettier formatter. This would simplify styling while improving consistency and legibility.
What do you all think?
The text was updated successfully, but these errors were encountered: