carpentries-incubator / carpentries-incubator/python-intermediate-development

Adjust the advice given for running linter on CI

Aperta
#214 2 commenti 0 reazioni 1 assegnatario Rivendicata da @bielsnohr Vedi su GitHub
Lingua principale
TeX
Stelle
63
Fork
77
Merge medio
20h 8m
PR unite (30g)
3

Descrizione

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).

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.