# Development
## Environment
[](https://pre-commit.com)
For working on the ecformat project the following tools have to be installed:
- [Rust](https://www.rust-lang.org/tools/install) - Tool chain for the Rust programming language
- [just](https://just.systems/man/en/prerequisites.html) - A command runner, see `just -l` for available commands
- [pre-commit](https://pre-commit.com/#install) - Manage git commit hooks
and installs additional linters to run.
Add the hooks of the repository with `pre-commit install`
- [REUSE](https://git.fsfe.org/reuse/tool#install) (optional) - For adding
license information to files (see `just` commands `annotate_*`).
Copying the header (or `.license` file) from another file also works.
You can check your local environment by running all linters with `just lint`.
The recommended editor for the project is [VSCodium](https://vscodium.com)
for which the repository contains extension recommendations and settings.
If you prefer any other editor or IDE for Rust, it should also work.
## Dependencies
[](https://deps.rs/repo/codeberg/BaumiCoder/ecformat)
The badge shows the status of the Rust dependencies of ecformat for the main branch.
It only considers the `Cargo.toml`.
Therefore, the `Cargo.lock` may need an update, although the badge is green.
The versions of the linters,
configured for the CI and pre-commit,
needs to be checked manually.
Same for the Rust version in the `rust-toolchain.toml`
and the versions of the container images in the CI.
(There is no support to automatically keep track of dependency versions on Codeberg.
See [issue](https://codeberg.org/Codeberg/Community/issues/1108) for current status)
## Release management
The issues for a release and the related pull requests are bundled
in a [milestone](https://codeberg.org/BaumiCoder/ecformat/milestones),
which is named in the schemata `Version x.y.z`.
The version numbers should follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
and if the number for the next release have to change the milestone name will be updated.
Before a release can be created, every issue in the related milestone have to be closed.
To create a release with CI a tag needs to be pushed on the main branch.
This tag has to be named `vx.y.z` for the version `x.y.z` as set in the `Cargo.toml`.
The tag message will be part of the release description,
which will also link to the [packages](https://codeberg.org/BaumiCoder/ecformat/packages)
of the version and the version on other, central, package repositories.
The description of the pull requests in the milestone will be linked,
to be kind of a changelog for the version.
Steps to create a release for version `x.y.z`
when milestone `Version x.y.z` has not open issue anymore:
1. Switch to the `main` branch
2. Set the version in the `Cargo.toml` to `x.y.z` and commit this change
3. `git tag -a vx.y.z` and give a short summary about the version in the message
4. `git push --follow-tags` to trigger CI - **ATTENTION:** Versions cannot be removed from some package repositories (like crates.io)
5. Wait for the [CI](https://codeberg.org/BaumiCoder/ecformat/actions) to complete
6. Check if all links the description of the created [release](https://codeberg.org/BaumiCoder/ecformat/releases) are working