Skip to content

Latest commit

 

History

History
151 lines (93 loc) · 4.08 KB

CONTRIBUTING.md

File metadata and controls

151 lines (93 loc) · 4.08 KB

Contributing to api-response-shaper

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.

Overview

  • Setting Up Your Environment
  • Testing Your Changes
  • Code Style Guidelines
  • Utilizing Pre-commit Hooks
  • Creating a Pull Request
  • Reporting Issues
  • Resources

Setting Up Your Environment

  1. Fork the Repository:

    Begin by forking the api-response-shaper repository on GitHub. This creates your own copy where you can make changes.

  2. 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
  3. 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
  4. Create a Feature Branch:

    It’s a good practice to create a new branch for your work:

    git checkout -b feature/your-feature-name

Testing Your Changes

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.

Code Style Guidelines

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

Utilizing Pre-commit Hooks

Pre-commit hooks are used to automatically check and format code before you make a commit. This ensures consistency and quality in the codebase.

  1. Install Pre-commit:

    poetry add --group dev pre-commit
  2. Set Up the Hooks:

    Install the pre-commit hooks by running:

    poetry run pre-commit install
  3. Manual Hook Execution (Optional):

    To run all hooks manually on your codebase:

    poetry run pre-commit run --all-files

Creating a Pull Request

Once your changes are ready, follow these steps to submit them:

  1. Commit Your Changes:

    Write clear and concise commit messages. Following the Conventional Commits format is recommended:

    git commit -am 'feat: add custom logging formatter'
  2. Push Your Branch:

    Push your branch to your fork on GitHub:

    git push origin feature/your-feature-name
  3. 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.

  4. Respond to Feedback:

    After submitting, a maintainer will review your pull request. Be prepared to make revisions based on their feedback.

Reporting Issues

Found a bug or have a feature request? We’d love to hear from you!

  1. Open an Issue:

    Head over to the Issues section of the api-response-shaper repository and click "New Issue".

  2. Describe the Problem:

    Fill out the issue template with as much detail as possible. This helps us understand and address the issue more effectively.

Resources

Here are some additional resources that might be helpful:


Thank you for your interest in contributing to api-response-shaper! We look forward to your contributions.