英文:
Ace linters - All annotations are of type error
问题
I'm using ace-linters for ace editor to perform linting for languages like python, sql, json etc. The linting works pretty good with the help of web workers. It returns the proper annotations. But all the annotations are marked as error type even if some of them, according to me, should be warning annotations. Please refer below example.
Is there a way to fix this issue? by either controlling the error codes or just the annotations as they are returned.
英文:
I m using ace-linters for ace editor to perform linting for languages like python, sql, json etc
The linting works pretty good with the help of web workers.
It returns the proper annotations.
But all the annotations are marked as error type even if some of them, according to me, should be warning annotations. Please refer below example
Is there a way to fix this issue? by either controlling the error codes or just the annotations as they are returned
[
{
"row": 0,
"column": 7,
"text": "F401 `pandas` imported but unused",
"type": "error"
},
{
"row": 2,
"column": 18,
"text": "F401 `pandas` imported but unused",
"type": "error"
},
{
"row": 2,
"column": 44,
"text": "F401 `numpy` imported but unused",
"type": "error"
},
{
"row": 3,
"column": 88,
"text": "E501 Line too long (136 > 88 characters)",
"type": "error"
},
{
"row": 6,
"column": 88,
"text": "E501 Line too long (112 > 88 characters)",
"type": "error"
},
{
"row": 8,
"column": 88,
"text": "E501 Line too long (93 > 88 characters)",
"type": "error"
},
{
"row": 10,
"column": 88,
"text": "E501 Line too long (173 > 88 characters)",
"type": "error"
},
{
"row": 12,
"column": 88,
"text": "E501 Line too long (90 > 88 characters)",
"type": "error"
},
{
"row": 14,
"column": 88,
"text": "E501 Line too long (101 > 88 characters)",
"type": "error"
},
{
"row": 18,
"column": 88,
"text": "E501 Line too long (128 > 88 characters)",
"type": "error"
}
]
答案1
得分: 2
你可以通过将要忽略的规则前缀提供给configuration
的ignore
属性来设置要忽略的规则列表:
languageProvider.setGlobalOptions("python", {
configuration: {
"ignore": ["E501", "F401"]
}
});
英文:
You could set the list of rules you want to ignore by providing their prefixes to the ignore
property of configuration
:
languageProvider.setGlobalOptions("python", {
configuration: {
"ignore": ["E501", "F401"]
}
});
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论