Skip to content

Commit

Permalink
Longer excerpt from Łukasz's article, with intro
Browse files Browse the repository at this point in the history
  • Loading branch information
akaihola committed Mar 30, 2022
1 parent d8ac712 commit fe3300e
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,25 @@ __ https://github.com/psf/black/issues/1352
But for the time being, this is where ``darker`` enters the stage.
This tool is for those who want to do partial formatting right now.

> "When you make this single reformatting commit, everything that comes after is semantic changes so your commit history is clean ...
However, by doing that you forever expose yourself to commits that are a mix of semantic changes with stylistic changes."
> <cite>[Łukasz Langa](https://lukasz.langa.pl/)</cite> - creator of Black, [article](https://lukasz.langa.pl/36380f86-6d28-4a55-962e-91c2c959db7a/)

Note that this tool is meant for special situations
when dealing with existing code bases.
You should just use Black_ and isort_ as is when starting a project from scratch.

You may also want to still consider whether reformatting the whole code base in one
commit would make sense in your particular case. For a deeper dive into this topic, see
the article `Why does Black insist on reformatting my entire project?`_ from
`Łukasz Langa`_, the creator of Black_. Here's an excerpt:

"When you make this single reformatting commit, everything that comes after is
**semantic changes** so your commit history is clean in the sense that it actually
shows what changed in terms of meaning, not style. There are tools like darker that
allow you to only reformat lines that were touched since the last commit. However,
by doing that you forever expose yourself to commits that are a mix of semantic
changes with stylistic changes, making it much harder to see what changed."

.. _Why does Black insist on reformatting my entire project?: https://lukasz.langa.pl/36380f86-6d28-4a55-962e-91c2c959db7a/
.. _Łukasz Langa: https://lukasz.langa.pl/

How?
====

Expand Down

0 comments on commit fe3300e

Please sign in to comment.