From 966386e7ead129d2d1847be4d3f1e2351ce721e8 Mon Sep 17 00:00:00 2001 From: Alexey Lavrenuke Date: Tue, 27 Dec 2016 16:08:02 +0300 Subject: [PATCH] some pep8 --- .flake8 | 26 ++++++++++++++++++++++ .travis.yml | 4 +++- docs/conf.py | 15 +++++++------ setup.py | 2 +- yandextank/api/__init__.py | 2 +- yandextank/plugins/Telegraf/decoder.py | 30 +++++++++++++------------- 6 files changed, 54 insertions(+), 25 deletions(-) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..e727566 --- /dev/null +++ b/.flake8 @@ -0,0 +1,26 @@ +[flake8] +exclude = + .git, + .cache, + .eggs, + .idea, + .Python, + docs/, + tmp/, + env/, + build/, + *.build/, + develop-eggs/, + dist/, + downloads/, + eggs/, + .eggs/, + lib/, + lib64/, + parts/, + sdist/, + var/, + *.egg-info/, + .installed.cfg, + *.egg +ignore = E501 diff --git a/.travis.yml b/.travis.yml index 454b0f1..3781fca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,4 +4,6 @@ python: - "2.7" install: - "pip install ." -script: "python setup.py test" +script: + - "python setup.py flake8" + - "python setup.py test" diff --git a/docs/conf.py b/docs/conf.py index fcc12cb..fd0ce59 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,14 +11,15 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os +import sys +import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) -# -- General configuration ----------------------------------------------------- +# -- General configuration ----------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' @@ -87,7 +88,7 @@ pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] -# -- Options for HTML output --------------------------------------------------- +# -- Options for HTML output --------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. @@ -166,7 +167,7 @@ html_static_path = ['_static'] # Output file base name for HTML help builder. htmlhelp_basename = 'YandexTankdoc' -# -- Options for LaTeX output -------------------------------------------------- +# -- Options for LaTeX output -------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). @@ -206,7 +207,7 @@ latex_documents = [ # If false, no module index is generated. #latex_domain_indices = True -# -- Options for manual page output -------------------------------------------- +# -- Options for manual page output -------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). @@ -217,7 +218,7 @@ man_pages = [ # If true, show URL addresses after external links. #man_show_urls = False -# -- Options for Texinfo output ------------------------------------------------ +# -- Options for Texinfo output ------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, @@ -236,7 +237,7 @@ texinfo_documents = [ # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' -# -- Options for Epub output --------------------------------------------------- +# -- Options for Epub output --------------------------------------------- # Bibliographic Dublin Core info. epub_title = u'Yandex.Tank' diff --git a/setup.py b/setup.py index 6017a93..2af5e71 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ analytic tools for the results they produce. 'pip>=8.1.2', ], setup_requires=[ - 'pytest-runner', + 'pytest-runner', 'flake8', ], tests_require=[ 'pytest', diff --git a/yandextank/api/__init__.py b/yandextank/api/__init__.py index ac0e340..294a341 100644 --- a/yandextank/api/__init__.py +++ b/yandextank/api/__init__.py @@ -1,4 +1,4 @@ ''' Package contains all tank tool core code ''' -from apiworker import * +from apiworker import * # noqc: F401,F403 diff --git a/yandextank/plugins/Telegraf/decoder.py b/yandextank/plugins/Telegraf/decoder.py index e1f0e8b..4e7a740 100644 --- a/yandextank/plugins/Telegraf/decoder.py +++ b/yandextank/plugins/Telegraf/decoder.py @@ -25,24 +25,24 @@ class MetricsDecoder(object): 'system_load1': 'System_la1', 'system_load5': 'System_la5', 'system_load15': 'System_la15', - #'cpu_usage_user': 'CPU_user', - #'cpu_usage_system': 'CPU_system', - #'cpu_usage_idle': 'CPU_idle', - #'cpu_usage_iowait': 'CPU_iowait', - #'cpu_usage_irq': 'CPU_irq', - #'cpu_usage_nice': 'CPU_nice', - #'cpu_usage_softirq': 'CPU_softirq', - #'cpu_usage_steal': 'CPU_steal', - #'cpu_usage_guest': 'CPU_guest', + # 'cpu_usage_user': 'CPU_user', + # 'cpu_usage_system': 'CPU_system', + # 'cpu_usage_idle': 'CPU_idle', + # 'cpu_usage_iowait': 'CPU_iowait', + # 'cpu_usage_irq': 'CPU_irq', + # 'cpu_usage_nice': 'CPU_nice', + # 'cpu_usage_softirq': 'CPU_softirq', + # 'cpu_usage_steal': 'CPU_steal', + # 'cpu_usage_guest': 'CPU_guest', 'nstat_TcpRetransSegs': 'Net_retransmit' # those guys became inactive due to net interface names and disk ids # we don't need unknown id data here - #'net_packets_recv': 'Net_rx', - #'net_packets_sent': 'Net_tx', - #'net_bytes_recv': 'Net_recv', - #'net_bytes_sent': 'Net_send', - #'diskio_read_bytes': 'Disk_read', - #'diskio_write_bytes': 'Disk_write', + # 'net_packets_recv': 'Net_rx', + # 'net_packets_sent': 'Net_tx', + # 'net_bytes_recv': 'Net_recv', + # 'net_bytes_sent': 'Net_send', + # 'diskio_read_bytes': 'Disk_read', + # 'diskio_write_bytes': 'Disk_write', } self.diff_metrics = {