Dismiss PyCharm code inspection warning for particular line of code

不想你离开。 提交于 2019-11-27 03:52:38

问题


PyCharm's code inspection is a useful tool, but sometimes it gets things wrong. I know you can disable whole classes of warnings via settings, but what if you just want to dismiss a specific instance of a warning at a particular line?


回答1:


1. Alt + Enter while cursor standing on problematic place.

2. Select appropriate entry from appeared popup menu.

3. Expand submenu (click on small triangle on the right side .. or just press arrow right key on keyboard.

4. Choose "Suppress for statement" from there.

In the end special comment will be added just before that line that would temporarily turn off that specific inspection for next statement.

This is how it looks in PhpStorm (sorry, I'm not PyCharm or Python user):



来源:https://stackoverflow.com/questions/20787218/dismiss-pycharm-code-inspection-warning-for-particular-line-of-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!