Skip to content

Commit d2f5342

Browse files
committed
Add pre-commit to dev dependencies and modify documetation to reflect that pre-commit is part of the dependencies
1 parent 21fa78f commit d2f5342

File tree

4 files changed

+227
-38
lines changed

4 files changed

+227
-38
lines changed

CONTRIBUTING.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,63 @@ Contributions are appreciated, even if just reporting bugs, documenting stuff or
66
## Setting Up Your Development Environment
77

88
### Cloning the Repository
9+
910
Start by forking and cloning the FastAPI-boilerplate repository:
1011

1112
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.
1213
1. **Create a Feature Branch**: Once you've forked the repo, create a branch for your feature by running `git checkout -b feature/fooBar`.
1314
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.
1415

1516
### Using uv for Dependency Management
17+
1618
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/).
1719

1820
Once uv is installed, navigate to the cloned repository and install the dependencies:
21+
1922
```sh
2023
cd FastAPI-boilerplate
2124
uv sync
2225
```
2326

2427
### Activating the Virtual Environment
28+
2529
uv creates a virtual environment for your project. Activate it using:
2630

2731
```sh
2832
source .venv/bin/activate
2933
```
3034

3135
Alternatively, you can run commands directly with `uv run` without activating the environment:
36+
3237
```sh
3338
uv run python your_script.py
3439
```
3540

3641
## Making Contributions
3742

3843
### Coding Standards
44+
3945
- Follow PEP 8 guidelines.
4046
- Write meaningful tests for new features or bug fixes.
4147

4248
### Testing with Pytest
49+
4350
FastAPI-boilerplate uses pytest for testing. Run tests using:
51+
4452
```sh
4553
uv run pytest
4654
```
4755

4856
### Linting
57+
4958
Use mypy for type checking:
59+
5060
```sh
5161
mypy src
5262
```
5363

5464
Use ruff for style:
65+
5566
```sh
5667
ruff check --fix
5768
ruff format
@@ -63,9 +74,8 @@ Ensure your code passes linting before submitting.
6374

6475
It helps in identifying simple issues before submission to code review. By running automated checks, pre-commit can ensure code quality and consistency.
6576

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.
6979
1. **Committing Your Changes**:
7080
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.
7181
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
8292
## Submitting Your Contributions
8393

8494
### Creating a Pull Request
95+
8596
After making your changes:
8697

8798
- Push your changes to your fork.
8899
- Open a pull request with a clear description of your changes.
89100
- Update the README.md if necessary.
90101

91-
92102
### Code Reviews
103+
93104
- Address any feedback from code reviews.
94105
- Once approved, your contributions will be merged into the main branch.
95106

96107
## Code of Conduct
108+
97109
Please adhere to our [Code of Conduct](CODE_OF_CONDUCT.md) to maintain a welcoming and inclusive environment.
98110

99111
Thank you for contributing to FastAPI-boilerplate🚀

0 commit comments

Comments
 (0)