From 31976fe2d70a8b6b7f8b31b9e0b3bc004d415575 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Thu, 30 May 2019 11:57:52 -0400 Subject: [PATCH] Add configuration for python code formatter black Black will look for pyproject.toml automatically. pyproject.toml is defined by PEP518 [1] Use skip-string-normalization for now [2]. Exclude results from swig, build directory of the python bindings and results of python input file (py.in). Include py.in files. [1] https://www.python.org/dev/peps/pep-0518/ [2] https://black.readthedocs.io/en/stable/the_black_code_style.html#strings Signed-off-by: Jonathan Rajotte Change-Id: I57adffcba9517dea05f10f9571671e75ac1a860f Reviewed-on: https://review.lttng.org/c/babeltrace/+/1355 Reviewed-by: Philippe Proulx --- pyproject.toml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..e413f22f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,17 @@ +[tool.black] + skip-string-normalization = true + include = ''' + ( + \.pyi?$ + | \.py\.in$ + ) + ''' + exclude = ''' + ( + bindings/python/bt2/build/ + | bindings/python/bt2/setup\.py$ + | bindings/python/bt2/bt2/native_bt\.py$ + | bindings/python/bt2/bt2/__init__\.py$ + + ) + ''' -- 2.34.1