Skip to content

Commit 9b088d2

Browse files
committed
fix: adding singular newline breaks
Some commits use only a singular new line to separate the title and the body.
1 parent fa40714 commit 9b088d2

File tree

5 files changed

+37
-19
lines changed

5 files changed

+37
-19
lines changed

Cargo.lock

Lines changed: 24 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "conventional_commits_linter"
3-
version = "0.7.0"
3+
version = "0.7.1"
44
description = "A tooling/language agnostic utility to lint Git commit message against the Conventional Commits specification."
55
authors = ["C <DeveloperC@protonmail.com>"]
66
edition = "2018"

end-to-end-tests/features/no-description.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ Feature: No descriptions are caught as a Conventional Commits specification viol
1212
| test: \n\nCo-authored-by: Renovate Bot <bot@renovateapp.com>\n\n |
1313
| doc(README): \n\n |
1414
| chore!(release): \n\n |
15+
| chore!(release): \n |
16+
| test: \nCo-authored-by: Renovate Bot <bot@renovateapp.com>\n\n |

src/linter/conventional_commits_specification/no_description/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::model::LintingError;
55
pub fn lint(commit_message: &str) -> Result<(), LintingError> {
66
lazy_static! {
77
static ref NO_DESCRIPTION_REGEX: Regex = Regex::new(&format!(
8-
r"{}([[:space:]]*($|\n\n))",
8+
r"{}([[:space:]]*($|\n))",
99
*crate::linter::regex::IGNORE_TYPE_AND_SCOPE_LINTING_ERRORS,
1010
))
1111
.unwrap();

src/linter/conventional_commits_specification/no_description/tests.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ use super::*;
66
commit_message,
77
case("fix:"),
88
case("chore(release):\n\n"),
9-
case("chore(release): \n\n")
9+
case("chore(release): \n\n"),
10+
case("lint: \n")
1011
)]
1112
fn test_no_description(commit_message: &str) {
1213
assert_eq!(lint(commit_message), Err(LintingError::NO_DESCRIPTION));
@@ -17,14 +18,20 @@ fn test_no_description_with_exclamation(commit_message: &str) {
1718
assert_eq!(lint(commit_message), Err(LintingError::NO_DESCRIPTION));
1819
}
1920

20-
#[rstest(commit_message, case(" feat: "), case("\tchore:\n\n"))]
21+
#[rstest(
22+
commit_message,
23+
case(" feat: "),
24+
case("\tchore:\n\n"),
25+
case(" major: \n")
26+
)]
2127
fn test_no_description_with_preceding_whitespace(commit_message: &str) {
2228
assert_eq!(lint(commit_message), Err(LintingError::NO_DESCRIPTION));
2329
}
2430

2531
#[rstest(
2632
commit_message,
2733
case("chore(deps):\n\nCo-authored-by: Renovate Bot <bot@renovateapp.com>"),
34+
case("chore(deps): \nCo-authored-by: Renovate Bot <bot@renovateapp.com>"),
2835
case("chore: \n\nBumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.\r\n- [Release notes](https://github.com/bitinn/node-fetch/releases)\r\n- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)\r\n- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)\r\n\r\nSigned-off-by: dependabot[bot] <support@github.com>\r\n\r\nCo-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>")
2936
)]
3037
fn test_no_description_with_body(commit_message: &str) {

0 commit comments

Comments
 (0)