From 45f9966b34c72b654c72a351b270d7b96e75a01d Mon Sep 17 00:00:00 2001 From: Topa <48222621+Lord-Topa@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:04:10 -0700 Subject: [PATCH] Added code conventions to CONTRIBUTING.md (#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. --- CONTRIBUTING.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1e410da..3a73a6d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,6 +2,10 @@ 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. +## Code of Conduct + +Please read and follow the [Code of Conduct](CODE_OF_CONDUCT.md) to foster a welcoming and inclusive community. + ## How to add a new site #### Beginner level @@ -27,4 +31,23 @@ Always write a clear log message for your commits. One-line messages are fine fo ## Coding conventions -Start reading the code and you'll get the hang of it. ;) +### General Guidelines + +- Try to follow [PEP 8](https://www.python.org/dev/peps/pep-0008/) for Python code style. +- Ensure your code passes all tests before submitting a pull request. + +### Code Style + +- **Indentation**: Use 4 spaces per indentation level. +- **Imports**: + - Standard library imports should be placed at the top. + - Third-party imports should follow. + - Group imports logically. + +### Naming Conventions + +- **Variables and Functions**: Use `snake_case`. +- **Classes**: Use `CamelCase`. +- **Constants**: Use `UPPER_CASE`. + +Start reading the code and you'll get the hang of it. ;) \ No newline at end of file