Run flake8 on all code in CI



5 months ago
24 days ago


(Reporter: peterbe, Assigned: willkg)


Firefox Tracking Flags

(Not tracked)



(4 attachments)



5 months ago
We currently run flake8 on all codes in webapp-django, meaning you can't pass CI with "linting errors". 

We don't do that for the "non-webapp-django" code (e.g. the ./socorro/ directory). 

We should run flake8 on ALL code and run flake8 in CI on ALL code.

Comment 1

5 months ago
Let's slowly do them all "one at a time"

Comment 2

4 months ago
Commit pushed to master at
Bug 1377254 flake8 unittests (#3836)

* bug 1377254 - flake8 unittests



* a bunch of autopep8

Comment 3

4 months ago
more babysteps

Comment 4

4 months ago

Comment 5

4 months ago
Commit pushed to master at
bug 1377254 - pep8 all crontabber apps (#3855)

Comment 6

4 months ago
Commit pushed to master at
bug 1377254 - flake8 all socorro.external.postgres (#3856)

* bug 1377254 - flake8 all socorro.external.postgres

* undo

* nit

* nites
Duplicate of this bug: 664759

Comment 9

3 months ago
all things taskmanager

Comment 10

3 months ago
Commit pushed to master at
bug 1377254 fix lint issues in socorro/lib/ (#3902)

* bug 1377254 - pep8 datetimeutil

Minor cleanup for datetimeutil.

* bug 1377254 - remove prioritize

This had flake8 issues, but it's not used anywhere, so I removed it.

* bug 1377254 - clean up easy linting issues in socorro/lib/

* bug 1377254 - fix lint issues in socorro/lib/

In the process of doing this, I removed a bunch of code that's not used
anywhere, too.

* bug 1377254 - remove unused bits in socorro/lib/

* bug 1377254 - clean up socorro/lib/

* Fix two lines that were too long
Grabbing this to finish it up.
Assignee: nobody → willkg
Created attachment 8916351 [details] [review]
pr 4027 - flake8 on socorro code

Comment 13

a month ago
Commit pushed to master at
bug 1377254 - flake8 socorro code [no rush] (#4028)

* bug 1377254 - flake8 socorro/app and remove generic_app

generic_app was just a redirect to other things, so I removed it and updated all
the things that referred to it.

* bug 1377254 - flake8 socorro/cron/

* bug 1377254 - flake8 socorro/processor/

* bug 1377254 - flake8 socorro/schemas/

* bug 1377254 - flake8 socorro/submitter/

* Rename generic_app.rst
Created attachment 8916592 [details] [review]
pr 4029 - flake8 socorro/database/
Created attachment 8916691 [details] [review]
pr 4030 - flake8 socorro/external/

Comment 16

a month ago
Commits pushed to master at
bug 1377254 - flake8 socorro/external/

* fixes flake8 issues
* drops socorro/external/fs/'s dates_to_strings_for_json and
  reimplements it as the unenthusing name JsonDTISOEncoder in
* removes commented out code and unused code
* adds a file-level "noqa" to socorro/external/postgresql/ which
  isn't great, but that file is full of long lines and it's static data used
  only to set up local development environments
* adds a file-level "noqa" to socorro/external/statsd/ because
  that file is just a namespace for backwards-compatibility
Merge pull request #4030 from willkg/1377254-external

bug 1377254 - flake8 socorro/external/ [no rush]

Comment 17

a month ago
Commits pushed to master at
bug 1377254 - flake8 socorro/database/

This removes two files that aren't used anywhere, then tidies up the third.
Merge pull request #4029 from willkg/1377254-database

bug 1377254 - flake8 socorro/database/ [no rush]
All the linting fixes have landed. The last thing to do here is to remove the linting step from running the webapp tests and then add a linting step to Travis and Circle that covers the whole codebase.
I was working on the last bit, but then ran into a bunch of stuff that never got linted. I'm not sure how I missed them.
Created attachment 8920706 [details] [review]
pr 4055: fixes bug 1377254 - lint in ci

Comment 21

24 days ago
Commits pushed to master at
bug 1377254 - fix flake8 exclusions
bug 1377254 - fix docker/ lint issues
bug 1377254 - flake8 socorro/unittest/app/*
bug 1377254 - flake8 socorro/unittest/cron/*
bug 1377254 - flake8 socorro/unittest/lib/*
bug 1377254 - flake8 socorro/unittest/processor/*
bug 1377254 - flake8 socorro/unittest/*
bug 1377254 - flake8 socorro/lib/*
bug 1377254 - flake8 scripts/database/*
bug 1377254 - fix misc files
fixes bug 1377254 - clean up CI code

This nixes some files we don't need anymore and switches the test scripts to run
pytest instead of webapp-django/bin/

This removes the ad-hoc linting we had in the webapp code and replaces it with
flake8 that's run in Circle, Travis, and local development environments.

This adds a few more directories to exclude for flake8.
Merge pull request #4055 from willkg/1377254-lint-in-ci

fixes bug 1377254 - lint in ci [no rush]


24 days ago
Last Resolved: 24 days ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.