You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
context
When I format files, I get output lines that sometimes start with "Failed", sometimes "Warning:", and sometimes "error:". It can be a bit confusing.
expectation
I would expect all warnings to start with "warning:", and errors associated to these warnings be appended at the end of the warnings, since these errors do not cause the program to stop (also see #434).
bug
I'm actually not sure which lines come from plugin, from core, or why they differ.
Example:
% make formatWarning: 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.mdFailed formatting content of a yaml code block (line 177 before formatting). Filename: /media/data/dev/website/docs/posts/save-pytest-logs-as-artifact-gitlab-ci.mderror: Failed to parse at 1:1: Unexpected token IndentWarning: Failed formatting content of a python code block (line 276 before formatting). Filename: /media/data/dev/website/docs/posts/unify-logging-for-a-gunicorn-uvicorn-app.mderror: Failed to parse at 1:1: Unexpected token IndentWarning: Failed formatting content of a python code block (line 306 before formatting). Filename: /media/data/dev/website/docs/posts/unify-logging-for-a-gunicorn-uvicorn-app.mderror: Failed to parse at 1:1: Unexpected token IndentWarning: Failed formatting content of a python code block (line 319 before formatting). Filename: /media/data/dev/website/docs/posts/unify-logging-for-a-gunicorn-uvicorn-app.mderror: Failed to parse at 1:1: Unexpected token IndentFailed formatting content of a python code block (line 248 before formatting). Filename: /media/data/dev/website/docs/posts/unify-logging-for-a-gunicorn-uvicorn-app.mderror: Failed to parse at 1:1: Unexpected token IndentFailed formatting content of a python code block (line 272 before formatting). Filename: /media/data/dev/website/docs/posts/unify-logging-for-a-gunicorn-uvicorn-app.mderror: Failed to parse at 1:1: Unexpected token IndentFailed formatting content of a python code block (line 282 before formatting). Filename: /media/data/dev/website/docs/posts/unify-logging-for-a-gunicorn-uvicorn-app.mderror: Failed to parse at 4:6: Unexpected token '%'Warning: Failed formatting content of a python code block (line 276 before formatting). Filename: /media/data/dev/website/docs/posts/how-to-deal-with-jinja2-spacing.mderror: Failed to parse at 6:6: Unexpected token '%'Warning: Failed formatting content of a python code block (line 292 before formatting). Filename: /media/data/dev/website/docs/posts/how-to-deal-with-jinja2-spacing.mderror: Failed to parse at 4:6: Unexpected token '%'Failed formatting content of a python code block (line 269 before formatting). Filename: /media/data/dev/website/docs/posts/how-to-deal-with-jinja2-spacing.mderror: Failed to parse at 6:6: Unexpected token '%'Failed formatting content of a python code block (line 285 before formatting). Filename: /media/data/dev/website/docs/posts/how-to-deal-with-jinja2-spacing.mdWarning: Failed formatting content of a toml code block (line 157 before formatting). Filename: /media/data/dev/website/docs/posts/docker-compose-django-postgres-nginx.mdWarning: Failed formatting content of a toml code block (line 383 before formatting). Filename: /media/data/dev/website/docs/posts/docker-compose-django-postgres-nginx.mdFailed formatting content of a toml code block (line 124 before formatting). Filename: /media/data/dev/website/docs/posts/docker-compose-django-postgres-nginx.mdFailed formatting content of a toml code block (line 329 before formatting). Filename: /media/data/dev/website/docs/posts/docker-compose-django-postgres-nginx.mderror: Failed to parse at 1:1: Unexpected token IndentFailed formatting content of a python code block (line 151 before formatting). Filename: /media/data/dev/website/docs/posts/adding-links-to-formatted-and-syntax-highlighted-code.mderror: Failed to parse at 4:5: Unexpected token 'entry_points'Warning: Failed formatting content of a python code block (line 42 before formatting). Filename: /media/data/dev/website/docs/posts/write-and-use-a-tox-plugin-from-inside-your-package.mderror: Failed to parse at 4:5: Unexpected token 'entry_points'Failed formatting content of a python code block (line 39 before formatting). Filename: /media/data/dev/website/docs/posts/write-and-use-a-tox-plugin-from-inside-your-package.mdWarning: Failed formatting content of a yaml code block (line 124 before formatting). Filename: /media/data/dev/website/docs/posts/add-alembic-migrations-to-existing-fastapi-ormar-project.mdFailed formatting content of a yaml code block (line 126 before formatting). Filename: /media/data/dev/website/docs/posts/add-alembic-migrations-to-existing-fastapi-ormar-project.md
problem
I think we could gain at standardizing error messages a bit 🙂
Typically, adding the plugin name would make it clear to which repository/project we should report an issue when something doesn't work as expected.
Yes, there should be lots of room for improvement here.
One issue is plugins that invoke a code formatter in a subprocess. I think they should pretty much always send the subprocess's stderr to subprocess.DEVNULL as is done here, to not mix it up with mdformat's stderr, but I don't think there's any way mdformat can (or should) enforce that.
Even if it's not enforced, it shouldn't be hard to convince plugin authors to update their code (or to send PRs, which I could do too) if there's documentation that goes in this direction.
Describe the bug
context
When I format files, I get output lines that sometimes start with "Failed", sometimes "Warning:", and sometimes "error:". It can be a bit confusing.
expectation
I would expect all warnings to start with "warning:", and errors associated to these warnings be appended at the end of the warnings, since these errors do not cause the program to stop (also see #434).
bug
I'm actually not sure which lines come from plugin, from core, or why they differ.
Example:
problem
I think we could gain at standardizing error messages a bit 🙂
Typically, adding the plugin name would make it clear to which repository/project we should report an issue when something doesn't work as expected.
Reproduce the bug
List your environment
The text was updated successfully, but these errors were encountered: