Page MenuHomePhabricator

Fix issues found by flake8
Closed, ResolvedPublic

Description

Massmailer contains some lint errors found by flake8 that are currently ignored (see https://github.com/wikimedia/labs-tools-massmailer/blob/master/tox.ini, starting line 24).

How to fix an error

(all paths here are from the root of the repository)

  1. Choose an error from the list below
  2. Delete the error and its comment from /tox.ini
  3. Run tox -e lint to run only lint and see where the error is
  4. Fix the error reported by the command until the command from step 3 reports no errors.

Errors

$ tox -e lint | grep '^\.' | sed 's/: /@/g' | cut -d @ -f 2 | sed 's/^ //g;s/too long.*$/too long/g;s/undefined name .*$/undefined name "*"/g;s/\(.\)from .* import \*\(.\)/\1from x import */g;s/ \(.\).*\(.\) may
 be undefined, or defined/ \1x\2 may be undefined, or defined/g;s/..*. imported but unused/x imported but unused/g' | sort | uniq -c | sort -k1,1nr -k2
     22 E117 over-indented
      7 x imported but unused
      6 E101 indentation contains mixed spaces and tabs
      6 E122 continuation line missing indentation or outdented
      6 E302 expected 2 blank lines, found 1
      1 E305 expected 2 blank lines after class or function definition, found 1
      1 E711 comparison to None should be 'if cond is not None:'
      1 F811 redefinition of unused 'redirect' from line 21

Related Objects

Event Timeline

Change 557152 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[labs/tools/massmailer@master] Fix E302 errors

https://gerrit.wikimedia.org/r/557152

Change 557152 merged by jenkins-bot:
[labs/tools/massmailer@master] Fix E302 errors

https://gerrit.wikimedia.org/r/557152

Change 557257 had a related patch set uploaded (by Bjornskjald; owner: Bjornskjald):
[labs/tools/massmailer@master] Fix lint errors

https://gerrit.wikimedia.org/r/557257

Change 557257 merged by jenkins-bot:
[labs/tools/massmailer@master] Fix lint errors

https://gerrit.wikimedia.org/r/557257