liftoff / pyminifier

Pyminifier is a Python code minifier, obfuscator, and compressor.
GNU General Public License v3.0
1.43k stars 221 forks source link

In any function if import some module next line it automatically add extra space #144

Open rakaseth opened 1 year ago

rakaseth commented 1 year ago

Hi team,

Using pyminifier to obfuscate the python code.But in any function if i have import statement it is by default adding one extra space in next coming line. Example:

def deploy_model(self, poll_timeout=300):
    from zenml.integrations.seldon.model_deployers.seldon_model_deployer import (
        SeldonModelDeployer as modelDeployer
    )
    model_deployer = cast(
        modelDeployer, modelDeployer.get_active_model_deployer()
    )

After obfuscate the code: def mWIJzelPyDpGMgsinKEUaSACrYBufoHQctwNkLxqhdVFbROvXT(mWIJzelPyDpGMgsinKEUaSACrYBufoHQctwNkLxqhdVFbRTOvj,poll_timeout=300): from zenml.integrations.seldon.model_deployers.seldon_model_deployer import(mWIJzelPyDpGMgsinKEUaSACrYBufoHQctwNkLxqhdVFbROjTX as modelDeployer) mWIJzelPyDpGMgsinKEUaSACrYBufoHQctwNkLxqhdVFbROjXT=modelDeployer.get_active_model_deployer

if we notice line start with 'from' and with 'mWIJ' has indentation issue.

i have ran command: pyminifier -O --replacement-length=50 --outfile filename.py filename.py