Missing whitespace after ',' Open
from .datetime_utils import valid_from,valid_until, parse_timestamp, parse_time, iso2seconds
- Read upRead up
- Exclude checks
Each comma, semicolon or colon should be followed by whitespace.
Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]
Line too long (92 > 79 characters) Open
from .datetime_utils import valid_from,valid_until, parse_timestamp, parse_time, iso2seconds
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Expected 2 blank lines, found 1 Open
def set_up_logging(logfile, level, console):
- Read upRead up
- Exclude checks
Separate top-level function and class definitions with two blank lines.
Method definitions inside a class are separated by a single blank
line.
Extra blank lines may be used (sparingly) to separate groups of
related functions. Blank lines may be omitted between a bunch of
related one-liners (e.g. a set of dummy implementations).
Use blank lines in functions, sparingly, to indicate logical
sections.
Okay: def a():\n pass\n\n\ndef b():\n pass
Okay: def a():\n pass\n\n\nasync def b():\n pass
Okay: def a():\n pass\n\n\n# Foo\n# Bar\n\ndef b():\n pass
Okay: default = 1\nfoo = 1
Okay: classify = 1\nfoo = 1
E301: class Foo:\n b = 0\n def bar():\n pass
E302: def a():\n pass\n\ndef b(n):\n pass
E302: def a():\n pass\n\nasync def b(n):\n pass
E303: def a():\n pass\n\n\n\ndef b(n):\n pass
E303: def a():\n\n\n\n pass
E304: @decorator\n\ndef a():\n pass
E305: def a():\n pass\na()
E306: def a():\n def b():\n pass\n def c():\n pass
Exactly one space required after comma Open
from .datetime_utils import valid_from,valid_until, parse_timestamp, parse_time, iso2seconds
- Read upRead up
- Exclude checks
Used when a wrong number of spaces is used around an operator, bracket or block opener. from .datetimeutils import validfrom,validuntil, parsetimestamp, parse_time, iso2seconds ^
Missing function or method docstring Open
def set_up_logging(logfile, level, console):
- Read upRead up
- Exclude checks
Used when a function or method has no docstring.Some special methods like init do not require a docstring.
standard import import logging
should be placed before from .datetime_utils import valid_from, valid_until, parse_timestamp, parse_time, iso2seconds
Open
import logging
- Read upRead up
- Exclude checks
Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports)
Variable name ch
doesn't conform to snake_case naming style Open
ch = logging.StreamHandler(sys.stdout)
- Read upRead up
- Exclude checks
Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).
Variable name fh
doesn't conform to snake_case naming style Open
fh = logging.FileHandler(logfile)
- Read upRead up
- Exclude checks
Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).
standard import import sys
should be placed before from .datetime_utils import valid_from, valid_until, parse_timestamp, parse_time, iso2seconds
Open
import sys
- Read upRead up
- Exclude checks
Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports)