Thank you for your interest in contributing to our project! We use Git pre-commit hooks to ensure code quality and consistency. Before contributing, please follow these guidelines to enable and use the pre-commit hooks.
We have set up pre-commit hooks to check that the files you're committing meet our coding and formatting standards. These checks include:
- Ensuring there are no trailing spaces.
- Formatting code with black.
- Checking compliance with PEP8 using flake8.
- Verifying that files end with a newline character (and only a newline).
- Sorting imports using isort.
Please note that these hooks are disabled by default. To enable them, follow these steps:
- Install the
pre-commit
package using pip:pip install pre-commit
- Install the Git hooks using:
pre-commit install
Once you have enabled the pre-commit hooks, follow these steps when making a commit:
- Make your changes to the codebase.
- Stage your changes by using git add for the files you modified.
- Commit your changes using git commit. The pre-commit hooks will run automatically at this point.
- If all hooks run successfully, you can write your commit message, and your changes will be successfully committed.
- If any hook fails, your commit will not be successful. Please read and follow the error messages provided, make the necessary changes, and then re-run git add and git commit.
Your contributions are valuable to us, and by following these guidelines, you help maintain code consistency and quality in our project. We appreciate your dedication to ensuring high-quality code. If you have questions or need assistance, feel free to reach out to us. Thank you for being part of our open-source community!