33 stable releases (3 major)

Uses new Rust 2024

3.4.0 May 29, 2025
3.2.9 Aug 26, 2024
3.2.8 Jul 26, 2024
3.2.7 Sep 27, 2023
0.2.0 Sep 25, 2021

#363 in Debugging

Download history 82/week @ 2025-06-06 504/week @ 2025-06-13 183/week @ 2025-06-20 135/week @ 2025-06-27 104/week @ 2025-07-04 98/week @ 2025-07-11 189/week @ 2025-07-18 349/week @ 2025-07-25 130/week @ 2025-08-01 162/week @ 2025-08-08 52/week @ 2025-08-15 302/week @ 2025-08-22 106/week @ 2025-08-29 277/week @ 2025-09-05 257/week @ 2025-09-12 101/week @ 2025-09-19

753 downloads per month
Used in 8 crates (3 directly)

CC0 license

245KB
5.5K SLoC

mit-lint

Lint commit messages

Example

use mit_commit::CommitMessage;
use mit_lint::{Code, lint, Problem, Lints, Lint};

let message: String = "x".repeat(73).clone().into();

let expected = vec![Problem::new(
    "Your subject is longer than 72 characters".into(),
    "It's important to keep the subject of the commit less than 72 characters \
     because when you look at the git log, that's where it truncates the message. \
     This means that people won't get the entirety of the information in your commit.\n\n\
     Please keep the subject line 72 characters or under".into(),
    Code::SubjectLongerThan72Characters,
    &message.clone().into(),
    Some(vec![(String::from("Too long"), 72, 1)]),
    Some(
        "https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines"
            .parse()
            .unwrap()
    ),
)];

let actual = lint(
&CommitMessage::from(message.clone()),
&Lints::new(
vec![Lint::SubjectLongerThan72Characters]
.into_iter()
.collect()
)
);

assert_eq!(
    actual,
    expected,
    "Expected {:?}, found {:?}",
    expected,
    actual
);

Docs

Read more at Docs.rs

Source

The source code is available on Codeberg

Dependencies

~8–11MB
~205K SLoC