Skip to content

Commit

Permalink
Merge branch 'main' into 3701-disallowed
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Dec 15, 2022
2 parents c72f340 + 117956a commit 0fa27a6
Show file tree
Hide file tree
Showing 212 changed files with 1,526 additions and 517 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
fetch-depth: 0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ on:
branches:
- main
- "maintenance/**"
pull_request: ~
pull_request:
branches:
- main
- "maintenance/**"

env:
CACHE_VERSION: 1
Expand Down Expand Up @@ -33,7 +36,7 @@ jobs:
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
Expand Down Expand Up @@ -87,7 +90,7 @@ jobs:
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
Expand Down Expand Up @@ -118,7 +121,7 @@ jobs:
- name: Install enchant and aspell
run: |
sudo apt-get update
sudo apt-get install enchant aspell-en
sudo apt-get install enchant-2 aspell-en
- name: Run pylint checks
run: |
. venv/bin/activate
Expand All @@ -136,7 +139,7 @@ jobs:
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
Expand Down Expand Up @@ -168,7 +171,7 @@ jobs:
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/primer-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
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 @@ -37,7 +37,7 @@ jobs:
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
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 @@ -35,7 +35,7 @@ jobs:
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
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 @@ -46,7 +46,7 @@ jobs:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ on:
branches:
- main
- "maintenance/**"
pull_request:
paths-ignore:
- doc/data/messages/**
pull_request:
branches:
- main
- "maintenance/**"

env:
CACHE_VERSION: 1
Expand All @@ -32,7 +35,7 @@ jobs:
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
Expand Down Expand Up @@ -88,7 +91,7 @@ jobs:
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
Expand Down Expand Up @@ -133,7 +136,7 @@ jobs:
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
Expand Down Expand Up @@ -191,7 +194,7 @@ jobs:
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
Expand Down Expand Up @@ -237,7 +240,7 @@ jobs:
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
Expand Down Expand Up @@ -281,7 +284,7 @@ jobs:
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.3.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
Expand Down
34 changes: 27 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
exclude: tests(/\w*)*/functional/t/trailing_whitespaces.py|tests/pyreverse/data/.*.html|doc/data/messages/t/trailing-whitespace/bad.py
Expand All @@ -15,7 +15,7 @@ repos:
doc/data/messages/t/trailing-newlines/bad.py|
)$
- repo: https://github.com/PyCQA/autoflake
rev: v1.7.7
rev: v2.0.0
hooks:
- id: autoflake
exclude: &fixtures tests(/\w*)*/functional/|tests/input|doc/data/messages|tests(/\w*)*data/
Expand All @@ -33,18 +33,18 @@ repos:
exclude: tests(/\w*)*/functional/|tests/input|doc/data/messages|examples/|setup.py|tests(/\w*)*data/
types: [python]
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.2
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py37-plus]
exclude: *fixtures
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.11.1
hooks:
- id: isort
exclude: doc/data/messages/(r/reimported|w/wrong-import-order|u/ungrouped-imports|m/misplaced-future|m/multiple-imports)/bad.py
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 22.12.0
hooks:
- id: black
args: [--safe, --quiet]
Expand All @@ -54,11 +54,11 @@ repos:
hooks:
- id: black-disable-checker
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
[flake8-bugbear==22.10.27, flake8-typing-imports==1.14.0]
[flake8-bugbear==22.12.6, flake8-typing-imports==1.14.0]
exclude: *fixtures
- repo: local
hooks:
Expand Down Expand Up @@ -132,3 +132,23 @@ repos:
exclude: *fixtures
args: ["--max-summary-lines=2", "--linewrap-full-docstring"]
files: "pylint"
- repo: https://github.com/regebro/pyroma
rev: "4.1"
hooks:
- id: pyroma
# Must be specified because of the default value in pyroma
always_run: false
files: |
(?x)^(
README.rst|
pyproject.toml|
pylint/__init__.py|
pylint/__pkginfo__.py|
setup.cfg
)$
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
args: ["-r", "-lll"]
exclude: *fixtures
8 changes: 5 additions & 3 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,34 +99,34 @@ contributors:
- Joseph Young <80432516+jpy-git@users.noreply.github.com> (jpy-git)
- Tim Martin <tim@asymptotic.co.uk>
- Nicolas Chauvat <nicolas.chauvat@logilab.fr>
- Tushar Sadhwani <tushar.sadhwani000@gmail.com> (tusharsadhwani)
- Radu Ciorba <radu@devrandom.ro>: not-context-manager and confusing-with-statement warnings.
- Holger Peters <email@holger-peters.de>
- Cosmin Poieană <cmin@ropython.org>: unichr-builtin and improvements to bad-open-mode.
- Tushar Sadhwani <tushar.sadhwani000@gmail.com> (tusharsadhwani)
- Steven Myint <hg@stevenmyint.com>: duplicate-except.
- Peter Kolbus <peter.kolbus@gmail.com> (Garmin)
- Luigi Bertaco Cristofolini <lucristofolini@gmail.com> (luigibertaco)
- Glenn Matthews <glenn@e-dad.net>:
* autogenerated documentation for optional extensions,
* bug fixes and enhancements for docparams (née check_docs) extension
- Dani Alcala <112832187+clavedeluna@users.noreply.github.com>
- Vlad Temian <vladtemian@gmail.com>: redundant-unittest-assert and the JSON reporter.
- Julien Jehannet <julien.jehannet@logilab.fr>
- Dani Alcala <112832187+clavedeluna@users.noreply.github.com>
- Boris Feld <lothiraldan@gmail.com>
- Anthony Sottile <asottile@umich.edu>
- Pedro Algarvio <pedro@algarvio.me> (s0undt3ch)
- Julien Palard <julien@palard.fr>
- David Liu <david@cs.toronto.edu> (david-yz-liu)
- Dan Goldsmith <djgoldsmith@googlemail.com>: support for msg-template in HTML reporter.
- Buck Evan <buck.2019@gmail.com>
- orSolocate <38433858+orSolocate@users.noreply.github.com>
- Mariatta Wijaya <Mariatta@users.noreply.github.com>
* Added new check `logging-fstring-interpolation`
* Documentation typo fixes
- Jakub Wilk <jwilk@jwilk.net>
- Eli Fine <ejfine@gmail.com> (eli88fine): Fixed false positive duplicate code warning for lines with symbols only
- Andrew Haigh <nelfin@gmail.com> (nelfin)
- Émile Crater <emile@crater.logilab.fr>
- orSolocate <38433858+orSolocate@users.noreply.github.com>
- Pavel Roskin <proski@gnu.org>
- David Gilman <davidgilman1@gmail.com>
- へーさん <hira9603859504@gmail.com>
Expand Down Expand Up @@ -478,11 +478,13 @@ contributors:
- Grégoire <96051754+gregoire-mullvad@users.noreply.github.com>
- Grant Welch <gwelch925+github@gmail.com>
- Giuseppe Valente <gvalente@arista.com>
- Gideon <87426140+GideonBear@users.noreply.github.com>
- Gary Tyler McLeod <mail@garytyler.com>
- Felix von Drigalski <FvDrigalski@gmail.com>
- Fabrice Douchant <Fabrice.Douchant@logilab.fr>
- Fabio Natali <me@fabionatali.com>
- Fabian Damken <fdamken+github@frisp.org>
- Eric McDonald <221418+emcd@users.noreply.github.com>
- Eric Froemling <ericfroemling@gmail.com>
- Emmanuel Chaudron <manu.chaud@hotmail.fr>
- Elizabeth Bott <52465744+elizabethbott@users.noreply.github.com>
Expand Down
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ ecosystem of existing plugins for popular frameworks and third party libraries.
to start is ``PyPI`` which often returns a plugin by searching for
``pylint <library>``. `pylint-pydantic`_, `pylint-django`_ and
`pylint-sonarjson`_ are examples of such plugins. More information about plugins
and how to load them can be found at :ref:`plugins <plugins>`.
and how to load them can be found at `plugins`_.

