Thank you for your interest in contributing to Git Py Stats! We welcome contributions of all kinds, including bug reports, feature requests, documentation improvements, and code enhancements.
Please read our Code of Conduct to understand the expectations for participation in this project.
If you encounter any bugs or have suggestions for improvements, please open an issue. When reporting an issue, please include the following:
- A clear and descriptive title.
- A detailed description of the problem or suggestion.
- Steps to reproduce the issue (if applicable).
- Any relevant screenshots or error messages.
Have an idea for a new feature? We'd love to hear it! Please create an issue
with the tag feature request
and provide as much detail as possible about
the proposed functionality.
Contributions are made via pull requests. Here's how to submit one:
-
Fork the Repository
Click the "Fork" button at the top right of this repository page to create your own fork.
-
Clone Your Fork
git clone https://github.com/your-username/git-py-stats.git cd git-py-stats
-
Create a New Branch
It's best to create a new branch for each significant change.
git checkout -b feature/your-feature-name
-
Make Your Changes
-
Commit Your Changes
Write clear and descriptive commit messages.
git commit -m "Add feature: description of your feature"
-
Push to Your Fork
git push origin feature/your-feature-name
-
Open a Pull Request
Navigate to the original repository and click on "New Pull Request". Provide a clear description of your changes and reference any related issues should they exist.
- Language: We currently have a minimum requirement of Python 3.8. While this code may work on Python 3 versions below that, it is not guaranteed.
- Dependencies:
Git Py Stats should not have any dependencies outside of Python 3 and
git
. That means nobody should ever have to type inpip foo
before being able to run this program. - Style Guide: We use Black for auto formatting code in the repo before it gets merged for style consistency. We also use Ruff for linting in the repo before it gets merged for improving code quality.
- Naming Conventions: Use clear and descriptive names for variables, functions, and classes. When in doubt, always try to follow PEP 8.
- Documentation: Include docstrings for all public modules, functions, classes, and methods. Also include type hints for functions, classes, and methods.
While not strict, try to keep documentation around 80 columns per line. There is a hard limit of 100 columns per line of code currently.
This project uses Python's built-in unittest testing framework. Ensure that all tests pass before submitting a pull request.
-
Navigate to the Project Directory:
cd git-py-stats
-
Run All Tests:
You can run all tests using the
unittest
discovery mode, which will automatically find and execute all test files namedtest_*.py
within thegit_py_stats/tests/
directory:python3 -m unittest discover -s git_py_stats/tests
-
Run a Specific Test File:
To run a specific test file, you can use:
python3 -m unittest git_py_stats.tests.test_generate_cmds
-
Ensure that all test files follow the naming convention
test_*.py
. -
To view more detailed output, use the
-v
(verbose) flag:python3 -m unittest discover -s git_py_stats/tests -v
-
To run all tests automatically and display a summary of results:
python3 -m unittest discover -s git_py_stats/tests
-
If you need help writing tests, here are tutorials and books that might help:
- Write clear and concise code.
- Avoid unnecessary complexity.
- Ensure that your code is readable and maintainable.
- Comment your code where necessary to explain complex logic.
- Thanks to each and every one of the contributors of git-quick-stats for inspiring this project. Without them, this project would not exist.
- Special thanks to all the contributors who help make Git Py Stats better!