From 5a2f6f6b2fbdca94c5d228173eecba7c6027386a Mon Sep 17 00:00:00 2001 From: Benjamin Wohlwend Date: Mon, 12 Feb 2018 17:23:35 +0100 Subject: [PATCH] added `.hound.yml` and updated config --- .flake8 | 4 ++++ .hound.yml | 5 +++++ .travis.yml | 5 ----- Makefile | 2 +- elasticapm/__init__.py | 8 ++++---- setup.cfg | 10 +--------- 6 files changed, 15 insertions(+), 19 deletions(-) create mode 100644 .flake8 create mode 100644 .hound.yml diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..03b9cc5d6 --- /dev/null +++ b/.flake8 @@ -0,0 +1,4 @@ +[flake8] +exclude=elasticapm/utils/wrapt,build,src,tests,dist,conftest.py,setup.py +max-line-length=120 +ignore=E731 diff --git a/.hound.yml b/.hound.yml new file mode 100644 index 000000000..0745a960a --- /dev/null +++ b/.hound.yml @@ -0,0 +1,5 @@ +flake8: + enabled: true + config_file: .flake8 + +fail_on_violations: true diff --git a/.travis.yml b/.travis.yml index 036f4766b..51c72ca17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,11 +27,6 @@ matrix: python: 3.6 script: pip install isort && isort -c -df && echo "OK" - - stage: linters - env: LINTER="flake8" - python: 3.6 - script: pip install -U flake8 flake8-per-file-ignores && flake8 elasticapm - - stage: linters script: make docs perl: "5.26" diff --git a/Makefile b/Makefile index 0dbfc7305..66438ab4f 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ isort: isort -rc -vb . flake8: - flake8 elasticapm + flake8 test: if [[ "$$PYTHON_VERSION" =~ ^(3.5|3.6|nightly|pypy3)$$ ]] ; then \ diff --git a/elasticapm/__init__.py b/elasticapm/__init__.py index 7ac37f0be..727e01b8e 100644 --- a/elasticapm/__init__.py +++ b/elasticapm/__init__.py @@ -18,7 +18,7 @@ VERSION = 'unknown' from elasticapm.base import Client -from elasticapm.conf import setup_logging -from elasticapm.instrumentation.control import instrument, uninstrument -from elasticapm.traces import (capture_span, set_context, set_custom_context, - set_transaction_name, set_user_context, tag) +from elasticapm.conf import setup_logging # noqa: F401 +from elasticapm.instrumentation.control import instrument, uninstrument # noqa: F401 +from elasticapm.traces import capture_span, set_context, set_custom_context # noqa: F401 +from elasticapm.traces import set_transaction_name, set_user_context, tag # noqa: F401 diff --git a/setup.cfg b/setup.cfg index 601291d03..df0918e80 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,7 +20,7 @@ markers = line_length=80 indent=' ' not_skip=__init__.py -skip=wrapt,setup.py,build,src +skip=wrapt,setup.py,build,src,elasticapm/__init__.py multi_line_output=0 known_standard_library=importlib,types,asyncio known_django=django @@ -29,14 +29,6 @@ known_third_party=pytest,flask,aiohttp,urllib3_mock,webob,memcache,pymongo,boto3 default_section=FIRSTPARTY sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER - -[flake8] -exclude=elasticapm/utils/wrapt,build,src -max-line-length=120 -ignore=E731 -per-file-ignores = - elasticapm/__init__.py: F401 - [coverage:run] include = elasticapm/*