Closed Bug 1377254 Opened 5 years ago Closed 5 years ago

Run flake8 on all code in CI


(Socorro :: General, task)

Not set


(Not tracked)



(Reporter: peterbe, Assigned: willkg)




(4 files)

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.
Let's slowly do them all "one at a time"
Commit pushed to master at
Bug 1377254 flake8 unittests (#3836)

* bug 1377254 - flake8 unittests



* a bunch of autopep8
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
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
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
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]
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.
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]
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.