解决忽略VScode中Python插件pylint报错的问题

pylint是VScode中python自带的插件,可以帮助代码规范,美观。

但是有些报错是你不想看到的,你可以选择性的忽略。

  • 例如,在re.compile()中,可以添加参数re.S使. 匹配任意字符。而pylint会一直报错不存在这种方法,导致无法运行。在Pycharm中则不会出现这种问题。

想要自定义忽略错误,操作如下:

  1. 在setting,json文件中搜索python.linting.pylintArgs
  2. 修改如下。
  3. python.linting.pylintArgs 中添加字符串 --disable=错误码 ,若有多个错误码,用小括号隔开。此处我只忽略了E1101。你可以改成E1101, E1102

    注:此处翻阅了网上很多资料,许多人说是添加--disable-msg=错误码 但是这种方法并不适用于我,可能我下载的是最新版本。用上面提到的方法就可以,亲测。

有什么其他问题可以留言讨论。

原文地址:https://www.cnblogs.com/cowry5/p/8711253.html

时间: 2024-08-28 15:56:43

解决忽略VScode中Python插件pylint报错的问题的相关文章

python安装locustio报错error: invalid command 'bdist_wheel'的解决方法

locust--scalable user load testing tool writen in Python(是用python写的.规模化.可扩展的测试性能的工具) 安装locustio需要的环境条件是:Python2.6+,但是不支持Python3. 今天在cmd里运行pip install locustio,报错提示:error: invalid command 'bdist_wheel'. 原因:pip和setuptools的版本较低. 解决方案:升级pip和setuptools. 一

命令行运行python项目文件,报错:ModuleNotFoundError: No module named 'xxxx' 解决办法

在pycharm中写好了自动化测试脚本,并能在pycharm中正常运行,由于要考虑到无人值守时能自动执行,执行时就需要脱离pycharm,直接能用命令执行.但是直接用命令执行用例文件:python3 D:\pycode\autotest_framework\case\run_case.py 结果报错,找不到模块 自动化项目的结构如下:用例run_case.py 和工具类utils下的工具 不在同一个文件夹下面.在脚本中需要导入包如: from utils.HTMLTestRunner impor

解决vs code中golang插件依赖安装失败问题

解决vs code中golang插件依赖安装失败问题 Installing github.com/nsf/gocode SUCCEEDED Installing github.com/uudashr/gopkgs/cmd/gopkgs SUCCEEDED Installing github.com/ramya-rao-a/go-outline FAILED Installing github.com/acroca/go-symbols FAILED Installing golang.org/x

eclipse 中离线安装activiti插件,报错“An error occurred while collecting items to be installed session context was:(...”

eclipse 中离线安装activiti插件,报错“An error occurred while collecting items to be installed session context was:(...” 按照文章:eclipse离线安装Activiti Designer插件,下载插件的两个离线安装文件,并按照步骤安装后,一直next后报错,如下: An error occurred while collecting items to be installed session co

python框架Scrapy报错TypeError: 'float' object is not iterable解决

原因是:Twisted版本高了. 解决办法: 只要把Twisted库降级到16.6.0即可: 1 pip3 install Twisted==16.6.0 2 3 注:Twisted16.6.0安装后,会自动卸载高版本的Twisted python框架Scrapy报错TypeError: 'float' object is not iterable解决

jsp页面中onsubmit="return checklogin();"报错解决办法

选择Window->Preferences->MyEclipse->Validation 去掉方框里的对号,然后Apply 然后点击Yes->然后再点击ok->Yes,就好了,如果你打开了那个出现错误jsp页面的话,请关掉重现打开就ok啦 jsp页面中onsubmit="return checklogin();"报错解决办法,布布扣,bubuko.com

MyEclipse中jsp的注释报错解决

jsp页面中注释报错: 出错现场:在eclipse中没有报错,在MyEclipse中报错. <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. --> Myeclipse的js中不会识别这样的标识 需要改成: //  To use express install, set to playerProductInstall.swf, otherwise the empty

eclipse中的js文件报错的解决办法

在使用别人的项目的时候,导入到eclipse中发现js文件报错,解决办法是关闭eclipse的js校验功能. 三个步骤: 1. Eclipse代码   右键点击项目->properties->Validation->Errors/Warming 将Enable Javascript Sematic validation前面的钩子去掉 2.打开.project 文件下面代码去掉 Eclipse代码   <buildCommand> <name>org.eclipse

python 链接codis 报错解决办法 command &#39;EXEC&#39; is not allowed

[[email protected] ceph]# python ../pkg/redisbase.py Traceback (most recent call last):   File "../pkg/redisbase.py", line 85, in redis_hget     values = self.pipe.execute()   File "/usr/lib/python2.7/site-packages/redis/client.py", li