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

Improve coding standards #14

Closed
3 of 4 tasks
SteelWagstaff opened this issue Mar 10, 2022 · 9 comments
Closed
3 of 4 tasks

Improve coding standards #14

SteelWagstaff opened this issue Mar 10, 2022 · 9 comments

Comments

@SteelWagstaff
Copy link
Member

SteelWagstaff commented Mar 10, 2022

As the product owner, I want to make sure that we're using clear and agreed upon coding standards for all the repos that we maintain to ensure that our products are more reliable.

In particular, we should

We agreed on:

  • Research about different rules available and which one would make sense to add/avoid
  • Research practices for implementing it in WP
  • Propose the implementation
  • Meet with tech team to agree on the implementation and rules
@richard015ar
Copy link

Progress on this:
I was reviewing: https://github.com/WordPress/WordPress-Coding-Standards
To compare with human made. I installed it locally but I had some issues trying to run it.

I booked a meeting with Dalcin and Os to have a quick brainstorming session to see what we expect here as a dev in our ruleset.

@richard015ar richard015ar removed their assignment Jun 2, 2022
@SteelWagstaff
Copy link
Member Author

@richard015ar this might be a helpful place to start if you haven't already seen it: https://engineering.hmn.md/standards/style/php/

@richard015ar richard015ar self-assigned this Jun 2, 2022
@richard015ar
Copy link

thanks! Yes I read the intro to understand why we use it. Defintely it is the most popular and widely used for WP.
I am taking some notes on this to discuss with devs and see which rules would make sense, and also I wanna make sure we'll use it. I feel, except anyone knows something better for us, it will be the tool we will keep using it.

@richard015ar
Copy link

We had a meeting with Os and Dalcin. We agreed on keeping humanmade lib and follow the WP coding standards with some exceptions.

I will write a document with exceptions and then we'll review those and iterate over it, until we get somethings we feel comfortable. Then, I will write a PR for our coding-standards repo, and update docs where needed.

@richard015ar
Copy link

richard015ar commented Jun 8, 2022

Update

I played around locally with some other libs and read a lot about the background of HM CS, WP CS and PHP CS. I also analyzed our rules, why we applied some of them and how we can centralize and avoid duplications.
I submitted a tiny PR to fix the contrib guide: pressbooks/pressbooks#2821

I also created a doc to share with the team before change our coding standard doc: https://docs.google.com/document/d/1TcltiK7mamenA1lbahyFmiEKDt_pBTcn2ZovnFZ-Ro8/edit#

TODO: Check how JS Coding Standars works (outside scope for this task, but easily managed by HM CS lib)

@richard015ar
Copy link

I published the doc: https://docs.google.com/document/d/1TcltiK7mamenA1lbahyFmiEKDt_pBTcn2ZovnFZ-Ro8/edit#heading=h.azay36inuskn which contains basic explanation about how our current coding standards work and a proposal to centralise and changes needed.
And tech team didn't had comments or suggestions on this, so it ready to go (implementation task).

In general, the current implementation makes sense and few rules are unused. Other than that, it is just avoid rules exceptions duplicated in plugins, and move that at the code level if necessary, we need to analyze repo by repo following the general proposed rules.

@richard015ar
Copy link

https://pressbooks.org/dev-docs/coding-standards/ docs looks pretty good, nothing to change there.

@SteelWagstaff
Copy link
Member Author

SteelWagstaff commented Jun 9, 2022

@richard015ar thank you so much for your work on the coding standards doc! I made some edits and added some context for additional clarification: https://docs.google.com/document/d/1TcltiK7mamenA1lbahyFmiEKDt_pBTcn2ZovnFZ-Ro8/edit#heading=h.f3twoiy72t97. I don't have strong opinions about specfic rules to implement or exclude at this time and would leave that conversation to the tech team.

@SteelWagstaff
Copy link
Member Author

I've updated #16 with next steps and set it as an epic. Will close this issue as completed for now.

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

No branches or pull requests

6 participants