diff --git a/changelogs/fragments/188-rstcheck.yml b/changelogs/fragments/188-rstcheck.yml new file mode 100644 index 00000000..2604328f --- /dev/null +++ b/changelogs/fragments/188-rstcheck.yml @@ -0,0 +1,2 @@ +bugfixes: + - "When linting found RST problems with rstcheck, the error messages were reduced to a single letter (https://github.com/ansible-community/antsibull-changelog/pull/188)." diff --git a/src/antsibull_changelog/fragment.py b/src/antsibull_changelog/fragment.py index 727f5a17..7923039e 100644 --- a/src/antsibull_changelog/fragment.py +++ b/src/antsibull_changelog/fragment.py @@ -374,12 +374,12 @@ def _lint_lines( results = ChangelogFragmentLinter._check_content( line, fragment.fragment_format, fragment.path ) - errors += [(fragment.path, 0, 0, result[2]) for result in results] + errors += [(fragment.path, 0, 0, result) for result in results] elif isinstance(lines, str): results = ChangelogFragmentLinter._check_content( lines, fragment.fragment_format, fragment.path ) - errors += [(fragment.path, 0, 0, result[2]) for result in results] + errors += [(fragment.path, 0, 0, result) for result in results] def lint(self, fragment: ChangelogFragment) -> list[tuple[str, int, int, str]]: """ diff --git a/tests/functional/test_changelog_basic_lint.py b/tests/functional/test_changelog_basic_lint.py index 8b5efcdd..087febb7 100644 --- a/tests/functional/test_changelog_basic_lint.py +++ b/tests/functional/test_changelog_basic_lint.py @@ -91,6 +91,7 @@ def test_changelog_fragment_lint_broken( # pylint: disable=redefined-outer-name ], }, ) + collection_changelog.add_fragment_line("bad-rst.yml", "bugfixes", ["This is *foo"]) # Lint fragments rc, stdout, stderr = collection_changelog.run_tool_w_output("lint", []) @@ -98,6 +99,7 @@ def test_changelog_fragment_lint_broken( # pylint: disable=redefined-outer-name assert ( stdout == r""" +changelogs/fragments/bad-rst.yml:0:0: (WARNING/2) Inline emphasis start-string without end-string. changelogs/fragments/int-instead-of-list.yml:0:0: section "bugfixes" must be type list not int changelogs/fragments/int-instead-of-string.yml:0:0: section "release_summary" must be type str not int changelogs/fragments/invalid-add-obj.yaml:0:0: section "add moo.role"'s name must be of format "add (object|plugin).(type)"