Repository navigation
Implement basic linting for Travis - #4820
Conversation
|
This means Travis fails until all flake8 errors are gone? |
I left in F821 on the first run to make sure travis was running it correctly. When that one is removed, Travis will pass again. Then we can incrementally fix these and tighten the linting to ensure these errors don't sneak back in. |
| RET=0 | ||
|
|
||
| flake8 statsmodels --select=E901,E999,F822,F823,E111,E114 | ||
| if [ $? -ne "0" ]; then |
There was a problem hiding this comment.
Because I anticipate needing to add more calls as we incrementally fix stuff up. e.g.
flake8 statsmodels --select=F821 --exclude=LIST_OF_FILES_WE_INCREMENTALLY_FIX
if [ $? ...
flake8 statsmodels --select=??? --exclude=LIST_OF_FILES_WE_INCREMENTALLY_FIX
if [ $? ...
It's not pretty, but all-at-once fixes aren't really workable here.
|
|
||
| RET=0 | ||
|
|
||
| flake8 statsmodels --select=E901,E999,F822,F823,E111,E114 |
There was a problem hiding this comment.
Probably should add a comment: # TODO: Add F821 back in once all undefined names are resolved.
They are important as they each have the potential to raise NameError at runtime.
There was a problem hiding this comment.
Could you move this to a setup.cfg, so that editors pick up the settings as well?
[flake8]
exclude=build,docs,examples,.git
select=E901,E999,...
Then you should just be able to have flake8 here.
Codecov Report
@@ Coverage Diff @@
## master #4820 +/- ##
=======================================
Coverage 81.14% 81.14%
=======================================
Files 581 581
Lines 89901 89901
Branches 10041 10041
=======================================
Hits 72946 72946
Misses 14675 14675
Partials 2280 2280Continue to review full report at Codecov.
|
TomAugspurger
left a comment
There was a problem hiding this comment.
Small request to use a config file, +1 otherwise.
|
Based on the latest travis run, this would/could add quite a bit of test time. I think we need to do the check only in a single environment instead of in each one. |
Sounds good. Have a preference for which one? |
|
Again, flake8 should be run once on Python 2 and once on Python 3 because they have different syntaxes and therefore different Abstract Syntax Trees and therefore will produce different results. This is the note at the top of the first page of the flake8 docs. |
|
Always +1 on using CI to improve quality. |
|
Merging tomorrow if there are no objections. |
Fixes the couple of py3-incompatible print statements, leaves unfixed the hundred+ lurking NameErrors discussed in #4768.
@ChadFulton please. This shouldn't be like pulling teeth here.