Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated markdown does not pass lint test #5

Closed
rcdailey opened this issue Mar 4, 2022 · 4 comments
Closed

Generated markdown does not pass lint test #5

rcdailey opened this issue Mar 4, 2022 · 4 comments

Comments

@rcdailey
Copy link

rcdailey commented Mar 4, 2022

There are some minor formatting issues with the generated markdown. Mainly has to do with insufficient newlines.

Tests were performed with the markdownlint extension installed in VS Code. I also edit my CHANGELOG.md file in VS Code.

Steps to reproduce

  1. Open your MARKDOWN.md file in VS Code.
  2. Put your caret after the [Unreleased] header, as shown in FIGURE1 (at the bottom of this issue).
  3. Type c, then CTRL+SPACE (to auto-complete) and select cl-added. Press ENTER.

The generated markdown (FIGURE2 below) has several markdown lint violations of type MD022/blanks-around-headings/blanks-around-headers:

Headings should be surrounded by blank lines

Expected Output

The markdown (based on FIGURE2) that is expected is below:

## [Unreleased]

### Added

-

### Changed

- Unrecognized or unwanted YAML properties in configuration YAML (`trash.yml`) now result in an
  error. This is to help users more easily identify mistakes.

Specifically:

  • A blank line between ## [Unreleased] and ### Added
  • A blank line between ### Added and - (the first bullet point item in the list of added items)
  • A blank line between the - and the next section header, which is ### Changed in my case.

Supporting Attachments

FIGURE1:

image

FIGURE2:

image

@rlnt
Copy link
Owner

rlnt commented Mar 5, 2022

This extension provides snippets that respect the ruleset of Keep a Changelog and does not take any linter into account.
As you can see on their page, they also don't have newlines at the positions you mentioned.

If you scroll down to their QnA and read the Is there a standard changelog format?, you will see that they didn't create it with a special format in mind.
This issue is out of scope since the extension does exactly what it is advertised to do.

The only thing I could do is to add an extension option to add newlines around headers but that won't be enabled by default.
If that's not an option for you, I'm sorry but I won't change anything else.

@rcdailey
Copy link
Author

rcdailey commented Mar 5, 2022

If they didn't create it with a special format in mind, that means there should be no issue with you altering the whitespace in the template, right?

A setting would be great if that's all you're willing to do. At the end of the day, my changelog is a markdown file like any other. The keep a changelog guidelines are not violated when manipulating whitespace, IMHO. The rationale listed for this markdown rule also makes this somewhat a functional issue as well:

Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will not parse headers that don't have a blank line before, and will parse them as regular text.

Thanks for the quick response!

@rcdailey
Copy link
Author

rcdailey commented Mar 5, 2022

Looking at the code, would it be reasonable to just have the snippets themselves in settings so folks can edit them however they want?

@rlnt
Copy link
Owner

rlnt commented Mar 5, 2022

I am not planning to do that. I'm just not having so much time on my hands right now.
If you want to have something like this, feel free to fork the project and compile your own version of it. It's LGPL-licensed and you can create your own extension.

Edit: implemented as default behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants