Hacker News new | past | comments | ask | show | jobs | submit login

To those that wish to automate a subset of these conventions, there is a tool called Sourcery[1] that I, personally, am a huge fan of! Not only does it have a large set of default rules[2], but it can also allow you to write your own rules that may be specific to your team or organization, and as mentioned it can enable you to follow Google's Python style guide as well[3].

There are some refactorings that Sourcery suggest that I don't agree with myself, namely the usage of 'contextlib.suppress'[4] as I don't like to introduce an additional 'import' statement just to do something so trivial. I wish Sourcery would add the relevance of having possibly too many 'import' statements as a heuristic.

---

[1]: https://sourcery.ai/

[2]: https://docs.sourcery.ai/Reference/Default-Rules/ (expand the sub-pages)

[3]: https://docs.sourcery.ai/Reference/Optional-Rules/gpsg/

[4]: https://docs.sourcery.ai/Reference/Default-Rules/refactoring...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: