Skip to content

Commit 84f4812

Browse files
authored
Update CONTRIBUTING.md
1 parent c8d8690 commit 84f4812

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

CONTRIBUTING.md

+28-6
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,40 @@ Tech Stack Overview:
3535

3636
- 🖥 Backend: Developed in Python 🐍
3737

38-
### 🌐 If you are looking to contribute to frontend (⚛️React, Vite):
38+
### 🌐 Frontend Contributions (⚛️ React, Vite)
3939

40+
* The updated Figma design can be found [here](https://www.figma.com/file/OXLtrl1EAy885to6S69554/DocsGPT?node-id=0%3A1&t=hjWVuxRg9yi5YkJ9-1). Please try to follow the guidelines.
41+
* **Coding Style:** We follow a strict coding style enforced by ESLint and Prettier. Please ensure your code adheres to the configuration provided in our repository's `fronetend/.eslintrc.js` file. We recommend configuring your editor with ESLint and Prettier to help with this.
42+
* **Component Structure:** Strive for small, reusable components. Favor functional components and hooks over class components where possible.
43+
* **State Management** If you need to add stores, please use Redux.
4044

41-
- The updated Figma design can be found [here](https://www.figma.com/file/OXLtrl1EAy885to6S69554/DocsGPT?node-id=0%3A1&t=hjWVuxRg9yi5YkJ9-1).
42-
43-
Please try to follow the guidelines.
44-
45-
### 🖥 If you are looking to contribute to Backend (🐍 Python):
45+
### 🖥 Backend Contributions (🐍 Python)
4646

4747
- Review our issues and contribute to [`/application`](https://github.com/arc53/DocsGPT/tree/main/application)
4848
- All new code should be covered with unit tests ([pytest](https://github.com/pytest-dev/pytest)). Please find tests under [`/tests`](https://github.com/arc53/DocsGPT/tree/main/tests) folder.
4949
- Before submitting your Pull Request, ensure it can be queried after ingesting some test data.
50+
- **Coding Style:** We adhere to the [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide for Python code. We use `ruff` as our linter and code formatter. Please ensure your code is formatted correctly and passes `ruff` checks before submitting.
51+
- **Type Hinting:** Please use type hints for all function arguments and return values. This improves code readability and helps catch errors early. Example:
52+
53+
```python
54+
def my_function(name: str, count: int) -> list[str]:
55+
...
56+
```
57+
- **Docstrings:** All functions and classes should have docstrings explaining their purpose, parameters, and return values. We prefer the [Google style docstrings](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html). Example:
58+
59+
```python
60+
def my_function(name: str, count: int) -> list[str]:
61+
"""Does something with a name and a count.
62+
63+
Args:
64+
name: The name to use.
65+
count: The number of times to do it.
66+
67+
Returns:
68+
A list of strings.
69+
"""
70+
...
71+
```
5072

5173
### Testing
5274

0 commit comments

Comments
 (0)