Trunk: Merged the Devel-branch (branches/griatch) into /trunk. This constitutes a major refactoring of Evennia. Development will now continue in trunk. See the wiki and the past posts to the mailing list for info. /Griatch
This commit is contained in:
parent
df29defbcd
commit
f83c2bddf8
222 changed files with 22304 additions and 14371 deletions
50
CODING_STYLE
50
CODING_STYLE
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
Evennia Code Style
|
||||
------------------
|
||||
All code submitted or committed to the Evennia project needs to follow the
|
||||
|
|
@ -5,21 +6,48 @@ guidelines outlined in Python PEP 8, which may be found at:
|
|||
|
||||
http://www.python.org/dev/peps/pep-0008/
|
||||
|
||||
A quick list of other stuff
|
||||
---------------------------
|
||||
* 4-space indention, NO TABS!
|
||||
* Unix line endings
|
||||
* CamelCase is only used for classes, nothing else.
|
||||
* All variables and functions are to be lowercase, and words separated by
|
||||
underscores.
|
||||
A quick list of code style points
|
||||
---------------------------------
|
||||
* 4-space indendation, NO TABS!
|
||||
* Unix line endings.
|
||||
* CamelCase is only used for classes, nothing else.
|
||||
* All non-global variable names and all function names are to be lowercase,
|
||||
words separated by underscores. Variable names should always be more than
|
||||
two letters long.
|
||||
* Module-level global variables (only) are to be in CAPITAL letters.
|
||||
* Imports are to be done in this order:
|
||||
- Python modules (Global, outside of Evennia)
|
||||
- Python modules (builtins and modules otherwise unrelated to Evennia)
|
||||
- Twisted
|
||||
- Django
|
||||
- Project modules
|
||||
- Evennia src/ modules
|
||||
- Evennia game/ modules
|
||||
|
||||
Pylint
|
||||
------
|
||||
The program 'pylint' (http://www.logilab.org/857) is a useful tool for checking
|
||||
your Python code for errors. It will also check how well your code adheres to
|
||||
the PEP 8 guidelines and tells you what can be improved.
|
||||
|
||||
Since pylint cannot catch dynamically created variables used in commands and
|
||||
elsewhere in Evennia, one needs to reduce some checks to avoid false errors and
|
||||
warnings. For best results, run pylint like this:
|
||||
|
||||
> pylint --disable=E1101,E0102,F0401,W0232,R0903 filename.py
|
||||
|
||||
To avoid entering the options every time, you can auto-create a pylintrc file by
|
||||
using the option --generate-rcfile. You need to dump this output into a
|
||||
file .pylintrc, for example like this (linux):
|
||||
|
||||
> pylint --disable=E1101,E0102,F0401,W0232,R0903 --generate-rcfile >& ~/.pylintrc
|
||||
|
||||
From now on you can then just run
|
||||
|
||||
> pylint filename.py
|
||||
|
||||
|
||||
Ask Questions!
|
||||
--------------
|
||||
If any of this outlined in PEP 8 or the list above doesn't make sense, please
|
||||
If any of the rules outlined in PEP 8 or in the list above doesn't make sense, please
|
||||
don't hesitate to ask on the Evennia mailing list at http://evennia.com.
|
||||
Keeping our code style uniform makes this project much easier for a wider group
|
||||
of people to participate in.
|
||||
of people to participate in.
|
||||
Loading…
Add table
Add a link
Reference in a new issue