Watson
Watson copied to clipboard
Flake8 linter configuration (especially line length)
Are the options used for flake8 included in the repo anywhere? Since the project uses the flake8 default for line length it will work out of the box for default configs, but if someone has their environment set up differently then it might cause a bit of confusion (e.g. I use Black's limit of 88).
I couldn't see the line length set explicitly in setup.cfg or tox.ini, so perhaps it could be added there, e.g. for setup.cfg:
[flake8]
max_line_length=79
I first noticed this when a PR failed the Travis CI checks, so if there's an easier way I could have noticed this earlier please let me know.
I think most editor plugins will use the defaults values if nothing is provided (therefore 79). Are you sure you don't have a black plugin messing it up?
Now I actually believe that we should move to black, but that's another matter :) .
You're right about defaults, but I use a "system wide" value of 88 (or 100 at my workplace), so for any project that uses a different value (and to be fair, a lot of them use 79) I should add a per-project setting somewhere.
I'm not really sure what the ratio is of people using 79 vs other values, so maybe it's not a big deal.
And I'm obviously in favour of using black for watson too, when there's time :)
I second that request. I have configured a maximal function complexity of 5 systemwide, so running flake8 locally fails for plenty of Watson's functions.