Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
Apache Arrow
Apache Arrow is a multi-language toolbox for accelerated data interchange and in-memory processing
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I just tried ruff last night and ran into the match-case support issue. I'm following https://github.com/charliermarsh/ruff/issues/282 and looking forward to trying ruff again once that issue is closed.
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/
I am pretty sure it used to be 2 spaces as well. Some public repositories such as https://github.com/tensorflow/tensorflow/tree/master/tensorf... appear to use 2 space indent throughout.
I think all these will be covered by the "be consistent" clause, and whoever made the first commit decides the style.