LaurierCS / PHI-TextBasedGameEngine

A text based game engine for creating games
4 stars 1 forks source link

Code Style and Formatting #3

Open Knifesurge opened 4 years ago

Knifesurge commented 4 years ago

We should definitely consider a project-wide style and format so the code is still readable even when multiple people work on it.

A suggestion could be following the PEP-8 Style Guide.

I also highly encourage any method or class to be properly documented so the reason for its existence is clear. Inline comments I feel should also be required when the purpose of the code is not immediately clear. This will help make sure everyone is (roughly) on the same page.

jbheard commented 4 years ago

This is a great idea. How far do we want to go with this though? We could probably set up a GitHub action that won't allow a merge until the style is correct.

jbheard commented 4 years ago

Update to this; I added an action to this repo that won't allow merging a PR unless it is valid Python. I don't think it does any kind of style checking, but at the very least it makes sure everything is valid python.

jbheard commented 3 years ago

Another update: our action now does a full CI job. This includes:

I think stricter coding standards would be good, but I'm not entirely sure how to enforce them. I think the linter used in our CI (flake8) should have settings, but I'm not sure. Things I would like to enforce: