Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppression #16

Closed
wants to merge 9 commits into from
Closed

Suppression #16

wants to merge 9 commits into from

Conversation

DanielNoord
Copy link
Owner

  • Add yourself to CONTRIBUTORS if you are a new contributor.
  • Add a ChangeLog entry describing what your PR does.
  • If it's a new feature, or an important bug fix, add a What's New entry in
    doc/whatsnew/<current release.rst>.
  • Write a good description on what the PR does.

Type of Changes

Type
🐛 Bug fix

Description

Also changes add_ignored_message() to make nodes parameter optional.
Closes pylint-dev#4212

DanielNoord and others added 9 commits September 23, 2021 08:21
This also adds a new method to ``MessagesHandlerMixIn`` which
adds messages to the list of the ignored messages without doing anything
else. This can be used to avoid ``useless-suppression`` false positives.
This closes pylint-dev#2366
* Update toml dependency from >=0.7.1 to >=0.9.2
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
…ylint-dev#5062)

* Add regression test for pylint-dev#4972 hang

* Fix loop in too-many-ancestors when an inheritance cycle is inferred

Ref pylint-dev#4972. If a class could be inferred as an ancestor of itself then
the implementation of _get_parents could get caught in an infinite loop,
forever adding itself to to_explore. This could be possible by
monkeypatching an ancestor after class definition like in the following
simplified example:

    class Fake(module.Cls):
        pass

    module.Cls = Fake

Reproducing this is fairly tricky, but this integration test shows the
behaviour as of 1e675ab:

    #!/bin/sh

    HERE=$(readlink -f .)
    VENV=$HERE/venv-repro
    PIP=$VENV/bin/pip

    python -m venv "$VENV"

    PYLINT=$VENV/bin/pylint

    # assume running in pylint dir
    $PIP install -e .
    $PIP install flask

    mkdir -p repro/flask/
    touch repro/__init__.py
    cat > repro/flask/__init__.py <<'EOF'
    import flask
    import repro.flask  # self-import necessary

    class Fake(flask.Flask):
        pass

    flask.Flask = Fake
    EOF

    echo +++ this is fine
    $PYLINT --rcfile=/dev/null -- repro/flask/
    echo +++ finished

    echo +++ this loops forever
    cd repro/; $PYLINT --rcfile=/dev/null -- flask/
    echo +++ should not reach here
* Add py-version requirement to checker docs

* Improve default value

* Improve option parser error message

* Fix py-version help text
Also changes ``add_ignored_message()`` to make ``nodes`` parameter
optional.
Closes pylint-dev#4212
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False-positive I0021: Useless suppression of 'line-too-long' (useless-suppression)
4 participants