cargo-git-semver

Crates.iocargo-git-semver
lib.rscargo-git-semver
version0.6.0
sourcesrc
created_at2024-08-30 15:13:40.537726
updated_at2024-08-30 15:13:40.537726
descriptionautomatically update package version from git tags
homepage
repositoryhttps://github.com/btel/cargo-git-semver
max_upload_size
id1357781
size42,581
Bartosz Telenczuk (btel)

documentation

README

cargo git-semver

Cargo command to automatically update version number.

Usage

It's designated to be used with pre-commit but can be also used independently of it.

  • automatically bump package version in Cargo.toml to match the latest git tag

    cargo git-semver bump
    
  • check whether a git tag was created f

    cargo git-semver check-tags
    

pre-commit configuration

Install pre-commit and add the following configuration to your project dir:

# .pre-commit-config.yaml
repos:
    -   repo: https://github.com/btel/cargo-semver-hook
        rev: 0.6.0
        hooks:
          - id: git-semver-bump
            args: ['--mode', 'pep440']
            files: '^(python|src|doc|Cargo\.toml|pyproject\.toml)'
            always_run: false
          - id: git-semver-check-tags
Commit count: 0

cargo fmt