mdformat icon indicating copy to clipboard operation
mdformat copied to clipboard

Format output as filename:lineno: message

Open pawamoy opened this issue 1 year ago • 0 comments

Context

Consoles within IDEs (or even in regular shell sessions) very often support the syntax filename:lineno: and allow clicking on such strings to open the corresponding file, at the corresponding line number, in the current IDE or in the preferred editor.

I understand that line numbers might not be correct after modification of Markdown files, but they're at least probably very close to the right ones.

Proposal

I suggest changing the output format from

Warning: Failed formatting content of a yaml code block (line 214 before formatting). Filename: /media/data/dev/website/docs/posts/save-pytest-logs-as-artifact-gitlab-ci.md

to

/media/data/dev/website/docs/posts/save-pytest-logs-as-artifact-gitlab-ci.md:214: warning: Failed formatting content of a yaml code block

Maybe even use a relative path if possible:

docs/posts/save-pytest-logs-as-artifact-gitlab-ci.md:214: warning: Failed formatting content of a yaml code block

Maybe also concatenate the additional information at the end of the message, so instead of two lines:

docs/posts/save-pytest-logs-as-artifact-gitlab-ci.md:214: warning: Failed formatting content of a yaml code block
error: Failed to parse at 1:1: Unexpected token Indent

...concatenate as one:

docs/posts/save-pytest-logs-as-artifact-gitlab-ci.md:214: warning: Failed formatting content of a yaml code block: Failed to parse at 1:1: Unexpected token Indent

...though I'm not familiar with all the possible error messages so it might not make sense.

Tasks and updates

No response

pawamoy avatar Apr 14 '24 17:04 pawamoy