Skip to main content

Module commit

Module commit 

Source
Expand description

Commit domain entity

This module provides structures for working with git commits and parsing Conventional Commits format.

§Conventional Commits Format

The basic format is: <type>[optional scope]: <description>

Common types:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code style changes
  • refactor: Code refactoring
  • perf: Performance improvements
  • test: Adding tests
  • build: Build system changes
  • ci: CI configuration changes
  • chore: Maintenance tasks

§Examples

use governor_core::domain::commit::{Commit, CommitType};

let commit = Commit::new(
    "abc123def".to_string(),
    "feat(api): add user authentication".to_string(),
    "Alice".to_string(),
    "alice@example.com".to_string(),
    chrono::Utc::now(),
);

assert_eq!(commit.commit_type, Some(CommitType::Feat));
assert_eq!(commit.scope, Some("api".to_string()));

Structs§

Commit
A git commit
CommitHistory
A collection of commits

Enums§

CommitType
Conventional commit types