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

Add setting to disable using semicolons to combine lines #121

Open
Archmonger opened this issue Feb 9, 2025 · 1 comment
Open

Add setting to disable using semicolons to combine lines #121

Archmonger opened this issue Feb 9, 2025 · 1 comment

Comments

@Archmonger
Copy link

While I know that merging lines via semicolons is an attractive way to save character space, this really should be a feature that can be turned off.

I'm currently running into issues getting python-minifier to play nice with the WASM-based pyodide interpreter due to their lack of support for semicolons.

But in my opinion, there should be enough configuration options within the minifier(...) API to where if I set every boolean to false, then zero minification should occur.

@dflook
Copy link
Owner

dflook commented Feb 10, 2025

python-minifier parses a Python code module and then serializes it back to valid Python code. When all options to minify() are False, the output remains functionally identical, though formatting may differ since python-minifier does not preserve the original source formatting.

Semicolons are a valid part of the Python language, so it's surprising that Pyodide does not support them—I would expect to find them in Python modules in the wild.

We could consider adding an option in the future to control semicolon usage, as there have been requests both to use them more frequently and to avoid them entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants