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

Proposal: --write-to-stdout-on-ast-error #467

Closed
KyleKing opened this issue Oct 30, 2024 · 3 comments
Closed

Proposal: --write-to-stdout-on-ast-error #467

KyleKing opened this issue Oct 30, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@KyleKing
Copy link
Collaborator

KyleKing commented Oct 30, 2024

Context

When debugging issues, it would be helpful if users could just write the incorrect changes anyway. This way, when someone sees the message from #463, they can post the incorrect changes to help maintainers replicate and debug the issue. Adding a workaround like this to a local fork of mdformat has been part of my workflow in the past

Proposal

When there is an ast error detected and the CLI argument is provided, mdformat could write to STDOUT

                if opts["write_to_stdout_on_ast_error"]:
                    sys.stdout.buffer.write(formatted_str.encode())
                print_error(
                    f'Could not format "{path_str}".',
                    ...
@KyleKing KyleKing added the enhancement New feature or request label Oct 30, 2024
@hukkin
Copy link
Member

hukkin commented Oct 30, 2024

Thanks for the issue! Would #50 work here?

@KyleKing
Copy link
Collaborator Author

Yeah, I like either --unsafe or --skip-validation

@hukkin
Copy link
Member

hukkin commented Oct 30, 2024

👍 closing this in favor of #50 then

@hukkin hukkin closed this as completed Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants