diff --git a/CHANGELOG.md b/CHANGELOG.md index cdbaeb9..0ade5d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ This changelog was created using the `clu` binary --> # Changelog +## [v1.1.2](https://github.com/MalteHerrmann/changelog-utils/releases/tag/v1.1.2) - 2024-06-30 + +### Bug Fixes + +- (lint) [#45](https://github.com/MalteHerrmann/changelog-utils/pull/45) Use correct line number. + ## [v1.1.1](https://github.com/MalteHerrmann/changelog-utils/releases/tag/v1.1.1) - 2024-06-30 ### Bug Fixes diff --git a/src/changelog.rs b/src/changelog.rs index b9d81f9..0ad6a66 100644 --- a/src/changelog.rs +++ b/src/changelog.rs @@ -247,8 +247,10 @@ pub fn parse_changelog(config: Config, file_path: &Path) -> Result, fp: &Path, line: usize, problem: impl Into) { - problems.push(format!("{}:{}: {}", fp.to_string_lossy(), line, problem.into())) + problems.push(format!("{}:{}: {}", fp.to_string_lossy(), line+1, problem.into())) } #[cfg(test)] diff --git a/tests/lint_test.rs b/tests/lint_test.rs index 7f6b552..798151d 100644 --- a/tests/lint_test.rs +++ b/tests/lint_test.rs @@ -29,16 +29,16 @@ fn it_should_pass_for_incorrect_changelogs_that_has_no_critical_flaws() { assert_eq!( changelog.problems, vec![ - "tests/testdata/changelog_fail.md:10: PR link is not matching PR number 1948: 'https://github.com/evmos/evmos/pull/1949'", - "tests/testdata/changelog_fail.md:19: There should be no backslash in front of the # in the PR link", - "tests/testdata/changelog_fail.md:20: 'ABI' should be used instead of 'ABi'", - "tests/testdata/changelog_fail.md:24: PR description should end with a dot: 'Fixed the problem `gas_used` is 0'", - "tests/testdata/changelog_fail.md:26: 'Invalid Category' is not a valid change type", - "tests/testdata/changelog_fail.md:30: duplicate change type in release Unreleased: Bug Fixes", - "tests/testdata/changelog_fail.md:39: duplicate PR: #1801", - "tests/testdata/changelog_fail.md:41: duplicate release: v15.0.0", - "tests/testdata/changelog_fail.md:45: duplicate PR: #1862", - "tests/testdata/changelog_fail.md:46: invalid entry: - malformed entry in changelog", + "tests/testdata/changelog_fail.md:11: PR link is not matching PR number 1948: 'https://github.com/evmos/evmos/pull/1949'", + "tests/testdata/changelog_fail.md:20: There should be no backslash in front of the # in the PR link", + "tests/testdata/changelog_fail.md:21: 'ABI' should be used instead of 'ABi'", + "tests/testdata/changelog_fail.md:25: PR description should end with a dot: 'Fixed the problem `gas_used` is 0'", + "tests/testdata/changelog_fail.md:27: 'Invalid Category' is not a valid change type", + "tests/testdata/changelog_fail.md:31: duplicate change type in release Unreleased: Bug Fixes", + "tests/testdata/changelog_fail.md:40: duplicate PR: #1801", + "tests/testdata/changelog_fail.md:42: duplicate release: v15.0.0", + "tests/testdata/changelog_fail.md:46: duplicate PR: #1862", + "tests/testdata/changelog_fail.md:47: invalid entry: - malformed entry in changelog", ] ); }