Skip to content

CI: use pymarkdownlnt - #1502

Open
mgovers wants to merge 12 commits into
pgm/feature/dependabot-on-specific-dayfrom
pgm/feature/pymarkdownlnt
Open

CI: use pymarkdownlnt#1502
mgovers wants to merge 12 commits into
pgm/feature/dependabot-on-specific-dayfrom
pgm/feature/pymarkdownlnt

Conversation

@mgovers

@mgovers mgovers commented Jul 28, 2026

Copy link
Copy Markdown
Member

In light of recent events, we are aiming to reduce our amount of dependencies - in particular the npm ones. That means we need to migrate to a markdown linter in the PyPI ecosystem.

Relates to #1499 and #1501 .

Important things to note:

  • wide tables and KaTeX need to be explicitly marked <!-- pyml disable line-length--> and <!-- pyml enable line-length-->.
    • There is NO way to do this inline yet.
    • It needs to be done at the block-level (no indentation), meaning you can only do a full disable and enable for that table/block...

@mgovers mgovers self-assigned this Jul 28, 2026
@mgovers mgovers added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file improvement Improvement on internal implementation do-not-merge This should not be merged github_actions Pull requests that update GitHub Actions code javascript Pull requests that update javascript code labels Jul 28, 2026
Comment thread .pre-commit-config.yaml.jinja
@mgovers
mgovers force-pushed the pgm/feature/pymarkdownlnt branch 2 times, most recently from b765f65 to 8435022 Compare July 28, 2026 13:49
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>

update workflows

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>

remove markdownlint-cli from devcontainer

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>

fix pre-commit

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>

more fixes

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>

more fixes

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>

homogenize

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>

fix pyproject.toml

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>

minor

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>

no run locked (scoped out of pr)

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>

fix ci

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>

scope out npm packages from refresher

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>

Refresh lock and linter dependencies

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

fix

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
@mgovers
mgovers force-pushed the pgm/feature/pymarkdownlnt branch from 048d6ba to 38a2b6a Compare July 28, 2026 14:19
Comment on lines +366 to +370
<!-- pyml disable commands-show-output-->
```powershell
$env:CMAKE_PREFIX_PATH = C:\conda_envs\cpp_pkgs\Library
```
<!-- pyml enable commands-show-output-->

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

some kind of weird false positive where a $ is interpreted as unix $, not as Windows $

@mgovers
mgovers marked this pull request as ready for review July 28, 2026 14:22
mgovers and others added 10 commits July 29, 2026 08:10
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…k-and-linter

Refresh lock and linter dependencies
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…k-and-linter

Refresh lock and linter dependencies
@mgovers mgovers changed the title Pgm/feature/pymarkdownlnt CI: use pymarkdownlnt Jul 29, 2026

@figueroa1395 figueroa1395 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Even though a "newer" tool, it seems to have a good number of downloads and be actively maintained. My only concern is that it seems like it's mainly maintained by one guy (cfr. github).

Other than that, I have no issue with it. In any case we can always switch or drop such a tool entirely.

Comment thread .pre-commit-config.yaml Outdated
Comment on lines +60 to +62
- name: Install npm packages
run: |
echo "Running markdownlint"
npx markdownlint --fix .
npm ci

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is to be removed altogether is the custom json formatter is accepted, right? It was just a bit weird to see these changes here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes indeed. This is just github diff that's messed up because this line was also at the start of this block but apparently it thinks i "removed" that line but i did not

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
@mgovers
mgovers force-pushed the pgm/feature/pymarkdownlnt branch from 56c0d4d to 5857ad6 Compare July 30, 2026 05:34
@sonarqubecloud

Copy link
Copy Markdown


2. If neither `p_sigma` nor `q_sigma` are provided, `power_sigma` represents the standard deviation of the apparent
power. In this case, infinite value of `power_sigma` disables the entire measurement.
<!-- pyml enable line-length-->

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Suggested change
<!-- pyml enable line-length-->

Comment thread pyproject.toml
Comment on lines +210 to +212
plugins.line-length.line_length = 120
plugins.line-length.heading_line_length = 120
plugins.line-length.code_block_line_length = 120

@mgovers mgovers Jul 30, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

TODO: check if we can disable line length on code blocks and tables. if not, then disable entirely

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

Labels

dependencies Pull requests that update a dependency file do-not-merge This should not be merged documentation Improvements or additions to documentation github_actions Pull requests that update GitHub Actions code improvement Improvement on internal implementation javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants