Skip to content
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
2 changes: 1 addition & 1 deletion pycodestyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
LAMBDA_REGEX = re.compile(r'\blambda\b')
HUNK_REGEX = re.compile(r'^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@.*$')
STARTSWITH_DEF_REGEX = re.compile(r'^(async\s+def|def)')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about this one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all regular expressions named similarly need to be touched all at once. This one is actually fine as is.

STARTSWITH_TOP_LEVEL_REGEX = re.compile(r'^(async\s+def|def|class|@)')
STARTSWITH_TOP_LEVEL_REGEX = re.compile(r'^(async\s+def\s+|def\s+|class\s+|@)')
STARTSWITH_INDENT_STATEMENT_REGEX = re.compile(
r'^\s*({0})'.format('|'.join(s.replace(' ', '\s+') for s in (
'def', 'async def',
Expand Down
3 changes: 3 additions & 0 deletions testsuite/E30not.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,6 @@ class Bar(object):
classification_errors = None
#: Okay
defined_properly = True
#: Okay
defaults = {}
defaults.update({})