Skip to content

Commit

Permalink
Merge branch 'PyCQA:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
i-likecheese committed Nov 22, 2022
2 parents 0b3276b + 73dfd82 commit be2bffe
Show file tree
Hide file tree
Showing 58 changed files with 580 additions and 407 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ on:
- labeled

permissions:
checks: read
contents: write
pull-requests: write
statuses: read

jobs:
backport:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/primer_comment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
# This needs to be the SAME as in the Main and PR job
CACHE_VERSION: 1
KEY_PREFIX: venv-primer
DEFAULT_PYTHON: "3.10"
DEFAULT_PYTHON: "3.11"

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/primer_run_main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
python-version: ["3.7", "3.10"]
python-version: ["3.7", "3.11"]
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.1.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/primer_run_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
timeout-minutes: 120
strategy:
matrix:
python-version: ["3.7", "3.10"]
python-version: ["3.7", "3.11"]
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.1.0
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ repos:
files: ^(doc/(.*/)*.*\.rst)
additional_dependencies: [Sphinx==5.0.1]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.990
rev: v0.991
hooks:
- id: mypy
name: mypy
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ contributors:
- Stéphane Wirtel <stephane@wirtel.be>: nonlocal-without-binding
- Stephen Longofono <8992396+SLongofono@users.noreply.github.com>
- Stanislav Levin <slev@altlinux.org>
- Smixi <sismixx@hotmail.fr>
- Sorin Sbarnea <ssbarnea@redhat.com>
- Slavfox <slavfoxman@gmail.com>
- Skip Montanaro <skip@pobox.com>
Expand Down
6 changes: 5 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,15 @@ Pylint ships with three additional tools:

- pyreverse_ (standalone tool that generates package and class diagrams.)
- symilar_ (duplicate code finder that is also integrated in pylint)
- epylint_ (Emacs and Flymake compatible Pylint)

.. _pyreverse: https://pylint.pycqa.org/en/latest/pyreverse.html
.. _symilar: https://pylint.pycqa.org/en/latest/symilar.html

The epylint_ Emacs package, which includes Flymake support, is now maintained
in `its own repository`_.

.. _epylint: https://pylint.pycqa.org/en/latest/user_guide/ide_integration/flymake-emacs.html
.. _its own repository: https://github.com/emacsorphanage/pylint

