From 28e4eb4ea3e23377b2cb8c1e11ea576d0d6c74dd Mon Sep 17 00:00:00 2001 From: TW Date: Sat, 3 Jun 2017 15:13:21 +0200 Subject: [PATCH] add a .coafile for coala (#2592) add support for using coala, fixes #1366 ignores / disable are set up so that there are not many faults. we can improve that iteratively. --- .coafile | 38 ++++++++++++++++++++++++++++++++++++++ docs/development.rst | 15 +++++++++++++++ requirements.d/coala.txt | 4 ++++ 3 files changed, 57 insertions(+) create mode 100644 .coafile create mode 100644 requirements.d/coala.txt diff --git a/.coafile b/.coafile new file mode 100644 index 000000000..394949648 --- /dev/null +++ b/.coafile @@ -0,0 +1,38 @@ +[all] +# note: put developer specific settings into ~/.coarc (e.g. editor = ...) +max_line_length = 255 +use_spaces = True + +[all.general] +files = src/borg/**/*.(py|pyx|c) +ignore = src/borg/(compress.c|hashindex.c|item.c), + src/borg/algorithms/(chunker.c|checksums.c|crc32.c), + src/borg/algorithms/blake2/*, + src/borg/algorithms/xxh64/*, + src/borg/crypto/low_level.c, + src/borg/platform/*.c +bears = SpaceConsistencyBear, FilenameBear, InvalidLinkBear, LineLengthBear +file_naming_convention = snake + + +[all.python] +files = src/borg/**/*.py +bears = PEP8Bear, PyDocStyleBear, PyLintBear +pep_ignore = E122,E123,E125,E126,E127,E128,E226,E301,E309,E402,F401,F405,F811,W690 +pylint_disable = C0103, C0111, C0112, C0301, C0302, C0325, C0330, C0411, C0412, C0413, + W0102, W0104, W0106, W0108, W0120, W0201, W0212, W0221, W0231, W0401, W0404, + W0511, W0603, W0611, W0612, W0613, W0614, W0621, W0622, W0702, W0703, + W1201, W1202, W1401, W1503, W1505, + R0101, R0201, R0204, R0902, R0903, R0904, R0911, R0912, R0913, R0914, R0915, R0916, + E0102, E0202, E0211, E0401, E0611, E0702, E1101, E1102, E1120, E1133 +pydocstyle_ignore = D100, D101, D102, D103, D104, D105, D200, D201, D202, D203, D204, D205, D209, D210, + D212, D213, D300, D301, D400, D401, D402, D403, D404 + +[all.c] +files = src/borg/**/*.c +bears = CPPCheckBear + +[all.html] +files = src/borg/**/*.html +bears = HTMLLintBear +htmllint_ignore = * diff --git a/docs/development.rst b/docs/development.rst index 7d4c0774d..6156be36d 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -195,6 +195,21 @@ Important notes: - When using ``--`` to give options to py.test, you MUST also give ``borg.testsuite[.module]``. +Running more checks using coala +------------------------------- + +First install coala and some checkers ("bears"): + + pip install -r requirements.d/coala.txt + +You can now run coala from the toplevel directory; it will read its settings +from ``.coafile`` there: + + coala + +Some bears have additional requirements and they usually tell you about +them in case they are missing. + Documentation ------------- diff --git a/requirements.d/coala.txt b/requirements.d/coala.txt new file mode 100644 index 000000000..4b5f36784 --- /dev/null +++ b/requirements.d/coala.txt @@ -0,0 +1,4 @@ +# style and other checks for many languages. +# some bears (checkers) have additional requirements. +coala coala-bears +