Add setup.cfg with sensible flake8 configuration
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 24 Sep 2019 16:01:28 +0000 (12:01 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 26 Sep 2019 01:52:28 +0000 (21:52 -0400)
This is a sensible config which allows to run "flake8 ." without having
too many useless warnings.

Note that the `per-file-ignores` config requires flake8 >= 3.7.

Ignore:

- E501, line too long, because we don't really care about that (black
  decides how it's formatted anyway).
- W503, line break before bbinary operator, because we don't really care
  about that (black decides how it's formatted anyway).

__init__.py contains some expectedly unused imports, so it seems cleaner
to disable that warning for the whole file, rather than putting a "noqa"
comment on each line.  Of course, we risk having a really unused import
in that file, but it doesn't contain much, so the risk is low.

Finally, exclude the Python tap directory, as it's not our code.

Change-Id: Iebdf274b91907fb31d4ebfa6ae4c8157de46467c
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2083
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
setup.cfg [new file with mode: 0644]

diff --git a/setup.cfg b/setup.cfg
new file mode 100644 (file)
index 0000000..9a58dd3
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,11 @@
+[flake8]
+# E501: line too long
+# W503: line break before binary operator (conflicts with black's way of
+#       formatting)
+ignore = E501,W503
+
+# __init__.py has a bunch of (expectedly) unused imports, so disable that
+# warning for this file.
+per-file-ignores = src/bindings/python/bt2/bt2/__init__.py:F401
+
+exclude = tests/utils/python/tap
This page took 0.026382 seconds and 4 git commands to generate.