news.volyx.in

Black, the uncompromising Python code formatter, is stable (pypi.org)

500 points by crlees · 1692 days ago · 288 comments on HN

Article summary

Black, a Python code formatter, has reached a stable version. It is an uncompromising formatter that enforces a consistent style, making code review faster and freeing developers from worrying about formatting. Black is already used by many notable projects and organizations. Its stability policy ensures that style changes will be minimal and mostly in response to bug reports or new Python syntax.

Main themes

  • Black code formatter
  • PEP 8 compliance
  • Tabs vs spaces
  • Code consistency
  • Opinionated formatting
  • Python ecosystem
  • Configuration options
  • Stability policy

What commenters say

  • The lack of support for tabs in Black is a significant issue for some developers who prefer or need to use them.
  • Enforcing a consistent style, such as using spaces instead of tabs, is beneficial for the Python ecosystem.
  • The addition of options for personal preferences, such as tab support, would undermine the purpose of an opinionated formatter like Black.
  • Some developers appreciate the consistency and simplicity that Black provides, and do not want to see it compromised by adding more configuration options.
  • The decision to follow PEP 8 and not support tabs is seen as reasonable by some, as it promotes consistency within the Python community.
  • Others argue that PEP 8's preference for spaces over tabs is not absolute, and that Black should allow for more flexibility in this regard.
  • The use of Black has improved code quality and reduced formatting debates, but some developers still have issues with its strict adherence to certain styles.
  • A fork of Black that adds tab support has been created, which some see as a viable solution for those who need it.