Black: skip string normalisation

Black (the Python formatter) shouldn't be used on Blender. However, it
is still the default formatter for some people's IDE (like mine). If
it's accidentally used, its default behaviour is to normalise strings so
they use double quotes.

This string normalisation can be tedious to recover from. This PR
configures Black so that it doesn't do that any more. This makes such a
mistake easier to recover.

An additional comment explains that Black shouldn't be used, and that
the configuration is there just to make it less annoying in case of
mistakes.

For the same reasons, this commit also includes the config option
`line_length = 120`. It just makes Black change less of our code when
it's accidentally used.
This commit is contained in:
Sybren A. Stüvel 2023-12-22 09:14:52 +01:00
parent c368a2c345
commit f6fc417fec
1 changed files with 7 additions and 0 deletions

View File

@ -48,3 +48,10 @@ exclude = """
# Omit settings such as `jobs`, `in_place` & `recursive` as they can cause editor utilities that auto-format on save
# to fail if the STDIN/STDOUT is used for formatting (which isn't compatible with these options).
# Black shouldn't be used as a formatter. But if it's accidentally
# used, it certainly shouldn't change all the quote marks around
# strings. This simply makes such a mistake easier to recover from.
[tool.black]
skip-string-normalization = true
line-length = 120