[Python] Using Ruff Linter with Python in VS Code

Discussão em 'Python' iniciado por Stack, Julho 2, 2025.

  1. Stack

    Stack Membro Participativo

    I have installed the Ruff extension and enabled it in VS Code, but it doesn't seem to be underlining my code at all and providing suggestions like my previous linters did.

    I did a clean install of VS Code, so most of the Python/Ruff extension settings are default. Is there an additional step I need to take to get it to start underlining my code and providing recommendations?

    Here is a screenshot:

    [​IMG]

    It's highlighting the imports for not being used, but I would expect other things to be highlighted like the line length, the additional spaces at the end of the file, not having 2 spaces before function declaration, etc.

    Here is the sample code as requested:

    import pandas as pd
    import numpy as np

    print('kkkkkkkkjlskdjflksdjflsdjflkdsjflksdjflkjdslkfjsdlkjflsdjflsdjfldsjflsdkjflsdjflksdjflksdjflksdjflskdjflsdkjfklsdjkl')
    def test_func(x):
    y=x+1
    return y

    Continue reading...

Compartilhe esta Página