We’re excited that you’re interested in contributing to api-response-shaper
! Whether you’re fixing a bug, adding a feature, or improving the project, your help is appreciated.
- Setting Up Your Environment
- Testing Your Changes
- Code Style Guidelines
- Utilizing Pre-commit Hooks
- Creating a Pull Request
- Reporting Issues
- Resources
-
Fork the Repository:
Begin by forking the
api-response-shaper
repository on GitHub. This creates your own copy where you can make changes. -
Clone Your Fork:
Use the following command to clone your fork locally:
git clone https://github.com/your-username/api-response-shaper.git cd api-response-shaper
-
Install Dependencies:
Install the necessary dependencies using
Poetry
. If Poetry isn't installed on your machine, you can find installation instructions on the Poetry website.poetry install
-
Create a Feature Branch:
It’s a good practice to create a new branch for your work:
git checkout -b feature/your-feature-name
We use pytest
for running tests. Before submitting your changes, ensure that all tests pass:
poetry run pytest
If you’re adding a new feature or fixing a bug, don’t forget to write tests to cover your changes.
Maintaining a consistent code style is crucial. We use black
for code formatting and isort
for import sorting. Make sure your code adheres to these styles:
poetry run black .
poetry run isort .
For linting, pylint
is used to enforce style and catch potential errors:
poetry run pylint api-response-shaper
Pre-commit hooks are used to automatically check and format code before you make a commit. This ensures consistency and quality in the codebase.
-
Install Pre-commit:
poetry add --group dev pre-commit
-
Set Up the Hooks:
Install the pre-commit hooks by running:
poetry run pre-commit install
-
Manual Hook Execution (Optional):
To run all hooks manually on your codebase:
poetry run pre-commit run --all-files
Once your changes are ready, follow these steps to submit them:
-
Commit Your Changes:
Write clear and concise commit messages. Following the Conventional Commits format is recommended:
git commit -am 'feat: add custom logging formatter'
-
Push Your Branch:
Push your branch to your fork on GitHub:
git push origin feature/your-feature-name
-
Open a Pull Request:
Go to the original
api-response-shaper
repository and open a pull request. Include a detailed description of your changes and link any related issues. -
Respond to Feedback:
After submitting, a maintainer will review your pull request. Be prepared to make revisions based on their feedback.
Found a bug or have a feature request? We’d love to hear from you!
-
Open an Issue:
Head over to the
Issues
section of theapi-response-shaper
repository and click "New Issue". -
Describe the Problem:
Fill out the issue template with as much detail as possible. This helps us understand and address the issue more effectively.
Here are some additional resources that might be helpful:
- Poetry Documentation
- Black Documentation
- isort Documentation
- pytest Documentation
- pylint Documentation
- Pre-commit Documentation
Thank you for your interest in contributing to api-response-shaper
! We look forward to your contributions.