Git Product home page Git Product logo

Comments (3)

Pierre-Sassoulas avatar Pierre-Sassoulas commented on September 23, 2024

By sometime do you mean in the same environment when calling pylint multiple time ? Or are you using multiple interpreters or multiple environments (differing dependencies, OS, etc) ? Also you could upgrade pylint to 3.0.0a7 to see if the problem still exists :)

from pylint.

nbro10 avatar nbro10 commented on September 23, 2024

@Pierre-Sassoulas The exact same environment but with different command executions (where the command is poetry run pylint my_package tests docs scripts --enable=useless-suppression) - nothing else changes, just different executions of the same command can lead to different outputs (warning and no warning). I can't still upgrade pylint to the latest version because it's incompatible with Python 3.7, which my packages still supports (although we'll soon remove that support). This behaviour is really strange. This probably happening, I would guess, because something is not deterministic. Maybe the way the AST is parsed or the order of the execution of pylint on the different files.

from pylint.

Pierre-Sassoulas avatar Pierre-Sassoulas commented on September 23, 2024

So if I understand you well you launch once with --enable=useless-suppression and the other without ? The code you gave is not parseable (a.py:7:38: E0001: Parsing failed: 'unterminated string literal (detected at line 7) (<unknown>, line 7)' (syntax-error)) so I parsed the following using both option:

from pathlib import Path
from unittest import mock

MODULE_PATH = Path(__file__)

def whatever():
    mocks = mock.patch.multiple_targets(  # pylint: disable=no-member
        [
            mock.patch(MODULE_PATH + '.func1'),
            mock.patch(MODULE_PATH + '.func2'),
        ]
    )

I don't have any issues on main / python 3.11 with this snippet. We did change a lot of things since 2.14, and some for useless-suppression (maybe #7887 in 2.15, but there might be others), so it's probable it was fixed on main and sadly we don't support python 3.7 anymore. Please reopen an issue if you have a reproducer for more recent version of pylint.

from pylint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.