JustAnotherArchivist / snscrape

A social networking service scraper in Python
GNU General Public License v3.0
4.31k stars 698 forks source link

Code style / autoformat #958

Open novucs opened 1 year ago

novucs commented 1 year ago

This project is awesome and has saved me a lot of time! I've raised a few PRs on this repo now but it's been a little tricky for me to adapt my interpreter settings in a way that does not conflict with your own. Is there a specific code style you're following / do you have any autoformatter settings available (I'm using PyCharm)? I've seen typically on Python OSS projects Black has gotten pretty popular to avoid stepping on each others toes.

TheTechRobo commented 1 year ago

This issue I previously opened should clear up the naming convention: #517

JustAnotherArchivist commented 1 year ago

There isn't. I dislike black for its uncompromising stance of basically not tolerating anything that doesn't exactly follow PEP8. I tried to make it behave one time but gave up pretty soon. Other similar tools at the time weren't any better, but maybe that changed.

Best I can say at the moment is to just follow what's already in use. What comes to mind right now where I deviate from PEP8: tabs for indentation, spaces for alignment; single quotes for strings; no from imports, ever; naming convention as linked above; no real line length limit (as long as it fits on a regular screen and doesn't become unreadable).