Projects that you might want to use alongside pylint include flake8_ (faster and simpler checks
with very few false positives), mypy_, pyright_ or pyre_ (typing checks), bandit_ (security
Expand Down
1 change: 1 addition & 0 deletions doc/data/messages/n/nested-min-max/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print(min(1, min(2, 3))) # [nested-min-max]
1 change: 1 addition & 0 deletions doc/data/messages/n/nested-min-max/good.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print(min(1, 2, 3))
4 changes: 4 additions & 0 deletions doc/data/messages/u/unbalanced-dict-unpacking/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FRUITS = {"apple": 2, "orange": 3, "mellon": 10}

for fruit, price in FRUITS.values(): # [unbalanced-dict-unpacking]
print(fruit)
4 changes: 4 additions & 0 deletions doc/data/messages/u/unbalanced-dict-unpacking/good.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FRUITS = {"apple": 2, "orange": 3, "mellon": 10}

for fruit, price in FRUITS.items():
print(fruit)
3 changes: 1 addition & 2 deletions doc/development_guide/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ Python program thanks to their APIs:

.. sourcecode:: python

from pylint import run_pylint, run_epylint, run_pyreverse, run_symilar
from pylint import run_pylint, run_pyreverse, run_symilar

run_pylint("--disable=C", "myfile.py")
run_epylint(...)
run_pyreverse(...)
run_symilar(...)

Expand Down
8 changes: 8 additions & 0 deletions doc/development_guide/contributor_guide/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ branch:
- Label the PR with `backport maintenance/X.Y-1.x`. (For example
`backport maintenance/2.3.x`)
- Squash the PR before merging (alternatively rebase if there's a single commit)
- (If the automated cherry-pick has conflicts)
- Add a `Needs backport` label and do it manually.
- You might alternatively also:
- Cherry-pick the changes that create the conflict if it's not a new feature before
doing the original PR cherry-pick manually.
- Decide to wait for the next minor to release the PR
- In any case upgrade the milestones in the original PR and newly cherry-picked PR
to match reality.
- Release a patch version

## Releasing a patch version
Expand Down
8 changes: 5 additions & 3 deletions doc/user_guide/checkers/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -990,8 +990,8 @@ Stdlib checker Messages
https://docs.python.org/3/library/subprocess.html#subprocess.run
:bad-thread-instantiation (W1506): *threading.Thread needs the target function*
The warning is emitted when a threading.Thread class is instantiated without
the target function being passed. By default, the first parameter is the
group param, not the target param.
the target function being passed as a kwarg or as a second argument. By
default, the first parameter is the group param, not the target param.


String checker
Expand Down Expand Up @@ -1309,7 +1309,9 @@ Variables checker Messages
variable is not defined in the module scope.
:self-cls-assignment (W0642): *Invalid assignment to %s in method*
Invalid assignment to self or cls in instance or class method respectively.
:unbalanced-tuple-unpacking (W0632): *Possible unbalanced tuple unpacking with sequence%s: left side has %d label(s), right side has %d value(s)*
:unbalanced-dict-unpacking (W0644): *Possible unbalanced dict unpacking with %s: left side has %d label%s, right side has %d value%s*
Used when there is an unbalanced dict unpacking in assignment or for loop
:unbalanced-tuple-unpacking (W0632): *Possible unbalanced tuple unpacking with sequence %s: left side has %d label%s, right side has %d value%s*
Used when there is an unbalanced tuple unpacking in assignment
:possibly-unused-variable (W0641): *Possibly unused variable %r*
Used when a variable is defined but might not be used. The possibility comes
Expand Down
8 changes: 4 additions & 4 deletions doc/user_guide/configuration/all-options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Standard Checkers

--ignore-paths
""""""""""""""
*Add files or directories matching the regular expressions patterns to the ignore-list. The regex matches against paths and can be in Posix or Windows format. Because '\' represents the directory delimiter on Windows systems, it can't be used as an escape character.*
*Add files or directories matching the regular expressions patterns to the ignore-list. The regex matches against paths and can be in Posix or Windows format. Because '\\' represents the directory delimiter on Windows systems, it can't be used as an escape character.*

**Default:** ``[]``

Expand Down Expand Up @@ -620,7 +620,7 @@ Standard Checkers
"""""""""""""""""""""""""""""""""""""""
*List of valid names for the first argument in a metaclass class method.*

**Default:** ``('cls',)``
**Default:** ``('mcs',)``



Expand All @@ -642,7 +642,7 @@ Standard Checkers
valid-classmethod-first-arg = ["cls"]
valid-metaclass-classmethod-first-arg = ["cls"]
valid-metaclass-classmethod-first-arg = ["mcs"]
Expand Down Expand Up @@ -798,7 +798,7 @@ Standard Checkers
""""""""""""""""""""""""
*Exceptions that will emit a warning when caught.*

**Default:** ``('BaseException', 'Exception')``
**Default:** ``('builtins.BaseException', 'builtins.Exception')``



Expand Down
10 changes: 4 additions & 6 deletions doc/user_guide/installation/ide_integration/flymake-emacs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ Using Pylint through Flymake in Emacs
=====================================

.. warning::
If you're reading this doc and are actually using flymake please
open a support question at https://github.com/PyCQA/pylint/issues/new/choose
and tell us, we don't have any maintainers for emacs and are thinking about
dropping the support.

.. TODO 3.0, do we still need to support flymake ?
The Emacs package now has its own repository and is looking for a maintainer.
If you're reading this doc and are interested in maintaining this package or
are actually using flymake please open an issue at
https://github.com/emacsorphanage/pylint/issues/new/choose

To enable Flymake for Python, insert the following into your .emacs:

Expand Down
1 change: 1 addition & 0 deletions doc/user_guide/messages/messages_overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ All messages in the warning category:
warning/super-without-brackets
warning/too-many-try-statements
warning/try-except-raise
warning/unbalanced-dict-unpacking
warning/unbalanced-tuple-unpacking
warning/undefined-loop-variable
warning/unknown-option-value
Expand Down
48 changes: 48 additions & 0 deletions doc/whatsnew/2/2.15/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,54 @@ Marc Byrne became a maintainer, welcome to the team !

.. towncrier release notes start
What's new in Pylint 2.15.6?
----------------------------
Release date: 2022-11-19


False Positives Fixed
---------------------

- Fix false positive for ``unhashable-member`` when subclassing ``dict`` and
using the subclass as a dictionary key.

Closes #7501 (`#7501 <https://github.com/PyCQA/pylint/issues/7501>`_)

- ``unnecessary-list-index-lookup`` will not be wrongly emitted if
``enumerate`` is called with ``start``.

Closes #7682 (`#7682 <https://github.com/PyCQA/pylint/issues/7682>`_)

- Don't warn about ``stop-iteration-return`` when using ``next()`` over
``itertools.cycle``.

Closes #7765 (`#7765 <https://github.com/PyCQA/pylint/issues/7765>`_)



Other Bug Fixes
---------------

- Messages sent to reporter are now copied so a reporter cannot modify the
message sent to other reporters.

Closes #7214 (`#7214 <https://github.com/PyCQA/pylint/issues/7214>`_)

- Fixes edge case of custom method named ``next`` raised an astroid error.

Closes #7610 (`#7610 <https://github.com/PyCQA/pylint/issues/7610>`_)

- Fix crash that happened when parsing files with unexpected encoding starting
with 'utf' like ``utf13``.

Closes #7661 (`#7661 <https://github.com/PyCQA/pylint/issues/7661>`_)

- Fix a crash when a child class with an ``__init__`` method inherits from a
parent class with an ``__init__`` class attribute.

Closes #7742 (`#7742 <https://github.com/PyCQA/pylint/issues/7742>`_)


What's new in Pylint 2.15.5?
----------------------------
Release date: 2022-10-21
Expand Down
4 changes: 4 additions & 0 deletions doc/whatsnew/fragments/5797.new_check
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Add new check called ``unbalanced-dict-unpacking`` to check for unbalanced dict unpacking
in assignment and for loops.

Closes #5797
3 changes: 3 additions & 0 deletions doc/whatsnew/fragments/5886.false_positive
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fix ``deprecated-method`` false positive when alias for method is similar to name of deprecated method.

Closes #5886
2 changes: 1 addition & 1 deletion doc/whatsnew/fragments/7214.bugfix
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Message send to reporter are now copied so a reporter cannot modify the message sent to other reporters.
Messages sent to reporter are now copied so a reporter cannot modify the message sent to other reporters.

Closes #7214
4 changes: 4 additions & 0 deletions doc/whatsnew/fragments/7546.new_check
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Added ``nested-min-max`` which flags ``min(1, min(2, 3))`` to simplify to
``min(1, 2, 3)``.

Closes #7546
5 changes: 5 additions & 0 deletions doc/whatsnew/fragments/7737.other
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
epylint is now deprecated and will be removed in pylint 3.0.0. All emacs and flymake related
files were removed and their support will now happen in an external repository :
https://github.com/emacsorphanage/pylint.

Closes #7737
4 changes: 4 additions & 0 deletions doc/whatsnew/fragments/7782.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Fix ``valid-metaclass-classmethod-first-arg`` default config value from "cls" to "mcs"
which would cause both a false-positive and false-negative.

Closes #7782
15 changes: 0 additions & 15 deletions elisp/pylint-flymake.el

This file was deleted.

Loading

0 comments on commit be2bffe

Please sign in to comment.