Skip to content
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 formatting #44

Open
peey opened this issue Jul 15, 2018 · 3 comments
Open

Code formatting #44

peey opened this issue Jul 15, 2018 · 3 comments

Comments

@peey
Copy link
Collaborator

peey commented Jul 15, 2018

I don't want to set up a linting check / commit hook because I think it'll add friction to the process of contributing to the site

Also this is a small project so we might not really need it.

But we do want to end up just formatting everything from time to time so that it looks consistent for someone new who looks at the code.

Chances are -- if the code already isn't spaghetti then someone changing some files would also adhere to the making their changes look nice and fit in with the rest of the code too.

How could we achieve this? How about adding a few scripts which can be manually triggered to auto-format html, css, yaml, and js and then one could just run the script after it's been a long time and submit a PR

@virresh
Copy link
Member

virresh commented Jul 15, 2018

Sounds nice, though I'd suggest enforcing this with a linter as well
(Mainly because we aim to help developers produce quality code, and even if it slows down their progress, they do get something out of it in the process and write better code next time onwards)

@peey
Copy link
Collaborator Author

peey commented Jul 15, 2018

I agree with what you said, but I think the problem here would be that some of the people contributing may not appreciate the role of a linter yet - i.e. haven't worked in large enough codebase to realize that non-strict code styles can become a problem

So I'd recommend against making it mandatory. Could we maybe add it as optional? So if someone is contributing a big feature then we can ask them to run the linter (on the lines added in their diff?), but if someone is contributing a simple one liner CSS bug fix, I don't want to drag on that process...

@virresh
Copy link
Member

virresh commented Jul 15, 2018

Sounds good
We can add a linter check job on the CI, and make it optional so that the build won't fail even if the code isn't well written
We can always see build logs for a reasonable amount of time, which would indicate whenever we have a failure in the linter job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants