Skip to content

Commit 45f9966

Browse files
authored
Added code conventions to CONTRIBUTING.md (soxoj#1589)
Added a link to code of conduct inside of CONTRIBUTING.md. Added naming conventions, indentation and import conventions. Added link to PEP 8 which I think most closely resembles the coding style used.
1 parent 46d8d8f commit 45f9966

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

CONTRIBUTING.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Hey! I'm really glad you're reading this. Maigret contains a lot of sites, and it is very hard to keep all the sites operational. That's why any fix is important.
44

5+
## Code of Conduct
6+
7+
Please read and follow the [Code of Conduct](CODE_OF_CONDUCT.md) to foster a welcoming and inclusive community.
8+
59
## How to add a new site
610

711
#### Beginner level
@@ -27,4 +31,23 @@ Always write a clear log message for your commits. One-line messages are fine fo
2731

2832
## Coding conventions
2933

30-
Start reading the code and you'll get the hang of it. ;)
34+
### General Guidelines
35+
36+
- Try to follow [PEP 8](https://www.python.org/dev/peps/pep-0008/) for Python code style.
37+
- Ensure your code passes all tests before submitting a pull request.
38+
39+
### Code Style
40+
41+
- **Indentation**: Use 4 spaces per indentation level.
42+
- **Imports**:
43+
- Standard library imports should be placed at the top.
44+
- Third-party imports should follow.
45+
- Group imports logically.
46+
47+
### Naming Conventions
48+
49+
- **Variables and Functions**: Use `snake_case`.
50+
- **Classes**: Use `CamelCase`.
51+
- **Constants**: Use `UPPER_CASE`.
52+
53+
Start reading the code and you'll get the hang of it. ;)

0 commit comments

Comments
 (0)