How to turn off Pydev indentation warnings for certain .py files

独自空忆成欢 提交于 2019-12-10 21:26:55

问题


I have some files in my project that are from an external source and that I never edit but sometimes step through. These files use a different indentation style from my default one (2 spaces vs. 4 spaces), and I currently many indentation warnings on them. Is there an easy way to suppress these warnings (or alternatively, specify an indentation style) on a file by file basis? I would expect to be able to solve my problem with the equivalent of a pragma line that I add at the top of the file but so far I haven't found such a thing. (BTW I would rather not turn off indentation warnings altogether, as I find them useful when editing code.)


回答1:


You can add #@PydevCodeAnalysisIgnore to the beginning of your file to have PyDev skip its code-analysis of that file -- including the indentation warnings (i.e.: go to the top of your file and do Ctrl+1 and such an option will be shown to you).



来源:https://stackoverflow.com/questions/9101787/how-to-turn-off-pydev-indentation-warnings-for-certain-py-files

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