How to setup Black and pre-commit in python for auto text-formatting on commit

This page summarizes the projects mentioned and recommended in the original post on dev.to

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.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • pre-commit

    A framework for managing and maintaining multi-language pre-commit hooks.

  • Today we are going to look at how to setup Black (a python code formatter) and pre-commit (a package for handling git hooks in python) to automatically format you code on commit.

  • black-pre-commit-example-setup

    Example repo for article showing how to setup Black and pre-commit for text-formatting in python

  • All the Code used in this article can be found on this GitHub repo here

  • 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.

    InfluxDB logo
  • black

    The uncompromising Python code formatter

  • $ git commit -m "add pre-commit configuration" [INFO] Initializing environment for https://github.com/psf/black. [INFO] Installing environment for https://github.com/psf/black. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... black................................................(no files to check)Skipped [main 6e21eab] add pre-commit configuration 1 file changed, 7 insertions(+)

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Packaging Python projects in 2023 from scratch

    2 projects | /r/Python | 6 Sep 2023
  • Securing CDK pipelines in an enterprise organization

    2 projects | dev.to | 10 Oct 2022
  • Should I follow the warnings in Pycharm? Does anyone do this?

    6 projects | /r/learnpython | 18 Jul 2022
  • Didn't get the job, code review please

    4 projects | /r/django | 12 May 2022
  • Keep code style out of code reviews

    2 projects | /r/Python | 2 Aug 2021