On Fri, Feb 01, 2019 at 11:08:26AM -0500, Andrew Halberstadt wrote:
> *4. Enabling flake8-isort (bug 1492495
> Isort is a tool to format python imports, and flake8-isort is a shim
> to use it as a linter. I'm proposing flake8-isort over the more
> popular flake8-import-order because we'll get automatic fixing for
> free. Manually re-ordering imports is not something I think anyone
> should be subjected to.
> Isort is configurable, but the default is pretty close to what we
> unofficially tend to use anyway, namely:
> # stdlib imports
> import os
> import sys
> from collections import OrderedDict, defaultdict
> # external dependency imports
> import requests
> from mozprocess import ProcessHandler
> # internal imports
> import mymodule
> from . import name
> I think I'd like to enable this at the 'warning' level to start (so it
> doesn't cause backouts or show up without --warnings). This will
> give people a feel for the new syntax and allow us to start using
> --fix to re-order imports before making it a hard requirement.
> This item item is potentially controversial, so let me know if you
> have any objections to enabling this.
Considering modules can execute code when they are being imported (and
some do), reordering should be done with extra care.
- Items 4-5 still have no timeline. Please ping me if you're interested in pushing these forward.
This means that our flake8 linter finally uses a blacklist! New python files you add to the tree should automatically get linted (provided they don't live under one the exclusions in the .flake8 file). As a result of this change, expect running flake8 on the entire tree to take roughly twice as long. Linting subdirectories shouldn't have too much of a perf hit though.
Let me know if you see anything else weird going on.
On Fri, Feb 8, 2019 at 9:50 AM Andrew Halberstadt <[hidden email]> wrote:
- Items 1 (flake8 upgrade) and 2 (removing sub .flake8 files) are now landed.
- Item 3 (blacklist) should land in the next week or two.
- Items 4-5 have no timeline yet.
On Fri, Feb 1, 2019 at 11:08 AM Andrew Halberstadt <[hidden email]> wrote:
Just wanted to let you know of a few upcoming changes to our
flake8 linter that I'm planning:
1. Upgrading flake8, pycodestyle and pyflakes
It's been awhile since we've bumped these tools. The upgrades