.. _`plugins`: https://pylint.pycqa.org/en/latest/development_guide/how_tos/plugins.html#plugins
.. _`pylint-pydantic`: https://pypi.org/project/pylint-pydantic
.. _`pylint-django`: https://github.com/PyCQA/pylint-django
.. _`pylint-sonarjson`: https://github.com/omegacen/pylint-sonarjson
Expand Down
7 changes: 7 additions & 0 deletions doc/data/messages/e/else-if-used/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if input():
pass
else:
if len(input()) >= 10: # [else-if-used]
pass
else:
pass
1 change: 0 additions & 1 deletion doc/data/messages/e/else-if-used/details.rst

This file was deleted.

7 changes: 6 additions & 1 deletion doc/data/messages/e/else-if-used/good.py
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
# This is a placeholder for correct code for this message.
if input():
pass
elif len(input()) >= 10:
pass
else:
pass
2 changes: 2 additions & 0 deletions doc/data/messages/e/else-if-used/pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[MAIN]
load-plugins=pylint.extensions.check_elif
6 changes: 6 additions & 0 deletions doc/data/messages/e/eq-without-hash/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Fruit: # [eq-without-hash]
def __init__(self) -> None:
self.name = "apple"

def __eq__(self, other: object) -> bool:
return isinstance(other, Fruit) and other.name == self.name
1 change: 0 additions & 1 deletion doc/data/messages/e/eq-without-hash/details.rst

This file was deleted.

10 changes: 9 additions & 1 deletion doc/data/messages/e/eq-without-hash/good.py
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
# This is a placeholder for correct code for this message.
class Fruit:
def __init__(self) -> None:
self.name = "apple"

def __eq__(self, other: object) -> bool:
return isinstance(other, Fruit) and other.name == self.name

def __hash__(self) -> int:
return hash(self.name)
2 changes: 2 additions & 0 deletions doc/data/messages/e/eq-without-hash/pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[MAIN]
load-plugins=pylint.extensions.eq_without_hash,
1 change: 1 addition & 0 deletions doc/data/messages/i/import-error/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from patlib import Path # [import-error]
4 changes: 3 additions & 1 deletion doc/data/messages/i/import-error/details.rst
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953>`_ !
This can happen if you're importing a package that is not installed in your environment, or if you made a typo.

The solution is to install the package via pip/setup.py/wheel or fix the typo.
2 changes: 1 addition & 1 deletion doc/data/messages/i/import-error/good.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# This is a placeholder for correct code for this message.
from pathlib import Path
5 changes: 5 additions & 0 deletions doc/data/messages/i/import-self/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from bad import a_function # [import-self]


def a_function():
pass
1 change: 0 additions & 1 deletion doc/data/messages/i/import-self/details.rst

This file was deleted.

Loading

0 comments on commit 0fa27a6

Please sign in to comment.