Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pylint & pep257: Resolve issues in python coding style. #506

Merged
merged 1 commit into from
May 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .prospector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,22 @@ pyroma:
mypy:
run: false

mccabe:
run: false

pylint:
run: false

pydocroma:
run: true

pyflakes:
run: true

pep8:
run: true
disable: [
N811, # false negatives from from ctypes import
E501, # Line-length, already controlled by pylint
E302, # expected 2 blank lines, found 1, controlled by black
]
Expand All @@ -33,8 +40,17 @@ pep257:
run: true
# see http://pep257.readthedocs.io/en/latest/error_codes.html
disable: [
# numpy convention
D107, # Missing docstring in __init__
D203, # 1 blank line required before class docstring
# conflicts with D0211, No blank lines allowed before class docstring
D205, # 1 blank line required between summary line and description
D212, # Multi-line docstring summary should start at the first line
# Conflictes with D213 / Multi-line docstring summary should start at the second line
D213, # Multi-line docstring summary should start at the second line
D402, # First line should not be the function's "signature"
# conflicts with D213, Multi-line docstring summary should start at the second line
D406, # Section name should end with a newline
D407, # Missing dashed underline after section
D413, # Missing blank line after last section
]
4 changes: 1 addition & 3 deletions bindings/python/examples/iio_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@


def main():
"""
Dump iio devices, list all iio attributes.
"""
"""Dump iio devices, list all iio attributes."""
print("Library version: %u.%u (git tag: %s)" % iio.version)

if len(argv) == 3 and argv[1] == "--uri":
Expand Down
9 changes: 6 additions & 3 deletions bindings/python/examples/iio_readdev.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ class ContextBuilder:

def __init__(self, arguments):
"""
ContextBuilder class constructor.
Class constructor.

Args:
arguments: type=Arguments
Contains the input arguments.
Expand Down Expand Up @@ -156,7 +157,8 @@ class BufferBuilder:

def __init__(self, ctx, arguments):
"""
BufferBuilder class constructor.
Class constructor.

Args:
ctx: type=iio.Context
This buffer's context.
Expand Down Expand Up @@ -202,7 +204,8 @@ class DataReader:

def __init__(self, ctx, arguments):
"""
DataWriter class constructor.
Class constructor.

Args:
ctx: type=iio.Context
Current context.
Expand Down
9 changes: 6 additions & 3 deletions bindings/python/examples/iio_writedev.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ class ContextBuilder:

def __init__(self, arguments):
"""
ContextBuilder class constructor.
Class constructor.

Args:
arguments: type=Arguments
Contains the input arguments.
Expand Down Expand Up @@ -161,7 +162,8 @@ class BufferBuilder:

def __init__(self, ctx, arguments):
"""
BufferBuilder class constructor.
Class constructor.

Args:
ctx: type=iio.Context
This buffer's context.
Expand Down Expand Up @@ -207,7 +209,8 @@ class DataWriter:

def __init__(self, ctx, arguments):
"""
DataWriter class constructor.
Class constructor.

Args:
ctx: type=iio.Context
Current context.
Expand Down
Loading