Hi!
Thanks for contributing to shuku. Before implementing new features and changes, please submit an issue so that we can discuss it.
We welcome contributions in many forms, including:
- Bug reports
- Feature requests
- Code patches
- Documentation improvements
- UI/UX suggestions
If you're not sure how to contribute or need help with something, please don't hesitate to reach out via the issue tracker, discussions, or email.
To set up your development environment:
-
curl -sSL https://install.python-poetry.org | python3 -
-
Clone the repository and navigate to the project directory:
git clone https://github.com/welpo/shuku.git cd shuku
-
Install the project dependencies:
poetry install --with dev
-
Activate the virtual environment:
poetry shell
Now you can run shuku
within the shell:
shuku --help
The shuku
command will be available within the poetry shell
and is linked to the project's source code. Code changes will be immediately reflected.
poetry run pytest
poetry run pytest --cov=shuku
poetry run mypy shuku
Working on your first pull request? You can learn how from this free video series:
How to Contribute to an Open Source Project on GitHub
Please make sure the following is done when submitting a pull request:
- Keep your PR small. Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
- Use descriptive titles. It is recommended to follow this commit message style.
- Test your changes. Make sure to test different configurations that might affect your changes.
- Update the documentation. Make the necessary changes to README.md.
- Fill the PR template. The template will guide you through the process of submitting a PR.
Our integration systems run automated tests to guard against mistakes. To speed things up, make sure you have done the following before submitting your PR:
- Make sure all new and existing tests pass with
poetry run pytest
. - Run
poetry run mypy shuku
to check for type errors. - Run
poetry run black {file/dir}
to format your code. - If necessary, update the documentation (i.e.
README.md
).
You might find the hooks in .githooks/
useful. Read more on the pre-commit githook section.
Format: <gitmoji> <type>(<scope>): <description>
<gitmoji>
is an emoji from the gitmoji list. It makes it easier to visually scan the commit history and quickly grasp the purpose of changes.
<scope>
is optional. If your change affects a specific part of the codebase, consider adding the scope. Scopes should be brief but recognizable, e.g. config
, metadata
, or logging
.
The various types of commits:
feat
: a new API or behaviour for the end user.fix
: a bug fix for the end user.style
: changes to the visual appearance.docs
: a documentation change.refactor
: a change to code that doesn't change behaviour, e.g. splitting files, renaming internal variables, improving code style…test
: adding missing tests, refactoring tests…chore
: upgrading dependencies, releasing new versions… Chores that are regularly done for maintenance purposes.misc
: anything else that doesn't change production code, yet is nottest
norchore
. e.g. updating GitHub actions workflow.
The commits within your PR don't need to follow this convention (we'll squash them). However, the PR title should be in this format. If you're not sure about the title, don't worry, we'll help you fix it. Your code is more important than conventions!
Example:
✨ feat(metadata): extract title from filename
^ ^--^^--------^ ^-------------------------^
| | | |
| | | +-> Description in imperative and lowercase.
| | |
| | +-> The scope of the change.
| |
| +-------> Type: see above for the list we use.
|
+----------> A valid gitmoji.
- Use
black
to format your code before submitting a pull request. - Functions should be type annotated. Use
mypy
to check for type errors. - Keep the code clean and maintainable. Here are some guidelines:
Click to expand guidelines
-
Test coverage: Ensure comprehensive code coverage and keep tests readable. 80% coverage is the minimum; 100% is nice to have.
-
Short, focused functions: Keep functions brief and adhere to a single responsibility. Minimise arguments and make function signatures intuitive.
-
Descriptive naming: Use unambiguous names to clarify function and variable purpose.
-
Consistent level: Maintain one level of abstraction or focus within functions.
-
DRY: Don't Repeat Yourself; abstract repeated code into functions.
-
Error handling: Use logging and provide clear, actionable error messages.
-
Minimal comments: Keep code self-explanatory. Explain the why, not the how.
-
Early returns: Avoid deep nesting.
We use a pre-commit githook to maintain code and file quality. This script performs a series of checks before allowing a commit.
To use the pre-commit githook, run the following command from the root of the repository. This configures the git hooks path and makes the script executable:
git config core.hooksPath .githooks
chmod +x .githooks/pre-commit
We expect all contributors to follow our Code of Conduct. Please be respectful and professional when interacting with other contributors.
The code is available under the MIT license.
Thank you for your contributions!