EmblemOfEa / Tenebrae

1 stars 0 forks source link

Standards #5

Open taladan opened 6 years ago

taladan commented 6 years ago
Standards
Code standards draft
  • [ ] Any particular code conventions that we want to put in that are outside the scope of PEP8?
  • [ ] Format for prompt displays
  • [ ] Default textwidth for output
Help standards draft
  • [ ] Line counts
  • [ ] Format (should comply with PEP257)
UX/UI Mockup:
  • [ ] Unified output design
  • [ ] Seperate output formats between informationals vs. interactives?
  • [ ] Colorization
  • [ ] Ascii design - (unicode/utf is available, but not turned on by default in all clients).

(I know I touched on __docstrings__ stuff in another issue, but standards should have its own issue. This is the current stuff that I could think of that needs to be discussed/resolved.)

Code Standards Proposal:

Naming and readability standards for code. We will be following the Evennia Code Style guidelines.

1) Classes:

* Command classes contain func() method and begin with `Cmd` prefix
    > ```
    > class CmdClassname(Typeclass):
    >      def __init__(self):
    >          pass
    >
    >      def func():
    >           pass
    >```

2) Methods

* Internal methods:
    * Begin with an underscore ('_') character
    * Simple and descriptive
    * Variable names expose intentions of what the internal is expecting (character, inventory, money...)

        > ```
        > def _character_desc(self, character):
        >       """return character description"""
        >       return self.character.db.desc
        >
        > def _calc_armor_dmg(self, shield, armor, resistances):
        >       """calculate damage done to a character's armor"""
        >       pass
        > ```

* External methods:
    * Begin with an alpha character
    * Simple and descriptive
    * Variable indicates object or type it expects

        > ```
        > def inventory(self, character):
        >       pass
        >
        > def puppeted(self, account):
        >       pass
        > ```
taladan commented 6 years ago

I need to try and stick to this: https://github.com/erlang/otp/wiki/writing-good-commit-messages

taladan commented 6 years ago

I've been looking at TravisCI. This is something that we're going to need to know, but not something we have to have right now. Gotta get working code and tests in before TravisCI can do its thing. We'll have to add it to the Tene repo when we get to that point.