atom-community / atom-community/ide-python
Can't suppress Mccabe.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 238
- Forks
- 40
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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.
Beitragsleitfaden
Rechercherichtung
Beginne damit, das veröffentlichte Python-McCabe-Verstoßbeispiel in Atom zu reproduzieren und zu prüfen, wie die Python-Linting-Ausgabe mit noqa-Kommentaren umgeht. Erledigt ist dies, wenn die McCabe-Warnung unterdrückt wird, sobald das Beispiel die gezeigten noqa-Annotationen verwendet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100