atom-community / atom-community/ide-python
Can't suppress Mccabe.
- Lingua principale
- JavaScript
- Stelle
- 238
- Fork
- 40
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Hi everyone,
below I have build an example for a McCabe-violation from the anti-pattern on Flake8's website.
`def post_comment(self): # noqa
if self.success: # noqa
comment = 'Build succeeded'
elif self.warning:
comment = 'Build had issues'
elif self.failed:
comment = 'Build failed'
if self.success:
self.post(comment, type='success')
else:
self.post(comment, type='error')
if self.success:
comment = 'Build succeeded'
elif self.warning:
comment = 'Build had issues'
elif self.failed:
comment = 'Build failed'
if self.success:
self.post(comment, type='success')
else:
self.post(comment, type='error')
if self.success:
comment = 'Build succeeded'
elif self.warning:
comment = 'Build had issues'
elif self.failed:
comment = 'Build failed'
if self.success:
self.post(comment, type='success')
else:
self.post(comment, type='error')
if self.success:
comment = 'Build succeeded'
elif self.warning:
comment = 'Build had issues'
elif self.failed:
comment = 'Build failed'
if self.success:
self.post(comment, type='success')
else:
self.post(comment, type='error')
`
Predictably, this results in a warning. However, adding `noqa` does not manage to suppress these.

Kind regards.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia riproducendo in Atom l’esempio pubblicato di violazione McCabe in Python e verificando come l’output del linting Python gestisce i commenti noqa. Il lavoro è completato quando l’avviso McCabe viene soppresso quando l’esempio usa le annotazioni noqa mostrate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100