First: If you're unsure or afraid of anything, just ask or submit the issue or merge request anyway. You won't be yelled at for giving it your best effort. The worst that can happen is that you'll be politely asked to change something. We appreciate any sort of contributions, and don't want a wall of rules to get in the way of that.
mangadex-api welcomes contributions from everyone. There are many ways to contribute to mangadex-api, and the following document explains how you can contribute and how to get started. If you have any questions about contributing or need help with anything, feel free to ask questions on issues.
If you've gone through the basic setup, skip ahead to the High-level approach section.
First, make sure you have checked out the latest version of mangadex-api. If this is your first time working on mangadex-api, create a fork of the repository and clone it afterwards with the following command:
git clone [email protected]:<your-username>/mangadex-api
If you've already cloned mangadex-api in the past, update it to the latest version:
# Upstream has to be the remote of the "tonymushah/mangadex-api" repo.
git fetch upstream
# Make sure that you are on the "main" branch.
git checkout main
# Rebase your "main" branch on the upstream "main".
git rebase upstream/main
# Push to the "main" branch of your fork.
git push
You can build and test mangadex-api like every other Rust project:
cargo build
cargo test
All merge requests should be filed against the main
branch, except in very particular scenarios.
Unless you know for sure you should target another branch, main
will be the right choice (it's
also the default).
We follow a no merge-commit policy, meaning, when you encounter merge conflicts you are expected
to always rebase instead of merging. E.g. always use rebase when bringing the latest changes
from the main
branch to your feature branch. Also, please make sure fixup commits are squashed
into other related commits with meaningful commit messages.
- Find something to fix/improve.
- Change code (likely some file in
src/
). - Follow the instructions in the Basics section to get set up.
- Run
cargo test
in the root directory and adjust code until it passes. - Start committing your changes. Follow the conventional commit specification while doing so.
- Open an MR (also can be done after step 2. if you run into problems so that others can help).
We follow the default settings of the rust-fmt and rust-clippy tools. Be sure to run the following before creating a merge request:
# Format Rust code.
cargo fmt
# Run the linter to catch common mistakes and unidiomatic code.
cargo clippy
Contributions to mangadex-api should be made in the form of GitLab merge requests. Each merge request will be reviewed by a core contributor (someone with permission to land patches) and either landed in the main tree or given feedback for changes that would be required.
All code in this repository is under the Apache-2.0 or the MIT license.