From f6fc417fec19b94886249cc2598561f36ac2a73a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 22 Dec 2023 09:14:52 +0100 Subject: [PATCH] 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. --- pyproject.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 10d6faa3e5e..272f121450f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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