Skip to content

Commit

Permalink
readd flake8_docstrings, add flake8_class_newline (#795)
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay committed Apr 20, 2020
1 parent cb44a4b commit 8560717
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- python: "3.6"
install:
- pip install catkin-pkg EmPy jenkinsapi PyYAML rosdistro vcstool
- pip install flake8 flake8-import-order pep8 pyflakes pytest
- pip install flake8 flake8-class-newline flake8-docstrings flake8-import-order pep8 pyflakes pytest
script:
- py.test -s test
- python: "3.6"
Expand Down
4 changes: 4 additions & 0 deletions ros_buildfarm/argument.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ def add_argument_not_failed_only(parser):

def add_argument_os_code_name_and_arch_tuples(parser, required=True):
class _AddUbuntuTupleAction(argparse.Action):

def __call__(self, parser, args, values, option_string=None):
import sys
print('WARNING: ' + self.help, file=sys.stderr)
Expand Down Expand Up @@ -465,6 +466,7 @@ def add_argument_testing(parser):

def check_len_action(minargs, maxargs):
class CheckLength(argparse.Action):

def __call__(self, parser, args, values, option_string=None):
if len(values) < minargs:
raise argparse.ArgumentError(
Expand All @@ -480,6 +482,7 @@ def __call__(self, parser, args, values, option_string=None):

def colon_separated_tuple_action(numparts):
class ColonSeparatedTupleAction(argparse.Action):

def __call__(self, parser, args, values, option_string=None):
for value in values:
if value.count(':') + 1 != numparts:
Expand Down Expand Up @@ -509,6 +512,7 @@ def extract_multiple_remainders(argv, arguments):


class OrderedDictAction(argparse.Action):

def __call__(self, parser, args, values, option_string=None):
dest = OrderedDict()
for value in values:
Expand Down
5 changes: 2 additions & 3 deletions ros_buildfarm/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ def __init__(self, message): # noqa: D107

class PlatformPackageDescriptor(str):
"""
Represents a package stored in a platform-specific package
repository.
Represents a package stored in a platform-specific package repository.
Currently the class is inheriting from str for backwards compatibility.
You should not rely on this but use the `version` property instead.
Expand All @@ -58,7 +57,7 @@ class PlatformPackageDescriptor(str):
def __new__(cls, version, source_name):
return str.__new__(cls, version)

def __init__(self, version, source_name):
def __init__(self, version, source_name): # noqa: D107
self.source_name = source_name

@property
Expand Down
2 changes: 1 addition & 1 deletion ros_buildfarm/config/ci_build_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CIBuildFile(BuildFile):

_type = 'ci-build'

def __init__(self, name, data):
def __init__(self, name, data): # noqa: D107
assert 'type' in data, "Expected file type is '%s'" % \
CIBuildFile._type
assert data['type'] == CIBuildFile._type, \
Expand Down
4 changes: 2 additions & 2 deletions ros_buildfarm/config/plot_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class PlotConfig:

def __init__(self, name, data):
def __init__(self, name, data): # noqa: D107
self.name = name

assert 'master_csv_name' in data, \
Expand Down Expand Up @@ -61,7 +61,7 @@ def __init__(self, name, data):

class PlotDataSeries:

def __init__(self, name, data):
def __init__(self, name, data): # noqa: D107
self.name = name

assert 'data_file' in data, \
Expand Down
5 changes: 3 additions & 2 deletions ros_buildfarm/pulp.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _enumerate_recursive_dependencies(packages, target_names):

class PulpPageIterator:

def __init__(self, fetch_function, *args, **kwargs):
def __init__(self, fetch_function, *args, **kwargs): # noqa: D107
self._get_next = lambda offset: fetch_function(*args, **kwargs, offset=offset)
self._offset = 0
self._next_page()
Expand Down Expand Up @@ -72,7 +72,8 @@ def __next__(self):
class PulpRpmClient:

def __init__(
self, base_url, username, password, task_timeout=60.0, task_polling_interval=0.5):
self, base_url, username, password,
task_timeout=60.0, task_polling_interval=0.5): # noqa: D107
self._task_timeout = task_timeout
self._task_polling_interval = task_polling_interval

Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
'PyYAML'],
'tests_require': [
'flake8 >= 3.7',
'flake8_class_newline',
'flake8_docstrings',
'flake8_import_order',
'pep8',
'pyflakes'],
Expand Down

0 comments on commit 8560717

Please sign in to comment.