diff --git a/.style.yapf b/.style.yapf index 5312d3a..b34c3f4 100644 --- a/.style.yapf +++ b/.style.yapf @@ -1,5 +1,8 @@ [style] +# Insert a blank line before a module docstring. +blank_line_before_module_docstring=True + # The column limit. column_limit=120 @@ -11,7 +14,7 @@ column_limit=120 # # foo = ('This is a really long string: {}, {}, {}, {}' # .format(a, b, c, d)) -split_before_dot=False +split_before_dot=True # Set to True to split list comprehensions and generators that have # non-trivial expressions and multiple clauses before each of these diff --git a/httping.py b/httping.py index f462d79..a8d255d 100755 --- a/httping.py +++ b/httping.py @@ -1,6 +1,7 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- -""" Simulates httping for `argos `""" + +"""Simulates httping for `argos `.""" # httping # v1.0 # Tobias Schmidl @@ -29,17 +30,18 @@ MAX_PING_IN_MS = MAX_PING.total_seconds() * 1000 def in_bucket(element, bucket): - """ Returns True if element is in bucket """ + """Return True if element is in bucket.""" return bucket[0] <= element <= bucket[1] def generate_buckets(min_val, max_val, step_width=2): - """ Generates a list of partitioned lists between min_val and max_val.""" + """Generate a list of partitioned lists between min_val and max_val.""" return [[x, x + step_width - 1] for x in range(min_val, max_val, step_width)] class Themes: - """Maintains a list of themes and generates buckets between 0 and MAX_PING_IN_MS based on the selected theme.""" + """Maintain a list of themes and generates buckets between 0 and MAX_PING_IN_MS based on the selected theme.""" + # Themes are from http://colorbrewer2.org/ purple_green = ["#762a83", "#9970ab", "#c2a5cf", "#a6dba0", "#5aae61", "#1b7837"] red_green = ["#d73027", "#fc8d59", "#fee08b", "#d9ef8b", "#91cf60", "#1a9850"] @@ -48,6 +50,7 @@ class Themes: buckets = None def __init__(self, selected_colors): + """Initialize class with a selected theme.""" self.selected_colors = selected_colors self.buckets = generate_buckets(0, int(MAX_PING_IN_MS), int(MAX_PING_IN_MS / (len(selected_colors) - 1))) diff --git a/pylama.ini b/pylama.ini new file mode 100644 index 0000000..b7f11e2 --- /dev/null +++ b/pylama.ini @@ -0,0 +1,15 @@ +[pylama] +format = pylint +linters = mccabe,pep257,pydocstyle,pep8,pycodestyle,pyflakes,pylint,isort +ignore = D203 +skip=.env/* + +[pylama:pycodestyle] +max_line_length = 120 + +[pylama:pep8] +max_line_length = 120 + +[pylama:pylint] +max_line_length = 120 +