You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+16-4Lines changed: 16 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,52 +6,63 @@ Contributions are appreciated, even if just reporting bugs, documenting stuff or
6
6
## Setting Up Your Development Environment
7
7
8
8
### Cloning the Repository
9
+
9
10
Start by forking and cloning the FastAPI-boilerplate repository:
10
11
11
12
1.**Fork the Repository**: Begin by forking the project repository. You can do this by visiting https://github.com/igormagalhaesr/FastAPI-boilerplate and clicking the "Fork" button.
12
13
1.**Create a Feature Branch**: Once you've forked the repo, create a branch for your feature by running `git checkout -b feature/fooBar`.
13
14
1.**Testing Changes**: Ensure that your changes do not break existing functionality by running tests. In the root folder, execute `uv run pytest` to run the tests.
14
15
15
16
### Using uv for Dependency Management
17
+
16
18
FastAPI-boilerplate uses uv for managing dependencies. If you don't have uv installed, follow the instructions on the [official uv website](https://docs.astral.sh/uv/).
17
19
18
20
Once uv is installed, navigate to the cloned repository and install the dependencies:
21
+
19
22
```sh
20
23
cd FastAPI-boilerplate
21
24
uv sync
22
25
```
23
26
24
27
### Activating the Virtual Environment
28
+
25
29
uv creates a virtual environment for your project. Activate it using:
26
30
27
31
```sh
28
32
source .venv/bin/activate
29
33
```
30
34
31
35
Alternatively, you can run commands directly with `uv run` without activating the environment:
36
+
32
37
```sh
33
38
uv run python your_script.py
34
39
```
35
40
36
41
## Making Contributions
37
42
38
43
### Coding Standards
44
+
39
45
- Follow PEP 8 guidelines.
40
46
- Write meaningful tests for new features or bug fixes.
41
47
42
48
### Testing with Pytest
49
+
43
50
FastAPI-boilerplate uses pytest for testing. Run tests using:
51
+
44
52
```sh
45
53
uv run pytest
46
54
```
47
55
48
56
### Linting
57
+
49
58
Use mypy for type checking:
59
+
50
60
```sh
51
61
mypy src
52
62
```
53
63
54
64
Use ruff for style:
65
+
55
66
```sh
56
67
ruff check --fix
57
68
ruff format
@@ -63,9 +74,8 @@ Ensure your code passes linting before submitting.
63
74
64
75
It helps in identifying simple issues before submission to code review. By running automated checks, pre-commit can ensure code quality and consistency.
65
76
66
-
1.**Install Pre-commit**:
67
-
-**Installation**: Install pre-commit in your development environment. Use the command `uv add --dev pre-commit` or `pip install pre-commit`.
68
-
-**Setting Up Hooks**: After installing pre-commit, set up the hooks with `pre-commit install`. This command will install hooks into your .git/ directory which will automatically check your commits for issues.
77
+
1.**Set Up Pre-commit Hooks**:
78
+
Set up the hooks with `pre-commit install`. This command will install hooks into your .git/ directory which will automatically check your commits for issues.
69
79
1.**Committing Your Changes**:
70
80
After making your changes, use `git commit -am 'Add some fooBar'` to commit them. Pre-commit will run automatically on your files when you commit, ensuring that they meet the required standards.
71
81
Note: If pre-commit identifies issues, it may block your commit. Fix these issues and commit again. This ensures that all contributions are of high quality.
@@ -82,18 +92,20 @@ It helps in identifying simple issues before submission to code review. By runni
82
92
## Submitting Your Contributions
83
93
84
94
### Creating a Pull Request
95
+
85
96
After making your changes:
86
97
87
98
- Push your changes to your fork.
88
99
- Open a pull request with a clear description of your changes.
89
100
- Update the README.md if necessary.
90
101
91
-
92
102
### Code Reviews
103
+
93
104
- Address any feedback from code reviews.
94
105
- Once approved, your contributions will be merged into the main branch.
95
106
96
107
## Code of Conduct
108
+
97
109
Please adhere to our [Code of Conduct](CODE_OF_CONDUCT.md) to maintain a welcoming and inclusive environment.
98
110
99
111
Thank you for contributing to FastAPI-boilerplate🚀
0 commit comments