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.
-
ipython
Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.
-
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.
Shameless plug: For people who like black, I've been working on ssort[0], a python source code sorter that will organize python statements into topological order based on their dependencies. It aims to resolve a similar source of bikeshedding and back and forth commits.
0: https://github.com/bwhmather/ssort
We use isort[0] for this. It even has a "black" compatible profile that line spits along black's defaults. Additionally we use autoflake[1] to remove unused import statements in place.
[0](https://github.com/PyCQA/isort)
[1](https://github.com/PyCQA/autoflake)
The etymology of black is "any color you like, as long as it's black" [0]. The whole point is that it's _not_ configurable.
[0] https://github.com/psf/black#readme
A little shoutout to a alternative Python formating tool https://github.com/google/yapf (developed by Google).
The built in "facebook style" formating felt by far the most natural to me.
Here’s a script that automates the once-per-repository local setup of this feature:
https://github.com/ipython/ipython/pull/12091/files
Unfortunately there isn’t support for it in GitHub or GitLab yet, but there’s at least a GitLab issue here requesting it:
We use isort[0] for this. It even has a "black" compatible profile that line spits along black's defaults. Additionally we use autoflake[1] to remove unused import statements in place.
[0](https://github.com/PyCQA/isort)
[1](https://github.com/PyCQA/autoflake)
Give µsort a try instead; it's focused on providing more safety when applying sorting to large codebases, and is designed to pair well with black out of the box:
https://usort.readthedocs.io
https://ufmt.omnilib.dev
Related posts
- nbdev formating and linting
- I wrote a script to periodically change my Desktop background to live satellite images!
- Python Code Quality - Improve the quality of your Python code with linters, code formatters, and security vulnerability scanners
- Code Quality Tools in Python
- Automate Clean Code and Linting in Python