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

bug: MD022 for whitespace around pyml comments #1268

Closed
9 of 13 tasks
cpswan opened this issue Nov 22, 2024 · 2 comments
Closed
9 of 13 tasks

bug: MD022 for whitespace around pyml comments #1268

cpswan opened this issue Nov 22, 2024 · 2 comments

Comments

@cpswan
Copy link

cpswan commented Nov 22, 2024

Prerequisites

  • Are you running the latest version of this application?
  • Have you checked the Frequently Asked Questions document?
  • Have you simplified the bug report to the essential details?
    • Do you have a distinct command line to report?
    • Can you clearly state the configuration for this bug report?
    • Do you have a minimal document that highlights this bug?
    • Are any required files (configuration or Markdown document) attached to the issue?
  • Did you perform a cursory search of other issues to look for related issues?

Bug Report

Opening a separate issue as requested by @jackdewinter at #1208 (comment)

Bug Type

  • Assertion Failure
  • Documentation
  • Scan/Rule not working as expected
  • Fix/Rule not working as expected
  • Other

Description

A pyml comment isn't recognised as a not empty line for the purpose of MD022. Instead the comment line isn't counted, and so any empty line after it is seen as an additional contiguous empty line.

So a fragment like:

## My header

<!-- pyml disable-num-lines 3 md011,md013-->

Some long lines

Lead to: MD022: Headings should be surrounded by blank lines. [Expected: 1; Actual: 2; Below] (blanks-around-headings,blanks-around-headers)

Specifics

What operating system and version are you running into this behavior on?

Ubuntu 24.04.1

What version are you seeing this behavior in? (Run pip list or pipenv run pip list and look for the entry beside pymarkdownlnt.)

0.9.25

Are there any extra steps that need to be taken before executing the application?

No

What is the command line you invoke to get this behavior?

paymarkdown scan filename.md

Are you using a configuration file? Either on the command line or one of the implicit configuration files? If so, attach that file to this issue.

No

What Markdown document causes this behavior to manifest? Attach that file to this issue.

# My header

<!-- pyml disable-num-lines 3 md011,md013-->

Some long lines

Actual Behavior

filename.md:1:1: MD022: Headings should be surrounded by blank lines. [Expected: 1; Actual: 2; Below] (blanks-around-headings,blanks-around-headers)

Expected Behavior

Clean scan

@jackdewinter
Copy link
Owner

this should be fixed in last nights release. can you confirm?

@cpswan
Copy link
Author

cpswan commented Dec 11, 2024

Thanks @jackdewinter I'm happy to confirm that things are now working ask expected with 0.9.26 :)

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