atom-community / atom-community/ide-python

Can't suppress Mccabe.

オープン
#164 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
238
フォーク
40
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

![ide-py-linter-fail](https://user-images.githubusercontent.com/17391760/54986477-000b6d80-4fb3-11e9-8646-19548bbf5020.png)

Kind regards.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、投稿された Python の McCabe 違反の例を Atom で再現し、Python linting の出力が noqa コメントをどのように扱うかを確認します。例で示された noqa アノテーションを使用したときに McCabe 警告が抑制されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。