You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the course recommends using a --fail-under score for the linting:
Note we need to add --fail-under=0 otherwise the builds will fail if we don’t get a ‘perfect’ score of 10! This seems unlikely, so let’s be more pessimistic.
I would instead recommend having a file with pre-existing linting errors, and then adopting a zero tolerance approach to new warnings.
This would also require adding instructions for how to suppress specific warnings (# noqa) as sometimes it is legitimate to ignore a warning.
This is better than having a score as:
the score allows new things to fall in, which reduces how useful the linter is
it actually discourages removing code since you can get into a situation where you want to delete some redundant code, but that actually increases the fraction of code that has a warning, and so your "delete only" PR will fail CI.
(I intend to address this, raising issue for visibility and in case anyone disagrees).
The text was updated successfully, but these errors were encountered:
The slight problem with this is currently the course advises using pylint, which produces quite a lot of noise. For example, demanding docs on every function, requiring classes to have a minimum of two public methods, banning all single letter variable names etc. I would suggest using flake8, which produces a much less opinionated set of checks (I believe a human is better placed to judge whether variable names are long enough, whether there should be docs etc.)
However, as it stands I wouldn't advise doing this as you'll end up polluting the codebase with endless comments suppressing warnings
We could suggest using flake8, or how to disable the more annoying warnings from pylint. My preference would be the former.
Currently the course recommends using a
--fail-under
score for the linting:I would instead recommend having a file with pre-existing linting errors, and then adopting a zero tolerance approach to new warnings.
This would also require adding instructions for how to suppress specific warnings (
# noqa
) as sometimes it is legitimate to ignore a warning.This is better than having a score as:
(I intend to address this, raising issue for visibility and in case anyone disagrees).
The text was updated successfully, but these errors were encountered: