Repository navigation
flake8: Enforce E731 (no lambda expressions) on Tests/ - #2019
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2019 +/- ##
=======================================
Coverage 84.91% 84.91%
=======================================
Files 315 315
Lines 50544 50544
=======================================
Hits 42918 42918
Misses 7626 7626Continue to review full report at Codecov.
|
|
@MarkusPiotrowski assuming we go ahead with per-folder level settings in a top level My opinion was most of the lambda use here was reasonable, my question could be rephrased as: Do we want to strongly discourage using lambdas in future tests? |
|
Actually, I also use lambdas in |
|
OK, assuming we can ignore F731 with a top level |
|
@MarkusPiotrowski given there seems to be a bug with the flake8 per-file-ignores (see #2014 discussion), shall we go ahead and merge this? I'll just rebase it now to deal with the merge conflict... |
Quick script used:
import sys
def fix(line):
if "lambda " not in line:
return line
if ":" not in line:
return line
if "E731" in line:
return line
if line.rstrip().endswith(" \\"):
# TODO
return line
return line.rstrip() + " # noqa: E731\n"
for f in sys.argv[1:]:
print(f)
with open(f) as handle:
old = list(handle)
new = [fix(line) for line in old]
with open(f, "w") as handle:
for line in new:
handle.write(line)
print("Done")
|
OK! Then we need to look at the 28 occurrences of E731 in |
Like #2016 and #2017, this pull request is somewhat related to issue #883 / #2014 and the goal of having universal flake8 settings for the entire project.
I hereby agree to dual licence this and any previous contributions under both
the Biopython License Agreement AND the BSD 3-Clause License.
I have read the
CONTRIBUTING.rstfile and understand that AppVeyor andTravisCI will be used to confirm the Biopython unit tests and
flake8stylechecks pass with these changes.
I have added my name to the alphabetical contributors listings in the files
NEWS.rstandCONTRIB.rstas part of this pull request, am listedalready, or do not wish to be listed. (This acknowledgement is optional.)