pythonangularace-editor

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

[
    {
        "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"
    }
]

Solution

  • 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"]
        }
    });