Skip to content

Conversation

@webknjaz
Copy link
Member

This is meant to ensure consistency in our Markdown content source.

Ref: https://pymarkdown.rtfd.io

Contributor checklist
  • Included tests for the changes.
  • A change note is created in changelog.d/ (see changelog.d/README.md for instructions) or the PR text says "no changelog needed".
Maintainer checklist
  • If no changelog is needed, apply the skip-changelog label.
  • Assign the PR to an existing or new milestone for the target version (following Semantic Versioning).

@webknjaz webknjaz added this to the later milestone Oct 30, 2025
@webknjaz webknjaz requested review from Copilot and sirosen October 30, 2025 14:40
@webknjaz webknjaz self-assigned this Oct 30, 2025
@webknjaz webknjaz added tests Testing and related things maintenance Related to maintenance processes ci Related to continuous integration tasks labels Oct 30, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds PyMarkdown as a pre-commit hook to the repository for Markdown linting. This will help maintain consistent Markdown formatting and quality across documentation files.

  • Added PyMarkdown pre-commit hook configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sirosen
Copy link
Member

sirosen commented Nov 3, 2025

👍 for the idea of adding this hook -- I didn't know about this tool until today! -- but it looks like we have a number of fixes we need to apply for it to run cleanly.

Some of these are easy and I'm happy to help apply (e.g., max line length) but some appear to be inappropriate lints for the specific files (e.g., MD041 on the changelog dir). How do we want to manage the configuration for this tool such that it's differentiated by file? I'm trying to read the pymarkdown docs but it's not very clear to me what the best approach would be.

@webknjaz
Copy link
Member Author

webknjaz commented Nov 3, 2025

👍 for the idea of adding this hook -- I didn't know about this tool until today! -- but it looks like we have a number of fixes we need to apply for it to run cleanly.

Yep. I learned about it from a dep bump in ansible-core's test tooling and thought I'd try it locally. But since it produced a bunch of violations, I just made a commit and made the PR draft so that it's out in the open and isn't forgotten on my machine.

Some of these are easy and I'm happy to help apply (e.g., max line length) but some appear to be inappropriate lints for the specific files (e.g., MD041 on the changelog dir). How do we want to manage the configuration for this tool such that it's differentiated by file? I'm trying to read the pymarkdown docs but it's not very clear to me what the best approach would be.

I haven't gotten that far but I'd maybe have two entries in the pre-commit config and include/exclude files on that level if there's no native way to solve this.

@webknjaz
Copy link
Member Author

webknjaz commented Nov 3, 2025

There's some mentions of selective document set rules @ https://pymarkdown.rtfd.io/en/latest/advanced_configuration/#general-plugin-settings but I'd need to read more for specific examples.

@webknjaz
Copy link
Member Author

@sirosen I fixed a bunch of straightforward violations, need to start looking into suppressions.

its configuration to provision it with [tox devenv].
- Always provide tests for your changes and run `tox -p all` to make sure they
are passing the checks locally.
- Give a clear one-line description in the PR (that the maintainers can add to
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CONTRIBUTING.md Outdated
version about to be released.
- Create a branch for the release. _Ex: release-3.4.0_.
- Update the [CHANGELOG] with the version, date and add the text from [drafter release](https://github.com/jazzband/pip-tools/releases).
- Update the [CHANGELOG] with the version, date and add the text from [drafter
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CONTRIBUTING.md Outdated
- The pip-tools "lead" project members will receive an email notification to review the release and
deploy it to the public PyPI if all is correct.
- Once ready, go to [releases](https://github.com/jazzband/pip-tools/releases)
page and publish the latest draft release. This will push a tag on the HEAD
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@webknjaz
Copy link
Member Author

webknjaz commented Nov 26, 2025

So apparently, this linter has two docs folders and the one published to RTD doesn't have any mentions of the default config file name. But I've scanned the repo and found that it actually supports a .pymarkdown.yml since jackdewinter/pymarkdown#748: https://github.com/jackdewinter/pymarkdown/blob/main/docs/advanced_configuration.md#default-configuration-files

@@ -0,0 +1,5 @@
---

{}
Copy link
Member Author

@webknjaz webknjaz Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be replaced once upstream supports disabling rules per-file: jackdewinter/pymarkdown#1511.

@webknjaz
Copy link
Member Author

I filed an upstream feature request to unblock us: jackdewinter/pymarkdown#1511.

@webknjaz
Copy link
Member Author

webknjaz commented Dec 1, 2025

So apparently, this linter has two docs folders and the one published to RTD doesn't have any mentions of the default config file name. But I've scanned the repo and found that it actually supports a .pymarkdown.yml since jackdewinter/pymarkdown#748: https://github.com/jackdewinter/pymarkdown/blob/main/docs/advanced_configuration.md#default-configuration-files

Turns out, there's a mention in some addition docs site: https://application-properties.rtfd.io/en/latest/file-types/#default-configuration-files (linked from https://pymarkdown.rtfd.io/en/latest/advanced_pre-commit/#specifying-a-configuration-file).

@webknjaz
Copy link
Member Author

webknjaz commented Dec 1, 2025

Their dogfooding just runs the linter multiple times against different sets of files: https://github.com/jackdewinter/pymarkdown/blob/5d2572d026ff4db21d92d196fd4b69ab7b23fdb5/.pre-commit-config.yaml#L139-L162.

Since the upstream is still unresponsive, I think I'll implement that as a workaround.

@webknjaz
Copy link
Member Author

webknjaz commented Dec 1, 2025

@sirosen no-emphasis-as-heading is triggered by dates we have in italics. I wonder if wrapping them with <time> would solve this... Doing this causes a no-inline-html. We'll need to decide what to do with that.

@webknjaz webknjaz marked this pull request as ready for review December 1, 2025 04:10
@webknjaz webknjaz requested a review from a team as a code owner December 1, 2025 04:10
@webknjaz webknjaz enabled auto-merge December 1, 2025 04:13
@webknjaz
Copy link
Member Author

webknjaz commented Dec 1, 2025

@sirosen I think this now has all the minimum changes needed to get it merged in.

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

Labels

bot:chronographer:provided ci Related to continuous integration tasks maintenance Related to maintenance processes tests Testing and related things

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants