atom-community / atom-community/ide-python
Can't suppress Mccabe.
- Ngôn ngữ chính
- JavaScript
- Star
- 238
- Fork
- 40
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện ví dụ vi phạm McCabe trong Python đã đăng trong Atom và kiểm tra cách đầu ra linting Python xử lý các chú thích noqa. Được xem là hoàn tất khi cảnh báo McCabe bị tắt khi ví dụ sử dụng các chú thích noqa được hiển thị.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- tooling
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100