nkmathew / yasi-sexp-indenter

A dialect-aware s-expression indenter written in Python and newLISP
MIT License
6 stars 5 forks source link

Parallelize flag to increase performance when multiple files provided #3

Open amir-bio opened 4 years ago

amir-bio commented 4 years ago

Hi, thank you for your great work! This has been quite useful to me. I'm incorporating as part of a git hook and ideally would like the hook to be as fast as possible.

I haven't taken a close look at the code yet but I don't think there's an option for running the formating in parallel for every file provided.

I think something like --parallel {n} where n is the number of parallel files to do at a time, where if either a special character is provided or no value is provided at all, the maximum/all the files are processed in parallel.

What are your thoughts on this? And may I ask if you're happy for merging a PR?

Thank you again!

nkmathew commented 4 years ago

Oops, didn't see this notification. Sure if you can do it I'm open to suggestions

nkmathew commented 4 years ago

Thanks for the contribution Amir, v2.1.1 is now on PyPI with your changes

amir-bio commented 4 years ago

Thank you for the new release @nkmathew !

One small issue I've come across, I'm getting an error when trying to upgrade.

` cwd: /private/var/folders/mw/8b3jstss2bz6wc0pdxgm61h40000gn/T/pip-install-ei8fia5g/yasi/ Complete output (5 lines): Traceback (most recent call last): File "", line 1, in File "/private/var/folders/mw/8b3jstss2bz6wc0pdxgm61h40000gn/T/pip-install-ei8fia5g/yasi/setup.py", line 12, in with io.open('README.md') as f: FileNotFoundError: [Errno 2] No such file or directory: 'README.md'

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.`

Looking inside the zipped file for pypi, looks like only a README.rst is preset, README.md is not included yet.

nkmathew commented 4 years ago

Was this through pip install -U yasi?

I changed it to get the pypi package description from the markdown README directly instead of me having to do conversions. I think it'll work if you uninstall it then install it again. Bit of an ugly solution

nkmathew commented 4 years ago

Yep this is a real issue. Uninstalling it won't work either. make install does though. I'll look into it

nkmathew commented 4 years ago

So PyPI doesn't allow reusing an already uploaded version meaning yet another version bump without actual change in the code. The pip upgrade should now skip v2.1.1 and install v2.1.2 successfully. Please confirm

amir-bio commented 4 years ago

It seems to be working (though I did do make install with the previous version) Thank you @nkmathew !