github - Python - Resolving PEP8 errors -
i'm trying resolve pep8 errors generated travis build after pull request firefox ui github repo. i've been able reproduce these errors locally using pep8
library. have following line in file exceeds 99 character limit:
wait(self.marionette).until(lambda _: self.autocomplete_results.is_open , len(self.autocomplete_results.visible_results) > 1))
the error produces on running through pep8
given by:
$ pep8 --max-line-length=99 --exclude=client firefox_ui_tests/functional/locationbar/test_access_locationbar.py firefox_ui_tests/functional/locationbar/test_access_locationbar.py:51:100: e501 line long (136 > 99 characters)
the line calls wait().until()
method marionette python client. line 2 separate lines:
wait(self.marionette).until(lambda _: self.autocomplete_results.is_open) wait(self.marionette).until(lambda _: len(self.autocomplete_results.visible_results) > 1)
the repo manager advised me combine these 2 lines one, has extended length of resulting line, causing pep8 error.
i change way was, there way of formatting or indenting line not cause pep8 error.
thanks in advance.
yes;
wait(self.marionette).until( lambda _: ( self.autocomplete_results.is_open , len(self.autocomplete_results.visible_results) > 1 ) )
check:
$ pep8 --max-line-length=99 --exclude=client foo.py
parens rescue! :)
Comments
Post a Comment