Skip to content
This repository was archived by the owner on Jul 11, 2022. It is now read-only.

Commit d52e875

Browse files
authored
Create CONTRIBUTING.md
1 parent 69ebeb9 commit d52e875

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

CONTRIBUTING.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Contributing
2+
3+
Contributions are very welcome! Here are some guidelines on how the project is designed.
4+
5+
### CodeStyle
6+
7+
- Adhere to PEP8 as much as possible.
8+
9+
- Line lengths should be under 120 characters, use list comprehensions over map/filter, don't leave trailing whitespace.
10+
11+
- More complex pieces of code should be commented for future reference.
12+
13+
### Structure
14+
15+
There are a few self-imposed rules on the project structure, to keep the project as tidy as possible.
16+
- All modules should go into the `modules/` directory.
17+
- Any database accesses should be done in `modules/sql/` - no instances of SESSION should be imported anywhere else.
18+
- Make sure your database sessions are properly scoped! Always close them properly.
19+
- When creating a new module, there should be as few changes to other files as possible required to incorporate it.
20+
Removing the module file should result in a bot which is still in perfect working condition.
21+
- If a module is dependent on multiple other files, which might not be loaded, then create a list of at module
22+
load time, in `__main__`, by looking at attributes. This is how migration, /help, /stats, /info, and many other things
23+
are based off of. It allows the bot to work fine with the LOAD and NO_LOAD configurations.
24+
- Keep in mind that some things might clash; eg a regex handler could clash with a command handler - in this case, you
25+
should put them in different dispatcher groups.
26+
27+
Might seem complicated, but it'll make sense when you get into it. Feel free to ask me for a hand/advice (in `@onepunchsupport`)!

0 commit comments

Comments
 (0)