zillow / luminaire

Luminaire is a python package that provides ML driven solutions for monitoring time series data.
https://zillow.github.io/luminaire
Apache License 2.0
764 stars 59 forks source link

Force linter to fail ci check #79

Closed Aristarhys closed 3 years ago

Aristarhys commented 3 years ago

exit 1 will will called only if first flake8 will fail and return non zero code from script block immediately

Before last command of script block was evaluated and second flake8 invocation was always returning 0 because of flag passed

shahsmit14 commented 3 years ago

LGTM. @shahsmit14 this ok with you?

There are quite some warning generated by Lint, so will this addition cause them to fail right away? If yes, we will have to get those fixed. Might be in another MR?

Aristarhys commented 3 years ago

@shahsmit14 the lint with exit has limited amount of checked errors classes selected due to --select flag - currently it's returns 0 (exit code and literally console output due to --count) if only you don't add something really breaking like syntax error

Second one will spam with some warnings, correct

You can use -q or --qq to make output less verbose on second invocation

flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics -qq

20    C901 'DataExploration._detrender' is too complex (13)
14    E122 continuation line missing indentation or outdented
24    E127 continuation line over-indented for visual indent
56    E128 continuation line under-indented for visual indent
4     E203 whitespace before ':'
4     E225 missing whitespace around operator
6     E231 missing whitespace after ','
6     E266 too many leading '#' for block comment
44    E302 expected 2 blank lines, found 1
20    E303 too many blank lines (2)
16    E501 line too long (134 > 127 characters)
2     E714 test for object identity should be 'is not'
4     E722 do not use bare 'except'
33    F401 'luminaire.optimization' imported but unused
10    F403 'from luminaire.exploration.data_exploration import *' used; unable to detect undefined names
69    F405 'DataExploration' may be undefined, or defined from star imports: luminaire.exploration.data_exploration
2     F841 local variable 'e' is assigned to but never used
2     W291 trailing whitespace
6     W292 no newline at end of file
8     W293 blank line contains whitespace
2     W391 blank line at end of file
352

P.S. i don't know what desired mcCabe complexity project aimed for but you can pass --max-complexity 14 if you wish But i think 14 is too high - i worked with 11

Aristarhys commented 3 years ago

@snazzyfox removed version bump, rebased, commit email fixed