From b4264112ec10186d5465f7d6af9b2ab91a236216 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Fri, 25 Feb 2022 17:36:40 +0100 Subject: [PATCH 001/473] Add title in running pylint's documentation (#5837) * Easier to see title for how to run pylint Refer to #5836 * Clarify exit codes documentation and remove useless stderr output * Add import in the example with a TextReporter Closes #5836 * Move the Reporter explanation where Run is documented --- doc/user_guide/output.rst | 21 ------------- doc/user_guide/run.rst | 65 ++++++++++++++++++++++++++++----------- 2 files changed, 47 insertions(+), 39 deletions(-) diff --git a/doc/user_guide/output.rst b/doc/user_guide/output.rst index 1aa18f3b31..75b92ff80d 100644 --- a/doc/user_guide/output.rst +++ b/doc/user_guide/output.rst @@ -21,27 +21,6 @@ a colorized report to stdout at the same time: --output-format=json:somefile.json,colorized -Finally, it is possible to invoke pylint programmatically with a -reporter initialized with a custom stream: - -:: - - pylint_output = StringIO() # Custom open stream - reporter = text.TextReporter(pylint_output) - Run(["test_file.py"], reporter=reporter, do_exit=False) - print(pylint_output.getvalue()) # Retrieve and print the text report - -The reporter can accept any stream object as as parameter. In this example, -the stream outputs to a file: - -:: - - with open("report.out", "w") as f: - reporter = text.TextReporter(f) - Run(["test_file.py"], reporter=reporter, do_exit=False) - -This would be useful to capture pylint output in an open stream which -can be passed onto another program. Custom message formats '''''''''''''''''''''''''''' diff --git a/doc/user_guide/run.rst b/doc/user_guide/run.rst index 5501e23065..e49da5e517 100644 --- a/doc/user_guide/run.rst +++ b/doc/user_guide/run.rst @@ -2,8 +2,8 @@ Running Pylint ================ -Invoking Pylint ---------------- +From the command line +--------------------- Pylint is meant to be called from the command line. The usage is :: @@ -39,6 +39,9 @@ subtree of a directory, the ``--recursive=y`` option must be provided. For more details on this see the :ref:`faq`. +From another python program +--------------------------- + It is also possible to call Pylint from another Python program, thanks to the ``Run()`` function in the ``pylint.lint`` module (assuming Pylint options are stored in a list of strings ``pylint_options``) as: @@ -58,9 +61,7 @@ called by the command line. You can either patch ``sys.argv`` or supply argument sys.argv = ["pylint", "your_file"] pylint.run_pylint() - # Or: - pylint.run_pylint(argv=["your_file"]) To silently run Pylint on a ``module_name.py`` module, @@ -69,6 +70,7 @@ and get its standard output and error: .. sourcecode:: python from pylint import epylint as lint + (pylint_stdout, pylint_stderr) = lint.py_run('module_name.py', return_std=True) It is also possible to include additional Pylint options in the first argument to ``py_run``: @@ -76,11 +78,43 @@ It is also possible to include additional Pylint options in the first argument t .. sourcecode:: python from pylint import epylint as lint + (pylint_stdout, pylint_stderr) = lint.py_run('module_name.py --disable C0114', return_std=True) The options ``--msg-template="{path}:{line}: {category} ({msg_id}, {symbol}, {obj}) {msg}"`` and ``--reports=n`` are set implicitly inside the ``epylint`` module. +Finally, it is possible to invoke pylint programmatically with a +reporter initialized with a custom stream: + +.. sourcecode:: python + + from io import StringIO + + from pylint.lint import Run + from pylint.reporters.text import TextReporter + + pylint_output = StringIO() # Custom open stream + reporter = TextReporter(pylint_output) + Run(["test_file.py"], reporter=reporter, do_exit=False) + print(pylint_output.getvalue()) # Retrieve and print the text report + +The reporter can accept any stream object as as parameter. In this example, +the stream outputs to a file: + +.. sourcecode:: python + + from pylint.lint import Run + from pylint.reporters.text import TextReporter + + with open("report.out", "w") as f: + reporter = TextReporter(f) + Run(["test_file.py"], reporter=reporter, do_exit=False) + +This would be useful to capture pylint output in an open stream which +can be passed onto another program. + + Command line options -------------------- @@ -183,24 +217,19 @@ initialization hooks (i.e. the ``--init-hook`` option). Exit codes ---------- -Pylint returns bit-encoded exit codes. If applicable, the table below lists the related -stderr stream message output. +Pylint returns bit-encoded exit codes. -========= ========================= ========================================== -exit code meaning stderr stream message -========= ========================= ========================================== +========= ========================= +exit code meaning +========= ========================= 0 no error 1 fatal message issued 2 error message issued 4 warning message issued 8 refactor message issued 16 convention message issued -32 usage error - "internal error while receiving results\ - from child linter" "Error occurred, - stopping the linter." - - "" - - "Jobs number <#> should be greater \ - than 0" - - "" -========= ========================= ========================================== +32 usage error +========= ========================= + +For example, an exit code of ``20`` means there was at least one warning message (4) +and at least one convention message (16) and nothing else. From 15040ee7c42958606ae27aa32ccbe54371b83049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sat, 26 Feb 2022 10:30:21 +0100 Subject: [PATCH 002/473] Add some flags showing information to the CI pytest runs (#5841) --- .github/workflows/ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c735bb338e..e9f1ad2fb7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -224,7 +224,7 @@ jobs: - name: Run pytest run: | . venv/bin/activate - pytest --benchmark-disable --cov --cov-report= tests/ + pytest -vv --durations=20 --benchmark-disable --cov --cov-report= tests/ - name: Upload coverage artifact uses: actions/upload-artifact@v2.3.1 with: @@ -408,7 +408,7 @@ jobs: - name: Run pytest run: | . venv\\Scripts\\activate - pytest --benchmark-disable tests/ + pytest -vv --durations=20 --benchmark-disable tests/ prepare-tests-pypy: name: tests / prepare / ${{ matrix.python-version }} / Linux @@ -486,4 +486,4 @@ jobs: - name: Run pytest run: | . venv/bin/activate - pytest --benchmark-disable tests/ + pytest -vv --durations=20 --benchmark-disable tests/ From 5bdd5034c556d2d4986a365a666e923bccef2a94 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sat, 26 Feb 2022 12:35:25 +0100 Subject: [PATCH 003/473] Add a test to check that no old msgid or symbol are used (#5839) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add deleted msgid and symbol from the Python 3K+ checker and other deleted checks. See https://github.com/PyCQA/pylint/pull/4942 Closes #5729 Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> --- ChangeLog | 8 ++ doc/whatsnew/2.13.rst | 8 ++ pylint/checkers/__init__.py | 5 +- pylint/checkers/unsupported_version.py | 4 +- pylint/constants.py | 106 +++++++++++++++++- script/get_unused_message_id_category.py | 3 + .../test_no_removed_msgid_or_symbol_used.py | 17 +++ 7 files changed, 146 insertions(+), 5 deletions(-) create mode 100644 tests/message/test_no_removed_msgid_or_symbol_used.py diff --git a/ChangeLog b/ChangeLog index 6d1a12bcf8..e566e1da39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,14 @@ Release date: TBA .. Put new features here and also in 'doc/whatsnew/2.13.rst' +* ``using-f-string-in-unsupported-version`` and ``using-final-decorator-in-unsupported-version`` msgids + were renamed from ``W1601`` and ``W1602`` to ``W2601`` and ``W2602``. Disabling using these msgids will break. + This is done in order to restore consistency with the already existing msgids for ``apply-builtin`` and + ``basestring-builtin`` from the now deleted python 3K+ checker. There is now a check that we're not using + existing msgids or symbols from deleted checkers. + + Closes #5729 + * Add ``--recursive`` option to allow recursive discovery of all modules and packages in subtree. Running pylint with ``--recursive=y`` option will check all discovered ``.py`` files and packages found inside subtree of directory provided as parameter to pylint. diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 676860ee54..580f0b69df 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -92,6 +92,14 @@ Extensions Other Changes ============= +* ``using-f-string-in-unsupported-version`` and ``using-final-decorator-in-unsupported-version`` msgids + were renamed from ``W1601`` and ``W1602`` to ``W2601`` and ``W2602``. Disables using these msgids will break. + This is done in order to restore consistency with the already existing msgids for ``apply-builtin`` and + ``basestring-builtin`` from the now deleted python 3K+ checker. There is now a check that we're not using + existing msgids or symbols from deleted checkers. + + Closes #5729 + * Add ``--recursive`` option to allow recursive discovery of all modules and packages in subtree. Running pylint with ``--recursive=y`` option will check all discovered ``.py`` files and packages found inside subtree of directory provided as parameter to pylint. diff --git a/pylint/checkers/__init__.py b/pylint/checkers/__init__.py index e99560faa3..a79a381941 100644 --- a/pylint/checkers/__init__.py +++ b/pylint/checkers/__init__.py @@ -37,14 +37,15 @@ 13: string_format 14: string_constant 15: stdlib -16: python3 +16: python3 (This one was deleted but needs to be reserved for consistency with old messages) 17: refactoring . . . 24: non-ascii-names 25: unicode -26-50: not yet used: reserved for future internal checkers. +26: unsupported_version +27-50: not yet used: reserved for future internal checkers. This file is not updated. Use script/get_unused_message_id_category.py to get the next free checker id. diff --git a/pylint/checkers/unsupported_version.py b/pylint/checkers/unsupported_version.py index b3369b877f..7c82817c00 100644 --- a/pylint/checkers/unsupported_version.py +++ b/pylint/checkers/unsupported_version.py @@ -35,13 +35,13 @@ class UnsupportedVersionChecker(BaseChecker): __implements__ = (IAstroidChecker,) name = "unsupported_version" msgs = { - "W1601": ( + "W2601": ( "F-strings are not supported by all versions included in the py-version setting", "using-f-string-in-unsupported-version", "Used when the py-version set by the user is lower than 3.6 and pylint encounters " "a f-string.", ), - "W1602": ( + "W2602": ( "typing.final is not supported by all versions included in the py-version setting", "using-final-decorator-in-unsupported-version", "Used when the py-version set by the user is lower than 3.8 and pylint encounters " diff --git a/pylint/constants.py b/pylint/constants.py index 813cd54dd8..c3b94863dc 100644 --- a/pylint/constants.py +++ b/pylint/constants.py @@ -2,7 +2,7 @@ # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE import platform import sys -from typing import Dict +from typing import Dict, List, NamedTuple, Tuple import astroid import platformdirs @@ -72,3 +72,107 @@ class WarningScope: "class_const": "class constant", "inlinevar": "inline iteration", } + + +class DeletedMessage(NamedTuple): + msgid: str + symbol: str + old_names: List[Tuple[str, str]] = [] + + +DELETED_MSGID_PREFIXES = [ + 16, # the PY3K+ checker, see https://github.com/PyCQA/pylint/pull/4942 +] + +DELETED_MESSAGES = [ + # Everything until the next comment is from the + # PY3K+ checker, see https://github.com/PyCQA/pylint/pull/4942 + DeletedMessage("W1601", "apply-builtin"), + DeletedMessage("E1601", "print-statement"), + DeletedMessage("E1602", "parameter-unpacking"), + DeletedMessage( + "E1603", "unpacking-in-except", [("W0712", "old-unpacking-in-except")] + ), + DeletedMessage("E1604", "old-raise-syntax", [("W0121", "old-old-raise-syntax")]), + DeletedMessage("E1605", "backtick", [("W0333", "old-backtick")]), + DeletedMessage("E1609", "import-star-module-level"), + DeletedMessage("W1601", "apply-builtin"), + DeletedMessage("W1602", "basestring-builtin"), + DeletedMessage("W1603", "buffer-builtin"), + DeletedMessage("W1604", "cmp-builtin"), + DeletedMessage("W1605", "coerce-builtin"), + DeletedMessage("W1606", "execfile-builtin"), + DeletedMessage("W1607", "file-builtin"), + DeletedMessage("W1608", "long-builtin"), + DeletedMessage("W1609", "raw_input-builtin"), + DeletedMessage("W1610", "reduce-builtin"), + DeletedMessage("W1611", "standarderror-builtin"), + DeletedMessage("W1612", "unicode-builtin"), + DeletedMessage("W1613", "xrange-builtin"), + DeletedMessage("W1614", "coerce-method"), + DeletedMessage("W1615", "delslice-method"), + DeletedMessage("W1616", "getslice-method"), + DeletedMessage("W1617", "setslice-method"), + DeletedMessage("W1618", "no-absolute-import"), + DeletedMessage("W1619", "old-division"), + DeletedMessage("W1620", "dict-iter-method"), + DeletedMessage("W1621", "dict-view-method"), + DeletedMessage("W1622", "next-method-called"), + DeletedMessage("W1623", "metaclass-assignment"), + DeletedMessage( + "W1624", "indexing-exception", [("W0713", "old-indexing-exception")] + ), + DeletedMessage("W1625", "raising-string", [("W0701", "old-raising-string")]), + DeletedMessage("W1626", "reload-builtin"), + DeletedMessage("W1627", "oct-method"), + DeletedMessage("W1628", "hex-method"), + DeletedMessage("W1629", "nonzero-method"), + DeletedMessage("W1630", "cmp-method"), + DeletedMessage("W1632", "input-builtin"), + DeletedMessage("W1633", "round-builtin"), + DeletedMessage("W1634", "intern-builtin"), + DeletedMessage("W1635", "unichr-builtin"), + DeletedMessage( + "W1636", "map-builtin-not-iterating", [("W1631", "implicit-map-evaluation")] + ), + DeletedMessage("W1637", "zip-builtin-not-iterating"), + DeletedMessage("W1638", "range-builtin-not-iterating"), + DeletedMessage("W1639", "filter-builtin-not-iterating"), + DeletedMessage("W1640", "using-cmp-argument"), + DeletedMessage("W1641", "eq-without-hash"), + DeletedMessage("W1642", "div-method"), + DeletedMessage("W1643", "idiv-method"), + DeletedMessage("W1644", "rdiv-method"), + DeletedMessage("W1645", "exception-message-attribute"), + DeletedMessage("W1646", "invalid-str-codec"), + DeletedMessage("W1647", "sys-max-int"), + DeletedMessage("W1648", "bad-python3-import"), + DeletedMessage("W1649", "deprecated-string-function"), + DeletedMessage("W1650", "deprecated-str-translate-call"), + DeletedMessage("W1651", "deprecated-itertools-function"), + DeletedMessage("W1652", "deprecated-types-field"), + DeletedMessage("W1653", "next-method-defined"), + DeletedMessage("W1654", "dict-items-not-iterating"), + DeletedMessage("W1655", "dict-keys-not-iterating"), + DeletedMessage("W1656", "dict-values-not-iterating"), + DeletedMessage("W1657", "deprecated-operator-function"), + DeletedMessage("W1658", "deprecated-urllib-function"), + DeletedMessage("W1659", "xreadlines-attribute"), + DeletedMessage("W1660", "deprecated-sys-function"), + DeletedMessage("W1661", "exception-escape"), + DeletedMessage("W1662", "comprehension-escape"), + # https://github.com/PyCQA/pylint/pull/3578 + DeletedMessage("W0312", "mixed-indentation"), + # https://github.com/PyCQA/pylint/pull/3577 + DeletedMessage( + "C0326", + "bad-whitespace", + [ + ("C0323", "no-space-after-operator"), + ("C0324", "no-space-after-comma"), + ("C0322", "no-space-before-operator"), + ], + ), + # https://github.com/PyCQA/pylint/pull/3571 + DeletedMessage("C0330", "bad-continuation"), +] diff --git a/script/get_unused_message_id_category.py b/script/get_unused_message_id_category.py index 2741148c04..95d7ac3e30 100644 --- a/script/get_unused_message_id_category.py +++ b/script/get_unused_message_id_category.py @@ -5,6 +5,7 @@ from typing import List from pylint.checkers import initialize as initialize_checkers +from pylint.constants import DELETED_MSGID_PREFIXES from pylint.extensions import initialize as initialize_extensions from pylint.lint.pylinter import PyLinter @@ -18,6 +19,8 @@ def register_all_checkers_and_plugins(linter: "PyLinter") -> None: def get_next_code_category(message_ids: List[str]) -> int: categories = sorted({int(i[:2]) for i in message_ids}) + # We add the prefixes for deleted checkers + categories += DELETED_MSGID_PREFIXES for i in categories: if i + 1 not in categories: return i + 1 diff --git a/tests/message/test_no_removed_msgid_or_symbol_used.py b/tests/message/test_no_removed_msgid_or_symbol_used.py new file mode 100644 index 0000000000..c6ece36794 --- /dev/null +++ b/tests/message/test_no_removed_msgid_or_symbol_used.py @@ -0,0 +1,17 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE + +from pylint.constants import DELETED_MESSAGES +from pylint.lint import PyLinter + + +def test_no_removed_msgid_or_symbol_used(linter: PyLinter) -> None: + """Tests that we're not using deleted msgid or symbol. + + This could cause occasional bugs, but more importantly confusion and inconsistencies + when searching for old msgids online. See https://github.com/PyCQA/pylint/issues/5729 + """ + for msgid, symbol, old_names in DELETED_MESSAGES: + linter.msgs_store.message_id_store.register_message_definition( + msgid, symbol, old_names + ) From 90dafaef06809eab8fb1dda8bc0955b959fe1e23 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 27 Feb 2022 10:38:30 +0100 Subject: [PATCH 004/473] Add a testutil extra-require and add gitpython to it (#5842) Closes #5486 --- ChangeLog | 6 ++++++ doc/whatsnew/2.13.rst | 6 ++++++ requirements_test_min.txt | 3 +-- setup.cfg | 3 +++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e566e1da39..b6ba4becf2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,6 +43,12 @@ Release date: TBA Closes #5322 +* Added a ``testutil`` extra require to the packaging, as ``gitpython`` should not be a dependency + all the time but is still required to use the primer helper code in ``pylint.testutil``. You can + install it with ``pip install pylint[testutil]``. + + Closes #5486 + * Added several checkers to deal with unicode security issues (see `Trojan Sources `_ and `PEP 672 `_ for details) that also diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 580f0b69df..21f13c0048 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -254,6 +254,12 @@ Other Changes Closes #3793 +* Added a ``testutil`` extra require to the packaging, as ``gitpython`` should not be a dependency + all the time but is still required to use the primer helper code in ``pylint.testutil``. You can + install it with ``pip install pylint[testutil]``. + + Closes #5486 + * Fixed a false positive for ``used-before-assignment`` when a named expression appears as the first value in a container. diff --git a/requirements_test_min.txt b/requirements_test_min.txt index c2c82c5546..79f99044b4 100644 --- a/requirements_test_min.txt +++ b/requirements_test_min.txt @@ -1,6 +1,5 @@ --e . +-e .[testutil] # astroid dependency is also defined in setup.cfg astroid==2.9.3 # Pinned to a specific version for tests pytest~=7.0 pytest-benchmark~=3.4 -gitpython>3 diff --git a/setup.cfg b/setup.cfg index 1699b1f32d..26318dd7cb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -56,6 +56,9 @@ install_requires = typing-extensions>=3.10.0;python_version<"3.10" python_requires = >=3.6.2 +[options.extras_require] +testutil=gitpython>3 + [options.packages.find] include = pylint* From 843a8ff803c09e3963cdd93800400a181a5cf0b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Mar 2022 15:32:10 +0100 Subject: [PATCH 005/473] Bump actions/setup-python from 2.3.2 to 3 (#5849) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump actions/setup-python from 2.3.2 to 3 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2.3.2 to 3. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v2.3.2...v3) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Bump Cache Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> --- .github/workflows/ci.yaml | 28 ++++++++++++++-------------- .github/workflows/primer-test.yaml | 10 +++++----- .github/workflows/release.yml | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e9f1ad2fb7..3679aea615 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,7 @@ on: env: # Also change CACHE_VERSION in the primer workflow - CACHE_VERSION: 4 + CACHE_VERSION: 5 DEFAULT_PYTHON: 3.8 PRE_COMMIT_CACHE: ~/.cache/pre-commit @@ -28,7 +28,7 @@ jobs: fetch-depth: 0 - name: Set up Python ${{ env.DEFAULT_PYTHON }} id: python - uses: actions/setup-python@v2.3.2 + uses: actions/setup-python@v3.0.0 with: python-version: ${{ env.DEFAULT_PYTHON }} - name: Generate partial Python venv restore key @@ -84,7 +84,7 @@ jobs: uses: actions/checkout@v2.4.0 - name: Set up Python ${{ env.DEFAULT_PYTHON }} id: python - uses: actions/setup-python@v2.3.2 + uses: actions/setup-python@v3.0.0 with: python-version: ${{ env.DEFAULT_PYTHON }} - name: Restore Python virtual environment @@ -127,7 +127,7 @@ jobs: uses: actions/checkout@v2.4.0 - name: Set up Python ${{ env.DEFAULT_PYTHON }} id: python - uses: actions/setup-python@v2.3.2 + uses: actions/setup-python@v3.0.0 with: python-version: ${{ env.DEFAULT_PYTHON }} - name: Restore Python virtual environment @@ -164,7 +164,7 @@ jobs: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} id: python - uses: actions/setup-python@v2.3.2 + uses: actions/setup-python@v3.0.0 with: python-version: ${{ matrix.python-version }} - name: Generate partial Python venv restore key @@ -205,7 +205,7 @@ jobs: uses: actions/checkout@v2.4.0 - name: Set up Python ${{ matrix.python-version }} id: python - uses: actions/setup-python@v2.3.2 + uses: actions/setup-python@v3.0.0 with: python-version: ${{ matrix.python-version }} - name: Restore Python virtual environment @@ -246,7 +246,7 @@ jobs: uses: actions/checkout@v2.4.0 - name: Set up Python ${{ matrix.python-version }} id: python - uses: actions/setup-python@v2.3.2 + uses: actions/setup-python@v3.0.0 with: python-version: ${{ matrix.python-version }} - name: Restore Python virtual environment @@ -290,7 +290,7 @@ jobs: uses: actions/checkout@v2.4.0 - name: Set up Python ${{ matrix.python-version }} id: python - uses: actions/setup-python@v2.3.2 + uses: actions/setup-python@v3.0.0 with: python-version: ${{ matrix.python-version }} - name: Restore Python virtual environment @@ -344,7 +344,7 @@ jobs: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} id: python - uses: actions/setup-python@v2.3.2 + uses: actions/setup-python@v3.0.0 with: python-version: ${{ matrix.python-version }} - name: Generate partial Python venv restore key @@ -389,7 +389,7 @@ jobs: uses: actions/checkout@v2.4.0 - name: Set up Python ${{ matrix.python-version }} id: python - uses: actions/setup-python@v2.3.2 + uses: actions/setup-python@v3.0.0 with: python-version: ${{ matrix.python-version }} - name: Restore Python virtual environment @@ -416,7 +416,7 @@ jobs: timeout-minutes: 5 strategy: matrix: - python-version: ["pypy3"] + python-version: ["pypy-3.6"] outputs: python-key: ${{ steps.generate-python-key.outputs.key }} steps: @@ -426,7 +426,7 @@ jobs: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} id: python - uses: actions/setup-python@v2.3.2 + uses: actions/setup-python@v3.0.0 with: python-version: ${{ matrix.python-version }} - name: Generate partial Python venv restore key @@ -461,13 +461,13 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["pypy3"] + python-version: ["pypy-3.6"] steps: - name: Check out code from GitHub uses: actions/checkout@v2.4.0 - name: Set up Python ${{ matrix.python-version }} id: python - uses: actions/setup-python@v2.3.2 + uses: actions/setup-python@v3.0.0 with: python-version: ${{ matrix.python-version }} - name: Restore Python virtual environment diff --git a/.github/workflows/primer-test.yaml b/.github/workflows/primer-test.yaml index d32c68d9dd..ba2bc06b2e 100644 --- a/.github/workflows/primer-test.yaml +++ b/.github/workflows/primer-test.yaml @@ -14,7 +14,7 @@ on: env: # Also change CACHE_VERSION in the CI workflow - CACHE_VERSION: 4 + CACHE_VERSION: 5 concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -37,7 +37,7 @@ jobs: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} id: python - uses: actions/setup-python@v2.3.2 + uses: actions/setup-python@v3.0.0 with: python-version: ${{ matrix.python-version }} - name: Generate partial Python venv restore key @@ -77,7 +77,7 @@ jobs: uses: actions/checkout@v2.3.5 - name: Set up Python ${{ matrix.python-version }} id: python - uses: actions/setup-python@v2.3.2 + uses: actions/setup-python@v3.0.0 with: python-version: ${{ matrix.python-version }} - name: Restore Python virtual environment @@ -112,7 +112,7 @@ jobs: uses: actions/checkout@v2.3.5 - name: Set up Python ${{ matrix.python-version }} id: python - uses: actions/setup-python@v2.3.2 + uses: actions/setup-python@v3.0.0 with: python-version: ${{ matrix.python-version }} - name: Restore Python virtual environment @@ -147,7 +147,7 @@ jobs: uses: actions/checkout@v2.3.5 - name: Set up Python ${{ matrix.python-version }} id: python - uses: actions/setup-python@v2.3.2 + uses: actions/setup-python@v3.0.0 with: python-version: ${{ matrix.python-version }} - name: Restore Python virtual environment diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 74e14ee22b..5c58d52616 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v2.4.0 - name: Set up Python ${{ env.DEFAULT_PYTHON }} id: python - uses: actions/setup-python@v2.3.2 + uses: actions/setup-python@v3.0.0 with: python-version: ${{ env.DEFAULT_PYTHON }} - name: Install requirements From 182cc539b8154c0710fcea7e522267e42eba8899 Mon Sep 17 00:00:00 2001 From: Tim Martin Date: Wed, 2 Mar 2022 21:58:26 +0000 Subject: [PATCH 006/473] Use value directly instead of index in ``enumerate`` contexts (#5856) Refactoring to prevent warnings being issued on these lines from a new proposed checker. --- pylint/checkers/__init__.py | 6 +++--- pylint/checkers/refactoring/refactoring_checker.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pylint/checkers/__init__.py b/pylint/checkers/__init__.py index a79a381941..ab23b6b592 100644 --- a/pylint/checkers/__init__.py +++ b/pylint/checkers/__init__.py @@ -124,8 +124,8 @@ def table_lines_from_stats( ("error", "NC"), ] - for index, _ in enumerate(new): - new_value = new[index][1] + for index, value in enumerate(new): + new_value = value[1] old_value = old[index][1] diff_str = ( diff_string(old_value, new_value) @@ -134,7 +134,7 @@ def table_lines_from_stats( ) new_str = f"{new_value:.3f}" if isinstance(new_value, float) else str(new_value) old_str = f"{old_value:.3f}" if isinstance(old_value, float) else str(old_value) - lines.extend((new[index][0].replace("_", " "), new_str, old_str, diff_str)) + lines.extend((value[0].replace("_", " "), new_str, old_str, diff_str)) return lines diff --git a/pylint/checkers/refactoring/refactoring_checker.py b/pylint/checkers/refactoring/refactoring_checker.py index 1bf75e77e3..b727f1b632 100644 --- a/pylint/checkers/refactoring/refactoring_checker.py +++ b/pylint/checkers/refactoring/refactoring_checker.py @@ -578,12 +578,12 @@ def process_tokens(self, tokens): token_string = token[1] if token_string == "elif": # AST exists by the time process_tokens is called, so - # it's safe to assume tokens[index+1] - # exists. tokens[index+1][2] is the elif's position as + # it's safe to assume tokens[index+1] exists. + # tokens[index+1][2] is the elif's position as # reported by CPython and PyPy, - # tokens[index][2] is the actual position and also is + # token[2] is the actual position and also is # reported by IronPython. - self._elifs.extend([tokens[index][2], tokens[index + 1][2]]) + self._elifs.extend([token[2], tokens[index + 1][2]]) elif _is_trailing_comma(tokens, index): if self.linter.is_message_enabled("trailing-comma-tuple"): self.add_message("trailing-comma-tuple", line=token.start[0]) From a1df7685a4e6a05b519ea011f16a2f0d49d08032 Mon Sep 17 00:00:00 2001 From: dbrookman <53625739+dbrookman@users.noreply.github.com> Date: Fri, 4 Mar 2022 03:20:58 -0500 Subject: [PATCH 007/473] Fix matching note tags with a non-word char last (#5859) Using "\b" at the end of these patterns will only match note tags that end in an alphanumeric character, immediately followed by a non-alphanumeric character, or the end of the string. This is due to "\b" being defined as a boundary between a word character ("\w") and a non-word character ("\W"), or the end of the string. This leads to deviations like "???" being ignored when specified. Swapping "\b" for a positive lookahead that targets a whitespace, a colon, or the end of a string accounts for this. Closes #5840. --- CONTRIBUTORS.txt | 2 ++ ChangeLog | 4 ++++ doc/whatsnew/2.13.rst | 4 ++++ pylint/checkers/misc.py | 4 ++-- tests/checkers/unittest_misc.py | 10 ++++++++++ 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 66480ea6af..88ab429cf1 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -601,3 +601,5 @@ contributors: * Carli Freudenberg (CarliJoy): contributor - Fixed issue 5281, added Unicode checker - Improve non-ascii-name checker + +* Daniel Brookman: contributor diff --git a/ChangeLog b/ChangeLog index b6ba4becf2..fc5d18485b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,10 @@ Release date: TBA .. Put new features here and also in 'doc/whatsnew/2.13.rst' +* Fix matching ``--notes`` options that end in a non-word character. + + Closes #5840 + * ``using-f-string-in-unsupported-version`` and ``using-final-decorator-in-unsupported-version`` msgids were renamed from ``W1601`` and ``W1602`` to ``W2601`` and ``W2602``. Disabling using these msgids will break. This is done in order to restore consistency with the already existing msgids for ``apply-builtin`` and diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 21f13c0048..4954cada48 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -92,6 +92,10 @@ Extensions Other Changes ============= +* Fix matching ``--notes`` options that end in a non-word character. + + Closes #5840 + * ``using-f-string-in-unsupported-version`` and ``using-final-decorator-in-unsupported-version`` msgids were renamed from ``W1601`` and ``W1602`` to ``W2601`` and ``W2602``. Disables using these msgids will break. This is done in order to restore consistency with the already existing msgids for ``apply-builtin`` and diff --git a/pylint/checkers/misc.py b/pylint/checkers/misc.py index 69149e61a9..baec58fbbf 100644 --- a/pylint/checkers/misc.py +++ b/pylint/checkers/misc.py @@ -121,9 +121,9 @@ def open(self): notes = "|".join(re.escape(note) for note in self.config.notes) if self.config.notes_rgx: - regex_string = rf"#\s*({notes}|{self.config.notes_rgx})\b" + regex_string = rf"#\s*({notes}|{self.config.notes_rgx})(?=(:|\s|\Z))" else: - regex_string = rf"#\s*({notes})\b" + regex_string = rf"#\s*({notes})(?=(:|\s|\Z))" self._fixme_pattern = re.compile(regex_string, re.I) diff --git a/tests/checkers/unittest_misc.py b/tests/checkers/unittest_misc.py index 23e19a9d0f..bd15a932ed 100644 --- a/tests/checkers/unittest_misc.py +++ b/tests/checkers/unittest_misc.py @@ -68,6 +68,16 @@ def test_without_space_fixme(self) -> None: ): self.checker.process_tokens(_tokenize_str(code)) + @set_config(notes=["???"]) + def test_non_alphanumeric_codetag(self) -> None: + code = """a = 1 + #??? + """ + with self.assertAddsMessages( + MessageTest(msg_id="fixme", line=2, args="???", col_offset=17) + ): + self.checker.process_tokens(_tokenize_str(code)) + @set_config(notes=[]) def test_absent_codetag(self) -> None: code = """a = 1 From 4ca885fd8c35e6781a359cda0e4de2c0910973b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:36:56 +0100 Subject: [PATCH 008/473] Allow disabling ``duplicate-code`` with a disable comment (#5446) Co-authored-by: Pierre Sassoulas Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- ChangeLog | 5 + doc/whatsnew/2.13.rst | 5 + pylint/checkers/similar.py | 11 +- .../raw_strings_all}/__init__.py | 0 .../raw_strings_all}/first.py | 0 .../raw_strings_all}/second.py | 0 .../duplicate_code/raw_strings_all/third.py | 11 ++ .../raw_strings_disable_file/__init__.py | 0 .../raw_strings_disable_file/first.py | 12 ++ .../raw_strings_disable_file/second.py | 11 ++ .../raw_strings_disable_file/third.py | 11 ++ .../__init__.py | 0 .../raw_strings_disable_file_double/first.py | 12 ++ .../raw_strings_disable_file_double/second.py | 12 ++ .../raw_strings_disable_file_double/third.py | 11 ++ .../__init__.py | 0 .../raw_strings_disable_line_begin/first.py | 11 ++ .../raw_strings_disable_line_begin/second.py | 11 ++ .../__init__.py | 0 .../first.py | 11 ++ .../second.py | 11 ++ .../raw_strings_disable_line_end/__init__.py | 0 .../raw_strings_disable_line_end/first.py | 11 ++ .../raw_strings_disable_line_end/second.py | 11 ++ .../__init__.py | 0 .../raw_strings_disable_line_middle/first.py | 11 ++ .../raw_strings_disable_line_middle/second.py | 11 ++ .../raw_strings_disable_scope/__init__.py | 0 .../raw_strings_disable_scope/first.py | 12 ++ .../raw_strings_disable_scope/second.py | 11 ++ .../raw_strings_disable_scope/third.py | 11 ++ .../__init__.py | 0 .../raw_strings_disable_scope_double/first.py | 12 ++ .../second.py | 12 ++ .../raw_strings_disable_scope_double/third.py | 11 ++ .../__init__.py | 0 .../first.py | 21 +++ .../second.py | 20 +++ tests/test_self.py | 8 - tests/test_similar.py | 141 ++++++++++++++++++ 40 files changed, 439 insertions(+), 9 deletions(-) rename tests/regrtest_data/{duplicate_data_raw_strings => duplicate_code/raw_strings_all}/__init__.py (100%) rename tests/regrtest_data/{duplicate_data_raw_strings => duplicate_code/raw_strings_all}/first.py (100%) rename tests/regrtest_data/{duplicate_data_raw_strings => duplicate_code/raw_strings_all}/second.py (100%) create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_all/third.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_file/__init__.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_file/first.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_file/second.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_file/third.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/__init__.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/first.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/second.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/third.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_line_begin/__init__.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_line_begin/first.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_line_begin/second.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_line_disable_all/__init__.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_line_disable_all/first.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_line_disable_all/second.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_line_end/__init__.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_line_end/first.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_line_end/second.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_line_middle/__init__.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_line_middle/first.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_line_middle/second.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_scope/__init__.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_scope/first.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_scope/second.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_scope/third.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/__init__.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/first.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/second.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/third.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_scope_second_function/__init__.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_scope_second_function/first.py create mode 100644 tests/regrtest_data/duplicate_code/raw_strings_disable_scope_second_function/second.py create mode 100644 tests/test_similar.py diff --git a/ChangeLog b/ChangeLog index fc5d18485b..0b17299186 100644 --- a/ChangeLog +++ b/ChangeLog @@ -409,6 +409,11 @@ Release date: TBA Closes #4955 +* Allow disabling ``duplicate-code`` with a disable comment when running through + pylint. + + Closes #214 + .. Insert your changelog randomly, it will reduce merge conflicts (Ie. not necessarily at the end) diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 4954cada48..4acac1ace5 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -230,6 +230,11 @@ Other Changes Closes #5323 +* Allow disabling ``duplicate-code`` with a disable comment when running through + pylint. + + Closes #214 + * Fix false positive for ``undefined-variable`` when ``namedtuple`` class attributes are used as return annotations. diff --git a/pylint/checkers/similar.py b/pylint/checkers/similar.py index 113b086bc7..5287e31279 100644 --- a/pylint/checkers/similar.py +++ b/pylint/checkers/similar.py @@ -381,10 +381,19 @@ def append_stream( else: readlines = stream.readlines # type: ignore[assignment] # hint parameter is incorrectly typed as non-optional try: + active_lines: List[str] = [] + if hasattr(self, "linter"): + # Remove those lines that should be ignored because of disables + for index, line in enumerate(readlines()): + if self.linter._is_one_message_enabled("R0801", index + 1): # type: ignore[attr-defined] + active_lines.append(line) + else: + active_lines = readlines() + self.linesets.append( LineSet( streamid, - readlines(), + active_lines, self.ignore_comments, self.ignore_docstrings, self.ignore_imports, diff --git a/tests/regrtest_data/duplicate_data_raw_strings/__init__.py b/tests/regrtest_data/duplicate_code/raw_strings_all/__init__.py similarity index 100% rename from tests/regrtest_data/duplicate_data_raw_strings/__init__.py rename to tests/regrtest_data/duplicate_code/raw_strings_all/__init__.py diff --git a/tests/regrtest_data/duplicate_data_raw_strings/first.py b/tests/regrtest_data/duplicate_code/raw_strings_all/first.py similarity index 100% rename from tests/regrtest_data/duplicate_data_raw_strings/first.py rename to tests/regrtest_data/duplicate_code/raw_strings_all/first.py diff --git a/tests/regrtest_data/duplicate_data_raw_strings/second.py b/tests/regrtest_data/duplicate_code/raw_strings_all/second.py similarity index 100% rename from tests/regrtest_data/duplicate_data_raw_strings/second.py rename to tests/regrtest_data/duplicate_code/raw_strings_all/second.py diff --git a/tests/regrtest_data/duplicate_code/raw_strings_all/third.py b/tests/regrtest_data/duplicate_code/raw_strings_all/third.py new file mode 100644 index 0000000000..687c5922ed --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_all/third.py @@ -0,0 +1,11 @@ +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_file/__init__.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_file/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_file/first.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_file/first.py new file mode 100644 index 0000000000..fc7f0af615 --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_file/first.py @@ -0,0 +1,12 @@ +# pylint: disable=duplicate-code +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_file/second.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_file/second.py new file mode 100644 index 0000000000..687c5922ed --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_file/second.py @@ -0,0 +1,11 @@ +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_file/third.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_file/third.py new file mode 100644 index 0000000000..687c5922ed --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_file/third.py @@ -0,0 +1,11 @@ +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/__init__.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/first.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/first.py new file mode 100644 index 0000000000..fc7f0af615 --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/first.py @@ -0,0 +1,12 @@ +# pylint: disable=duplicate-code +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/second.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/second.py new file mode 100644 index 0000000000..fc7f0af615 --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/second.py @@ -0,0 +1,12 @@ +# pylint: disable=duplicate-code +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/third.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/third.py new file mode 100644 index 0000000000..687c5922ed --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/third.py @@ -0,0 +1,11 @@ +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_line_begin/__init__.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_begin/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_line_begin/first.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_begin/first.py new file mode 100644 index 0000000000..3f6182d23a --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_begin/first.py @@ -0,0 +1,11 @@ +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 # pylint: disable=duplicate-code + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_line_begin/second.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_begin/second.py new file mode 100644 index 0000000000..687c5922ed --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_begin/second.py @@ -0,0 +1,11 @@ +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_line_disable_all/__init__.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_disable_all/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_line_disable_all/first.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_disable_all/first.py new file mode 100644 index 0000000000..030b519e22 --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_disable_all/first.py @@ -0,0 +1,11 @@ +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 # pylint: disable=duplicate-code + yyyy = 2 # pylint: disable=duplicate-code + zzzz = 3 # pylint: disable=duplicate-code + wwww = 4 # pylint: disable=duplicate-code + vvvv = xxxx + yyyy + zzzz + wwww # pylint: disable=duplicate-code + return vvvv # pylint: disable=duplicate-code diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_line_disable_all/second.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_disable_all/second.py new file mode 100644 index 0000000000..687c5922ed --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_disable_all/second.py @@ -0,0 +1,11 @@ +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_line_end/__init__.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_end/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_line_end/first.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_end/first.py new file mode 100644 index 0000000000..97728fff4a --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_end/first.py @@ -0,0 +1,11 @@ +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv # pylint: disable=duplicate-code diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_line_end/second.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_end/second.py new file mode 100644 index 0000000000..687c5922ed --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_end/second.py @@ -0,0 +1,11 @@ +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_line_middle/__init__.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_middle/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_line_middle/first.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_middle/first.py new file mode 100644 index 0000000000..828b94c459 --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_middle/first.py @@ -0,0 +1,11 @@ +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 + yyyy = 2 + zzzz = 3 # pylint: disable=duplicate-code + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_line_middle/second.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_middle/second.py new file mode 100644 index 0000000000..687c5922ed --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_line_middle/second.py @@ -0,0 +1,11 @@ +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_scope/__init__.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_scope/first.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope/first.py new file mode 100644 index 0000000000..97e987edb3 --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope/first.py @@ -0,0 +1,12 @@ +r"""A raw docstring. +""" + + +def look_busy(): + # pylint: disable=duplicate-code + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_scope/second.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope/second.py new file mode 100644 index 0000000000..687c5922ed --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope/second.py @@ -0,0 +1,11 @@ +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_scope/third.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope/third.py new file mode 100644 index 0000000000..687c5922ed --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope/third.py @@ -0,0 +1,11 @@ +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/__init__.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/first.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/first.py new file mode 100644 index 0000000000..97e987edb3 --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/first.py @@ -0,0 +1,12 @@ +r"""A raw docstring. +""" + + +def look_busy(): + # pylint: disable=duplicate-code + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/second.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/second.py new file mode 100644 index 0000000000..97e987edb3 --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/second.py @@ -0,0 +1,12 @@ +r"""A raw docstring. +""" + + +def look_busy(): + # pylint: disable=duplicate-code + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/third.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/third.py new file mode 100644 index 0000000000..687c5922ed --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/third.py @@ -0,0 +1,11 @@ +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_second_function/__init__.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_second_function/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_second_function/first.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_second_function/first.py new file mode 100644 index 0000000000..ae2b088b56 --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_second_function/first.py @@ -0,0 +1,21 @@ +r"""A raw docstring. +""" + + +def look_busy(): + # pylint: disable=duplicate-code + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv + + +def look_busy_two(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_second_function/second.py b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_second_function/second.py new file mode 100644 index 0000000000..c3693ef374 --- /dev/null +++ b/tests/regrtest_data/duplicate_code/raw_strings_disable_scope_second_function/second.py @@ -0,0 +1,20 @@ +r"""A raw docstring. +""" + + +def look_busy(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv + + +def look_busy_two(): + xxxx = 1 + yyyy = 2 + zzzz = 3 + wwww = 4 + vvvv = xxxx + yyyy + zzzz + wwww + return vvvv diff --git a/tests/test_self.py b/tests/test_self.py index 61aa35d325..d22d2a5e48 100644 --- a/tests/test_self.py +++ b/tests/test_self.py @@ -1121,14 +1121,6 @@ def test_jobs_score(self) -> None: expected = "Your code has been rated at 7.50/10" self._test_output([path, "--jobs=2", "-ry"], expected_output=expected) - def test_duplicate_code_raw_strings(self) -> None: - path = join(HERE, "regrtest_data", "duplicate_data_raw_strings") - expected_output = "Similar lines in 2 files" - self._test_output( - [path, "--disable=all", "--enable=duplicate-code"], - expected_output=expected_output, - ) - def test_regression_parallel_mode_without_filepath(self) -> None: # Test that parallel mode properly passes filepath # https://github.com/PyCQA/pylint/issues/3564 diff --git a/tests/test_similar.py b/tests/test_similar.py new file mode 100644 index 0000000000..53c71cbd1c --- /dev/null +++ b/tests/test_similar.py @@ -0,0 +1,141 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE + + +import contextlib +import os +import re +import sys +import warnings +from io import StringIO +from os.path import abspath, dirname, join +from typing import Iterator, List, TextIO + +import pytest + +from pylint.lint import Run + +HERE = abspath(dirname(__file__)) +DATA = join(HERE, "regrtest_data", "duplicate_code") +CLEAN_PATH = re.escape(dirname(dirname(__file__)) + os.path.sep) + + +@contextlib.contextmanager +def _patch_streams(out: TextIO) -> Iterator: + sys.stderr = sys.stdout = out + try: + yield + finally: + sys.stderr = sys.__stderr__ + sys.stdout = sys.__stdout__ + + +class TestSimilarCodeChecker: + def _runtest(self, args: List[str], code: int) -> None: + """Runs the tests and sees if output code is as expected.""" + out = StringIO() + pylint_code = self._run_pylint(args, out=out) + output = out.getvalue() + msg = f"expected output status {code}, got {pylint_code}" + if output is not None: + msg = f"{msg}. Below pylint output: \n{output}" + assert pylint_code == code, msg + + @staticmethod + def _run_pylint(args: List[str], out: TextIO) -> int: + """Runs pylint with a patched output.""" + args = args + ["--persistent=no"] + with _patch_streams(out): + with pytest.raises(SystemExit) as cm: + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + Run(args) + return cm.value.code + + @staticmethod + def _clean_paths(output: str) -> str: + """Normalize path to the tests directory.""" + output = re.sub(CLEAN_PATH, "", output, flags=re.MULTILINE) + return output.replace("\\", "/") + + def _test_output(self, args: List[str], expected_output: str) -> None: + """Tests if the output of a pylint run is as expected.""" + out = StringIO() + self._run_pylint(args, out=out) + actual_output = self._clean_paths(out.getvalue()) + expected_output = self._clean_paths(expected_output) + assert expected_output.strip() in actual_output.strip() + + def test_duplicate_code_raw_strings_all(self) -> None: + """Test similar lines in 3 similar files.""" + path = join(DATA, "raw_strings_all") + expected_output = "Similar lines in 2 files" + self._test_output( + [path, "--disable=all", "--enable=duplicate-code"], + expected_output=expected_output, + ) + + def test_duplicate_code_raw_strings_disable_file(self) -> None: + """Tests disabling duplicate-code at the file level in a single file.""" + path = join(DATA, "raw_strings_disable_file") + expected_output = "Similar lines in 2 files" + self._test_output( + [path, "--disable=all", "--enable=duplicate-code"], + expected_output=expected_output, + ) + + def test_duplicate_code_raw_strings_disable_file_double(self) -> None: + """Tests disabling duplicate-code at the file level in two files.""" + path = join(DATA, "raw_strings_disable_file_double") + self._runtest([path, "--disable=all", "--enable=duplicate-code"], code=0) + + def test_duplicate_code_raw_strings_disable_line_two(self) -> None: + """Tests disabling duplicate-code at a line at the begin of a piece of similar code.""" + path = join(DATA, "raw_strings_disable_line_begin") + expected_output = "Similar lines in 2 files" + self._test_output( + [path, "--disable=all", "--enable=duplicate-code"], + expected_output=expected_output, + ) + + def test_duplicate_code_raw_strings_disable_line_disable_all(self) -> None: + """Tests disabling duplicate-code with all similar lines disabled per line.""" + path = join(DATA, "raw_strings_disable_line_disable_all") + self._runtest([path, "--disable=all", "--enable=duplicate-code"], code=0) + + def test_duplicate_code_raw_strings_disable_line_midle(self) -> None: + """Tests disabling duplicate-code at a line in the middle of a piece of similar code.""" + path = join(DATA, "raw_strings_disable_line_middle") + self._runtest([path, "--disable=all", "--enable=duplicate-code"], code=0) + + def test_duplicate_code_raw_strings_disable_line_end(self) -> None: + """Tests disabling duplicate-code at a line at the end of a piece of similar code.""" + path = join(DATA, "raw_strings_disable_line_end") + expected_output = "Similar lines in 2 files" + self._test_output( + [path, "--disable=all", "--enable=duplicate-code"], + expected_output=expected_output, + ) + + def test_duplicate_code_raw_strings_disable_scope(self) -> None: + """Tests disabling duplicate-code at an inner scope level.""" + path = join(DATA, "raw_strings_disable_scope") + expected_output = "Similar lines in 2 files" + self._test_output( + [path, "--disable=all", "--enable=duplicate-code"], + expected_output=expected_output, + ) + + def test_duplicate_code_raw_strings_disable_scope_double(self) -> None: + """Tests disabling duplicate-code at an inner scope level in two files.""" + path = join(DATA, "raw_strings_disable_scope_double") + self._runtest([path, "--disable=all", "--enable=duplicate-code"], code=0) + + def test_duplicate_code_raw_strings_disable_scope_function(self) -> None: + """Tests disabling duplicate-code at an inner scope level with another scope with similarity.""" + path = join(DATA, "raw_strings_disable_scope_second_function") + expected_output = "Similar lines in 2 files" + self._test_output( + [path, "--disable=all", "--enable=duplicate-code"], + expected_output=expected_output, + ) From 263ae7153b3168355f0a149831e56219bb7e862f Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Sun, 6 Mar 2022 15:50:21 -0500 Subject: [PATCH 009/473] Add stdlib xml.etree.cElementTree to deprecated modules (#5863) --- ChangeLog | 4 ++++ doc/whatsnew/2.13.rst | 4 ++++ pylint/checkers/stdlib.py | 1 + tests/functional/d/deprecated/deprecated_module_py33.py | 4 ++++ tests/functional/d/deprecated/deprecated_module_py33.txt | 1 + 5 files changed, 14 insertions(+) create mode 100644 tests/functional/d/deprecated/deprecated_module_py33.py create mode 100644 tests/functional/d/deprecated/deprecated_module_py33.txt diff --git a/ChangeLog b/ChangeLog index 0b17299186..76c92a0b78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -395,6 +395,10 @@ Release date: TBA Closes #258 +* Importing the deprecated stdlib module ``xml.etree.cElementTree`` now emits ``deprecated_module``. + + Closes #5862 + * ``missing-raises-doc`` will now check the class hierarchy of the raised exceptions .. code-block:: python diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 4acac1ace5..e7fc63b888 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -382,6 +382,10 @@ Other Changes * The ``testutils`` for unittests now accept ``end_lineno`` and ``end_column``. Tests without these will trigger a ``DeprecationWarning``. +* Importing the deprecated stdlib module ``xml.etree.cElementTree`` now emits ``deprecated_module``. + + Closes #5862 + * Fixed false positive ``unexpected-keyword-arg`` for decorators. Closes #258 diff --git a/pylint/checkers/stdlib.py b/pylint/checkers/stdlib.py index fe6113953e..864abf7349 100644 --- a/pylint/checkers/stdlib.py +++ b/pylint/checkers/stdlib.py @@ -73,6 +73,7 @@ DEPRECATED_MODULES = { (0, 0, 0): {"tkinter.tix", "fpectl"}, (3, 2, 0): {"optparse"}, + (3, 3, 0): {"xml.etree.cElementTree"}, (3, 4, 0): {"imp"}, (3, 5, 0): {"formatter"}, (3, 6, 0): {"asynchat", "asyncore"}, diff --git a/tests/functional/d/deprecated/deprecated_module_py33.py b/tests/functional/d/deprecated/deprecated_module_py33.py new file mode 100644 index 0000000000..a9fc2bda9c --- /dev/null +++ b/tests/functional/d/deprecated/deprecated_module_py33.py @@ -0,0 +1,4 @@ +"""Test deprecated modules from Python 3.3.""" +# pylint: disable=unused-import + +import xml.etree.cElementTree # [deprecated-module] diff --git a/tests/functional/d/deprecated/deprecated_module_py33.txt b/tests/functional/d/deprecated/deprecated_module_py33.txt new file mode 100644 index 0000000000..120a9abfdc --- /dev/null +++ b/tests/functional/d/deprecated/deprecated_module_py33.txt @@ -0,0 +1 @@ +deprecated-module:4:0:4:29::Uses of a deprecated module 'xml.etree.cElementTree':UNDEFINED From d91ef1890e5f09939a228ad6e0c05101f0fc2235 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Mar 2022 14:56:12 +0100 Subject: [PATCH 010/473] Bump actions/download-artifact from 2.1.0 to 3 (#5865) * Bump actions/download-artifact from 2.1.0 to 3 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2.1.0 to 3. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v2.1.0...v3) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Update .github/workflows/ci.yaml Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Pierre Sassoulas --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3679aea615..802f3a5739 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -263,7 +263,7 @@ jobs: echo "Failed to restore Python venv from cache" exit 1 - name: Download all coverage artifacts - uses: actions/download-artifact@v2.1.0 + uses: actions/download-artifact@v3.0.0 - name: Combine coverage results run: | . venv/bin/activate From 970c0d94443a045f2d3bd571ab29a01f5c5e14b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Mar 2022 17:10:09 +0100 Subject: [PATCH 011/473] Bump actions/checkout from 2.4.0 to 3.0.0 (#5866) * Bump actions/checkout from 2.4.0 to 3 Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2.4.0...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Pin 3.0.0 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> --- .github/workflows/ci.yaml | 22 +++++++++++----------- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/primer-test.yaml | 8 ++++---- .github/workflows/release.yml | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 802f3a5739..4d0ddd9fe2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,7 +23,7 @@ jobs: pre-commit-key: ${{ steps.generate-pre-commit-key.outputs.key }} steps: - name: Check out code from GitHub - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.0 with: fetch-depth: 0 - name: Set up Python ${{ env.DEFAULT_PYTHON }} @@ -81,7 +81,7 @@ jobs: needs: prepare-base steps: - name: Check out code from GitHub - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.0 - name: Set up Python ${{ env.DEFAULT_PYTHON }} id: python uses: actions/setup-python@v3.0.0 @@ -124,7 +124,7 @@ jobs: needs: prepare-base steps: - name: Check out code from GitHub - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.0 - name: Set up Python ${{ env.DEFAULT_PYTHON }} id: python uses: actions/setup-python@v3.0.0 @@ -159,7 +159,7 @@ jobs: python-key: ${{ steps.generate-python-key.outputs.key }} steps: - name: Check out code from GitHub - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.0 with: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} @@ -202,7 +202,7 @@ jobs: python-version: [3.6, 3.7, 3.8, 3.9, "3.10"] steps: - name: Check out code from GitHub - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.0 - name: Set up Python ${{ matrix.python-version }} id: python uses: actions/setup-python@v3.0.0 @@ -243,7 +243,7 @@ jobs: COVERAGERC_FILE: .coveragerc steps: - name: Check out code from GitHub - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.0 - name: Set up Python ${{ matrix.python-version }} id: python uses: actions/setup-python@v3.0.0 @@ -287,7 +287,7 @@ jobs: python-version: [3.8, 3.9] steps: - name: Check out code from GitHub - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.0 - name: Set up Python ${{ matrix.python-version }} id: python uses: actions/setup-python@v3.0.0 @@ -339,7 +339,7 @@ jobs: python-key: ${{ steps.generate-python-key.outputs.key }} steps: - name: Check out code from GitHub - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.0 with: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} @@ -386,7 +386,7 @@ jobs: # Workaround to set correct temp directory on Windows # https://github.com/actions/virtual-environments/issues/712 - name: Check out code from GitHub - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.0 - name: Set up Python ${{ matrix.python-version }} id: python uses: actions/setup-python@v3.0.0 @@ -421,7 +421,7 @@ jobs: python-key: ${{ steps.generate-python-key.outputs.key }} steps: - name: Check out code from GitHub - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.0 with: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} @@ -464,7 +464,7 @@ jobs: python-version: ["pypy-3.6"] steps: - name: Check out code from GitHub - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.0 - name: Set up Python ${{ matrix.python-version }} id: python uses: actions/setup-python@v3.0.0 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 26c0eea1c1..29493d2071 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,7 +39,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.0 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/primer-test.yaml b/.github/workflows/primer-test.yaml index ba2bc06b2e..566fc3ecea 100644 --- a/.github/workflows/primer-test.yaml +++ b/.github/workflows/primer-test.yaml @@ -32,7 +32,7 @@ jobs: python-key: ${{ steps.generate-python-key.outputs.key }} steps: - name: Check out code from GitHub - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.0 with: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} @@ -74,7 +74,7 @@ jobs: python-version: [3.8, 3.9, "3.10"] steps: - name: Check out code from GitHub - uses: actions/checkout@v2.3.5 + uses: actions/checkout@v3.0.0 - name: Set up Python ${{ matrix.python-version }} id: python uses: actions/setup-python@v3.0.0 @@ -109,7 +109,7 @@ jobs: python-version: [3.8, 3.9, "3.10"] steps: - name: Check out code from GitHub - uses: actions/checkout@v2.3.5 + uses: actions/checkout@v3.0.0 - name: Set up Python ${{ matrix.python-version }} id: python uses: actions/setup-python@v3.0.0 @@ -144,7 +144,7 @@ jobs: python-version: [3.8, 3.9, "3.10"] steps: - name: Check out code from GitHub - uses: actions/checkout@v2.3.5 + uses: actions/checkout@v3.0.0 - name: Set up Python ${{ matrix.python-version }} id: python uses: actions/setup-python@v3.0.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c58d52616..1bf53bf711 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code from Github - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.0 - name: Set up Python ${{ env.DEFAULT_PYTHON }} id: python uses: actions/setup-python@v3.0.0 From 499a5306fcc2a46c7431354e087df0edffb6f3d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Mar 2022 17:10:55 +0100 Subject: [PATCH 012/473] Bump actions/upload-artifact from 2.3.1 to 3.0.0 (#5867) * Bump actions/upload-artifact from 2.3.1 to 3 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.3.1 to 3. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v2.3.1...v3) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Pin 3.0.0 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4d0ddd9fe2..0ab58deb44 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -226,7 +226,7 @@ jobs: . venv/bin/activate pytest -vv --durations=20 --benchmark-disable --cov --cov-report= tests/ - name: Upload coverage artifact - uses: actions/upload-artifact@v2.3.1 + uses: actions/upload-artifact@v3.0.0 with: name: coverage-${{ matrix.python-version }} path: .coverage @@ -321,7 +321,7 @@ jobs: run: >- echo "::set-output name=datetime::"$(date "+%Y%m%d_%H%M") - name: Upload benchmark artifact - uses: actions/upload-artifact@v2.3.1 + uses: actions/upload-artifact@v3.0.0 with: name: benchmark-${{ runner.os }}-${{ matrix.python-version }}_${{ From c80bf2a7579545f381e71dd33adf6b3517a7651d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=A9o=20Bouvard?= Date: Mon, 7 Mar 2022 20:18:10 +0100 Subject: [PATCH 013/473] Fix Markdown link in ReStructuredText README (#5870) This commit updates a link formatted using Markdown syntax to use ReStructuredText syntax, which is what the README file is written in. This allows a prettier link visualization in GitHub, by not displaying the full URL between parentheses. --- README.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.rst b/README.rst index fb24114476..4967a00f9e 100644 --- a/README.rst +++ b/README.rst @@ -168,8 +168,7 @@ Use the badge in your project's README.rst (or any other rst file):: If you use GitHub Actions, and one of your CI workflows begins with "name: pylint", you -can use GitHub's -[workflow status badges](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge#using-the-workflow-file-name) +can use GitHub's `workflow status badges `_ to show an up-to-date indication of whether pushes to your default branch pass pylint. For more detailed information, check the documentation. From 942246f7572777d71f0fec7dc911dc25834cdb41 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Mon, 7 Mar 2022 20:22:10 +0100 Subject: [PATCH 014/473] Improve CI workflow (#5868) * Update timeouts [ci] * Fix pypy cache key [ci] * Stage different jobs [ci] --- .github/workflows/ci.yaml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0ab58deb44..06945c50fb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,7 +17,7 @@ jobs: prepare-base: name: Prepare base dependencies runs-on: ubuntu-latest - timeout-minutes: 5 + timeout-minutes: 10 outputs: python-key: ${{ steps.generate-python-key.outputs.key }} pre-commit-key: ${{ steps.generate-pre-commit-key.outputs.key }} @@ -77,7 +77,7 @@ jobs: formatting: name: checks / pre-commit runs-on: ubuntu-latest - timeout-minutes: 5 + timeout-minutes: 10 needs: prepare-base steps: - name: Check out code from GitHub @@ -151,7 +151,7 @@ jobs: prepare-tests-linux: name: tests / prepare / ${{ matrix.python-version }} / Linux runs-on: ubuntu-latest - timeout-minutes: 5 + timeout-minutes: 10 strategy: matrix: python-version: [3.6, 3.7, 3.8, 3.9, "3.10"] @@ -194,7 +194,7 @@ jobs: pytest-linux: name: tests / run / ${{ matrix.python-version }} / Linux runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 15 needs: prepare-tests-linux strategy: fail-fast: false @@ -279,8 +279,8 @@ jobs: benchmark-linux: name: tests / run benchmark / ${{ matrix.python-version }} / Linux runs-on: ubuntu-latest - timeout-minutes: 5 - needs: prepare-tests-linux + timeout-minutes: 10 + needs: ["prepare-tests-linux", "pytest-linux"] strategy: fail-fast: false matrix: @@ -331,7 +331,8 @@ jobs: prepare-tests-windows: name: tests / prepare / ${{ matrix.python-version }} / Windows runs-on: windows-latest - timeout-minutes: 5 + timeout-minutes: 10 + needs: pytest-linux strategy: matrix: python-version: [3.6, 3.7, 3.8, 3.9, "3.10"] @@ -374,7 +375,7 @@ jobs: pytest-windows: name: tests / run / ${{ matrix.python-version }} / Windows runs-on: windows-latest - timeout-minutes: 10 + timeout-minutes: 15 needs: prepare-tests-windows strategy: fail-fast: false @@ -413,7 +414,7 @@ jobs: prepare-tests-pypy: name: tests / prepare / ${{ matrix.python-version }} / Linux runs-on: ubuntu-latest - timeout-minutes: 5 + timeout-minutes: 10 strategy: matrix: python-version: ["pypy-3.6"] @@ -441,10 +442,10 @@ jobs: with: path: venv key: >- - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ + ${{ runner.os }}-${{ matrix.python-version }}-${{ steps.generate-python-key.outputs.key }} restore-keys: | - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{ env.CACHE_VERSION }}- + ${{ runner.os }}-${{ matrix.python-version }}-venv-${{ env.CACHE_VERSION }}- - name: Create Python virtual environment if: steps.cache-venv.outputs.cache-hit != 'true' run: | @@ -456,7 +457,7 @@ jobs: pytest-pypy: name: tests / run / ${{ matrix.python-version }} / Linux runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 15 needs: prepare-tests-pypy strategy: fail-fast: false @@ -476,7 +477,7 @@ jobs: with: path: venv key: - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ + ${{ runner.os }}-${{ matrix.python-version }}-${{ needs.prepare-tests-pypy.outputs.python-key }} - name: Fail job if Python cache restore failed if: steps.cache-venv.outputs.cache-hit != 'true' From 6dd80f3d2d8b87e5ecdffd28a7d1c34b07a3c984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=A9o=20Bouvard?= Date: Mon, 7 Mar 2022 20:34:52 +0100 Subject: [PATCH 015/473] Fix pre-commit configuration hook URL (#5869) Removing the final slash in the `repo` url prevents git from not being able to clone the repository. --- .pre-commit-config.yaml | 2 +- CONTRIBUTORS.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0757c41c10..e3a1ad58f6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: - id: black args: [--safe, --quiet] exclude: *fixtures - - repo: https://github.com/Pierre-Sassoulas/black-disable-checker/ + - repo: https://github.com/Pierre-Sassoulas/black-disable-checker rev: 1.0.1 hooks: - id: black-disable-checker diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 88ab429cf1..491a49dc1a 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -603,3 +603,5 @@ contributors: - Improve non-ascii-name checker * Daniel Brookman: contributor + +* Téo Bouvard: contributor From 4649153dae5d55b3ac01787a7a61b25624077526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Tue, 1 Mar 2022 15:32:49 +0100 Subject: [PATCH 016/473] Also test on PyPy 3.7 --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 06945c50fb..0ead6e5d76 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -417,7 +417,7 @@ jobs: timeout-minutes: 10 strategy: matrix: - python-version: ["pypy-3.6"] + python-version: ["pypy-3.6", "pypy-3.7"] outputs: python-key: ${{ steps.generate-python-key.outputs.key }} steps: @@ -462,7 +462,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["pypy-3.6"] + python-version: ["pypy-3.6", "pypy-3.7"] steps: - name: Check out code from GitHub uses: actions/checkout@v3.0.0 From 444e9e1a6e67dba23d050e638ae027ee44414a08 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Tue, 8 Mar 2022 11:01:40 +0100 Subject: [PATCH 017/473] Restore the useful part of the python3 checker (#5843) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Reinstate checks from the python3 checker that are still useful for py3 Closes #5025 Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> --- ChangeLog | 6 +++ doc/whatsnew/2.13.rst | 6 +++ pylint/constants.py | 5 +-- pylint/extensions/__init__.py | 2 +- pylint/extensions/code_style.py | 2 +- pylint/extensions/eq_without_hash.py | 39 +++++++++++++++++++ .../ext/eq_without_hash/eq_without_hash.py | 11 ++++++ .../ext/eq_without_hash/eq_without_hash.rc | 2 + .../ext/eq_without_hash/eq_without_hash.txt | 1 + 9 files changed, 68 insertions(+), 6 deletions(-) create mode 100644 pylint/extensions/eq_without_hash.py create mode 100644 tests/functional/ext/eq_without_hash/eq_without_hash.py create mode 100644 tests/functional/ext/eq_without_hash/eq_without_hash.rc create mode 100644 tests/functional/ext/eq_without_hash/eq_without_hash.txt diff --git a/ChangeLog b/ChangeLog index 76c92a0b78..51bc84fc54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -53,6 +53,12 @@ Release date: TBA Closes #5486 +* Reinstated checks from the python3 checker that are still useful for python 3 + (``eq-without-hash``). This is now in the ``pylint.extensions.eq_without_hash`` optional + extension. + + Closes #5025 + * Added several checkers to deal with unicode security issues (see `Trojan Sources `_ and `PEP 672 `_ for details) that also diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index e7fc63b888..6fe17d9956 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -110,6 +110,12 @@ Other Changes Closes #352 +* Reinstated checks from the python3 checker that are still useful for python 3 + (``eq-without-hash``). This is now in the ``pylint.extensions.eq_without_hash`` optional + extension. + + Closes #5025 + * Fix false-negative for ``assignment-from-none`` checker with list.sort() method. Closes #5722 diff --git a/pylint/constants.py b/pylint/constants.py index c3b94863dc..1a06ea8329 100644 --- a/pylint/constants.py +++ b/pylint/constants.py @@ -80,9 +80,7 @@ class DeletedMessage(NamedTuple): old_names: List[Tuple[str, str]] = [] -DELETED_MSGID_PREFIXES = [ - 16, # the PY3K+ checker, see https://github.com/PyCQA/pylint/pull/4942 -] +DELETED_MSGID_PREFIXES: List[int] = [] DELETED_MESSAGES = [ # Everything until the next comment is from the @@ -139,7 +137,6 @@ class DeletedMessage(NamedTuple): DeletedMessage("W1638", "range-builtin-not-iterating"), DeletedMessage("W1639", "filter-builtin-not-iterating"), DeletedMessage("W1640", "using-cmp-argument"), - DeletedMessage("W1641", "eq-without-hash"), DeletedMessage("W1642", "div-method"), DeletedMessage("W1643", "idiv-method"), DeletedMessage("W1644", "rdiv-method"), diff --git a/pylint/extensions/__init__.py b/pylint/extensions/__init__.py index c348361019..4af3aefb17 100644 --- a/pylint/extensions/__init__.py +++ b/pylint/extensions/__init__.py @@ -10,7 +10,7 @@ def initialize(linter: "PyLinter") -> None: - """Initialize linter with checkers in the extensions directory.""" + """Initialize linter with checkers in the extensions' directory.""" register_plugins(linter, __path__[0]) diff --git a/pylint/extensions/code_style.py b/pylint/extensions/code_style.py index 7082c991ce..5a3e3ba17d 100644 --- a/pylint/extensions/code_style.py +++ b/pylint/extensions/code_style.py @@ -28,7 +28,7 @@ class CodeStyleChecker(BaseChecker): i.e. detect a common issue or improve performance => it should probably be part of the core checker classes 2. Is it something that would improve code consistency, - maybe because it's slightly better with regards to performance + maybe because it's slightly better with regard to performance and therefore preferred => this is the right place 3. Everything else should go into another extension """ diff --git a/pylint/extensions/eq_without_hash.py b/pylint/extensions/eq_without_hash.py new file mode 100644 index 0000000000..b0dd6ce46f --- /dev/null +++ b/pylint/extensions/eq_without_hash.py @@ -0,0 +1,39 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE + +"""This is the remnant of the python3 checker. It was removed because +the transition from python 2 to python3 is behind us, but some checks +are still useful in python3 after all. +See https://github.com/PyCQA/pylint/issues/5025 +""" + +from astroid import nodes + +from pylint import checkers, interfaces +from pylint.checkers import utils +from pylint.lint import PyLinter + + +class EqWithoutHash(checkers.BaseChecker): + + __implements__ = interfaces.IAstroidChecker + name = "eq-without-hash" + + msgs = { + "W1641": ( + "Implementing __eq__ without also implementing __hash__", + "eq-without-hash", + "Used when a class implements __eq__ but not __hash__. Objects get " + "None as their default __hash__ implementation if they also implement __eq__.", + ), + } + + @utils.check_messages("eq-without-hash") + def visit_classdef(self, node: nodes.ClassDef) -> None: + locals_and_methods = set(node.locals).union(x.name for x in node.mymethods()) + if "__eq__" in locals_and_methods and "__hash__" not in locals_and_methods: + self.add_message("eq-without-hash", node=node, confidence=interfaces.HIGH) + + +def register(linter: PyLinter) -> None: + linter.register_checker(EqWithoutHash(linter)) diff --git a/tests/functional/ext/eq_without_hash/eq_without_hash.py b/tests/functional/ext/eq_without_hash/eq_without_hash.py new file mode 100644 index 0000000000..a28afc97bb --- /dev/null +++ b/tests/functional/ext/eq_without_hash/eq_without_hash.py @@ -0,0 +1,11 @@ +"""Regression test for #5025""" + +# pylint: disable=invalid-name, missing-docstring, too-few-public-methods + + +class AClass: # [eq-without-hash] + def __init__(self) -> None: + self.x = 5 + + def __eq__(self, other: object) -> bool: + return isinstance(other, AClass) and other.x == self.x diff --git a/tests/functional/ext/eq_without_hash/eq_without_hash.rc b/tests/functional/ext/eq_without_hash/eq_without_hash.rc new file mode 100644 index 0000000000..5a4c9fcce3 --- /dev/null +++ b/tests/functional/ext/eq_without_hash/eq_without_hash.rc @@ -0,0 +1,2 @@ +[MASTER] +load-plugins=pylint.extensions.eq_without_hash, diff --git a/tests/functional/ext/eq_without_hash/eq_without_hash.txt b/tests/functional/ext/eq_without_hash/eq_without_hash.txt new file mode 100644 index 0000000000..b7e2dc46da --- /dev/null +++ b/tests/functional/ext/eq_without_hash/eq_without_hash.txt @@ -0,0 +1 @@ +eq-without-hash:6:0:11:62:AClass:Implementing __eq__ without also implementing __hash__:HIGH From 6c0ba130730e82fc21063f138ffd05347bea0b9e Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Tue, 8 Mar 2022 07:31:25 -0500 Subject: [PATCH 018/473] Removed unused detection of site-packages directory (#5874) --- pylint/checkers/imports.py | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/pylint/checkers/imports.py b/pylint/checkers/imports.py index bd368a2c59..96e0066eba 100644 --- a/pylint/checkers/imports.py +++ b/pylint/checkers/imports.py @@ -50,8 +50,6 @@ import collections import copy import os -import sys -from distutils import sysconfig from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Tuple, Union import astroid @@ -441,33 +439,6 @@ def __init__(self, linter: Optional["PyLinter"] = None) -> None: ("RP0402", "Modules dependencies graph", self._report_dependencies_graph), ) - self._site_packages = self._compute_site_packages() - - @staticmethod - def _compute_site_packages(): - def _normalized_path(path): - return os.path.normcase(os.path.abspath(path)) - - paths = set() - real_prefix = getattr(sys, "real_prefix", None) - for prefix in filter(None, (real_prefix, sys.prefix)): - path = sysconfig.get_python_lib(prefix=prefix) - path = _normalized_path(path) - paths.add(path) - - # Handle Debian's derivatives /usr/local. - if os.path.isfile("/etc/debian_version"): - for prefix in filter(None, (real_prefix, sys.prefix)): - libpython = os.path.join( - prefix, - "local", - "lib", - "python" + sysconfig.get_python_version(), - "dist-packages", - ) - paths.add(libpython) - return paths - def open(self): """Called before visiting project (i.e set of modules).""" self.linter.stats.dependencies = {} From b1bb7f86bf08876e909fe135802a262fb2e5d82f Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Tue, 8 Mar 2022 10:14:50 -0500 Subject: [PATCH 019/473] Add `distutils` to deprecated modules (#5864) --- ChangeLog | 2 ++ doc/whatsnew/2.13.rst | 2 ++ pylint/checkers/stdlib.py | 7 +++++++ tests/functional/d/deprecated/deprecated_module_py310.py | 4 ++++ tests/functional/d/deprecated/deprecated_module_py310.rc | 2 ++ tests/functional/d/deprecated/deprecated_module_py310.txt | 1 + .../r/regression_02/regression_distutil_import_error_73.py | 2 +- 7 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/functional/d/deprecated/deprecated_module_py310.py create mode 100644 tests/functional/d/deprecated/deprecated_module_py310.rc create mode 100644 tests/functional/d/deprecated/deprecated_module_py310.txt diff --git a/ChangeLog b/ChangeLog index 51bc84fc54..b4c72ba03d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -405,6 +405,8 @@ Release date: TBA Closes #5862 +* Importing the deprecated stdlib module ``distutils`` now emits ``deprecated_module`` on Python 3.10+. + * ``missing-raises-doc`` will now check the class hierarchy of the raised exceptions .. code-block:: python diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 6fe17d9956..a0e5273db9 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -392,6 +392,8 @@ Other Changes Closes #5862 +* Importing the deprecated stdlib module ``distutils`` now emits ``deprecated_module`` on Python 3.10+. + * Fixed false positive ``unexpected-keyword-arg`` for decorators. Closes #258 diff --git a/pylint/checkers/stdlib.py b/pylint/checkers/stdlib.py index 864abf7349..8270eb88cc 100644 --- a/pylint/checkers/stdlib.py +++ b/pylint/checkers/stdlib.py @@ -79,6 +79,7 @@ (3, 6, 0): {"asynchat", "asyncore"}, (3, 7, 0): {"macpath"}, (3, 9, 0): {"lib2to3", "parser", "symbol", "binhex"}, + (3, 10, 0): {"distutils"}, } DEPRECATED_ARGUMENTS = { @@ -126,6 +127,7 @@ "abc.abstractstaticmethod", "abc.abstractproperty", }, + (3, 4, 0): {"importlib.util.module_for_loader"}, } @@ -205,6 +207,10 @@ }, (3, 4, 0): { "importlib.find_loader", + "importlib.abc.Loader.load_module", + "importlib.abc.Loader.module_repr", + "importlib.abc.PathEntryFinder.find_loader", + "importlib.abc.PathEntryFinder.find_module", "plistlib.readPlist", "plistlib.writePlist", "plistlib.readPlistFromBytes", @@ -253,6 +259,7 @@ }, (3, 10, 0): { "_sqlite3.enable_shared_cache", + "importlib.abc.Finder.find_module", "pathlib.Path.link_to", "zipimport.zipimporter.load_module", "zipimport.zipimporter.find_module", diff --git a/tests/functional/d/deprecated/deprecated_module_py310.py b/tests/functional/d/deprecated/deprecated_module_py310.py new file mode 100644 index 0000000000..8321474762 --- /dev/null +++ b/tests/functional/d/deprecated/deprecated_module_py310.py @@ -0,0 +1,4 @@ +"""Test deprecated modules from Python 3.10.""" +# pylint: disable=unused-import + +import distutils # [deprecated-module] diff --git a/tests/functional/d/deprecated/deprecated_module_py310.rc b/tests/functional/d/deprecated/deprecated_module_py310.rc new file mode 100644 index 0000000000..b29fd450ac --- /dev/null +++ b/tests/functional/d/deprecated/deprecated_module_py310.rc @@ -0,0 +1,2 @@ +[testoptions] +min_pyver = 3.10 diff --git a/tests/functional/d/deprecated/deprecated_module_py310.txt b/tests/functional/d/deprecated/deprecated_module_py310.txt new file mode 100644 index 0000000000..a46667aa52 --- /dev/null +++ b/tests/functional/d/deprecated/deprecated_module_py310.txt @@ -0,0 +1 @@ +deprecated-module:4:0:4:16::Uses of a deprecated module 'distutils':UNDEFINED diff --git a/tests/functional/r/regression_02/regression_distutil_import_error_73.py b/tests/functional/r/regression_02/regression_distutil_import_error_73.py index 751a4980f7..d40c0973fe 100644 --- a/tests/functional/r/regression_02/regression_distutil_import_error_73.py +++ b/tests/functional/r/regression_02/regression_distutil_import_error_73.py @@ -7,7 +7,7 @@ https://github.com/PyCQA/astroid/pull/1321 """ -# pylint: disable=unused-import +# pylint: disable=unused-import, deprecated-module import distutils.version from distutils.util import strtobool From 1ebdc8c59f31962db0244a79eaab9b8d90a87baf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=A9o=20Bouvard?= Date: Wed, 9 Mar 2022 17:43:40 +0100 Subject: [PATCH 020/473] Fix pyreverse type hinting for class methods (#5881) * Fix pyreverse type hinting for class methods This commit fixes the alignment of arguments and their type annotations in pyreverse printer output. It does so by checking for the type of the current function rather than the name of the first argument. This allows class methods having a non-standard first argument (different from "self" or "cls") to be correctly serialized in class diagrams. * Add test for method with None args According to astroid docs, this happens for builtin functions implemented in C. In this case, we return an empty argument list. --- ChangeLog | 2 ++ pylint/pyreverse/printer.py | 15 +++++++-------- tests/data/clientmodule_test.py | 8 ++++++++ tests/pyreverse/data/classes_No_Name.dot | 2 +- tests/pyreverse/data/classes_No_Name.html | 2 ++ tests/pyreverse/data/classes_No_Name.mmd | 2 ++ tests/pyreverse/data/classes_No_Name.puml | 2 ++ tests/pyreverse/data/classes_No_Name.vcg | 2 +- tests/pyreverse/data/classes_colorized.dot | 2 +- tests/pyreverse/data/classes_colorized.puml | 2 ++ tests/pyreverse/test_printer.py | 10 ++++++++++ 11 files changed, 38 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index b4c72ba03d..d97f87c9fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ Release date: TBA .. Put new features here and also in 'doc/whatsnew/2.13.rst' +* Fix pyreverse diagrams type hinting for classmethods and staticmethods. + * Fix matching ``--notes`` options that end in a non-word character. Closes #5840 diff --git a/pylint/pyreverse/printer.py b/pylint/pyreverse/printer.py index 559e456be3..ca7f9b0a2a 100644 --- a/pylint/pyreverse/printer.py +++ b/pylint/pyreverse/printer.py @@ -99,14 +99,13 @@ def emit_edge( @staticmethod def _get_method_arguments(method: nodes.FunctionDef) -> List[str]: - if method.args.args: - arguments: List[nodes.AssignName] = [ - arg for arg in method.args.args if arg.name != "self" - ] - else: - arguments = [] - - annotations = dict(zip(arguments, method.args.annotations[1:])) + if method.args.args is None: + return [] + + first_arg = 0 if method.type in {"function", "staticmethod"} else 1 + arguments: List[nodes.AssignName] = method.args.args[first_arg:] + + annotations = dict(zip(arguments, method.args.annotations[first_arg:])) for arg in arguments: annotation_label = "" ann = annotations.get(arg) diff --git a/tests/data/clientmodule_test.py b/tests/data/clientmodule_test.py index 82deaaf6f8..257aadec1d 100644 --- a/tests/data/clientmodule_test.py +++ b/tests/data/clientmodule_test.py @@ -28,3 +28,11 @@ def __init__(self, value, _id, relation2: DoNothing2): self._id = _id self.relation = DoNothing() self.relation2 = relation2 + + @classmethod + def from_value(cls, value: int): + return cls(value, 0, DoNothing2()) + + @staticmethod + def transform_value(value: int) -> int: + return value * 2 diff --git a/tests/pyreverse/data/classes_No_Name.dot b/tests/pyreverse/data/classes_No_Name.dot index b2c5551088..e5a304ce37 100644 --- a/tests/pyreverse/data/classes_No_Name.dot +++ b/tests/pyreverse/data/classes_No_Name.dot @@ -8,7 +8,7 @@ charset="utf-8" "data.suppliermodule_test.DoSomething" [color="black", fontcolor="black", label="{DoSomething|my_int : Optional[int]\lmy_int_2 : Optional[int]\lmy_string : str\l|do_it(new_int: int): int\l}", shape="record", style="solid"]; "data.suppliermodule_test.Interface" [color="black", fontcolor="black", label="{Interface|\l|get_value()\lset_value(value)\l}", shape="record", style="solid"]; "data.property_pattern.PropertyPatterns" [color="black", fontcolor="black", label="{PropertyPatterns|prop1\lprop2\l|}", shape="record", style="solid"]; -"data.clientmodule_test.Specialization" [color="black", fontcolor="black", label="{Specialization|TYPE : str\lrelation\lrelation2\ltop : str\l|}", shape="record", style="solid"]; +"data.clientmodule_test.Specialization" [color="black", fontcolor="black", label="{Specialization|TYPE : str\lrelation\lrelation2\ltop : str\l|from_value(value: int)\ltransform_value(value: int): int\l}", shape="record", style="solid"]; "data.clientmodule_test.Specialization" -> "data.clientmodule_test.Ancestor" [arrowhead="empty", arrowtail="none"]; "data.clientmodule_test.Ancestor" -> "data.suppliermodule_test.Interface" [arrowhead="empty", arrowtail="node", style="dashed"]; "data.suppliermodule_test.DoNothing" -> "data.clientmodule_test.Ancestor" [arrowhead="diamond", arrowtail="none", fontcolor="green", label="cls_member", style="solid"]; diff --git a/tests/pyreverse/data/classes_No_Name.html b/tests/pyreverse/data/classes_No_Name.html index 3f81c340e5..420a869d4f 100644 --- a/tests/pyreverse/data/classes_No_Name.html +++ b/tests/pyreverse/data/classes_No_Name.html @@ -35,6 +35,8 @@ relation relation2 top : str + from_value(value: int) + transform_value(value: int) -> int } Specialization --|> Ancestor Ancestor ..|> Interface diff --git a/tests/pyreverse/data/classes_No_Name.mmd b/tests/pyreverse/data/classes_No_Name.mmd index d2ac9839db..50da7f39cf 100644 --- a/tests/pyreverse/data/classes_No_Name.mmd +++ b/tests/pyreverse/data/classes_No_Name.mmd @@ -30,6 +30,8 @@ classDiagram relation relation2 top : str + from_value(value: int) + transform_value(value: int) -> int } Specialization --|> Ancestor Ancestor ..|> Interface diff --git a/tests/pyreverse/data/classes_No_Name.puml b/tests/pyreverse/data/classes_No_Name.puml index 1d9e5f37da..a0f8350d0d 100644 --- a/tests/pyreverse/data/classes_No_Name.puml +++ b/tests/pyreverse/data/classes_No_Name.puml @@ -31,6 +31,8 @@ class "Specialization" as data.clientmodule_test.Specialization { relation relation2 top : str + from_value(value: int) + transform_value(value: int) -> int } data.clientmodule_test.Specialization --|> data.clientmodule_test.Ancestor data.clientmodule_test.Ancestor ..|> data.suppliermodule_test.Interface diff --git a/tests/pyreverse/data/classes_No_Name.vcg b/tests/pyreverse/data/classes_No_Name.vcg index bc542b64b1..6497f26b4e 100644 --- a/tests/pyreverse/data/classes_No_Name.vcg +++ b/tests/pyreverse/data/classes_No_Name.vcg @@ -25,7 +25,7 @@ graph:{ node: {title:"data.property_pattern.PropertyPatterns" label:"\fbPropertyPatterns\fn\n\f__________________\n\f08prop1\n\f08prop2\n\f__________________" shape:box } - node: {title:"data.clientmodule_test.Specialization" label:"\fbSpecialization\fn\n\f________________\n\f08TYPE : str\n\f08relation\n\f08relation2\n\f08top : str\n\f________________" + node: {title:"data.clientmodule_test.Specialization" label:"\fbSpecialization\fn\n\f_________________\n\f08TYPE : str\n\f08relation\n\f08relation2\n\f08top : str\n\f_________________\n\f10from_value()\n\f10transform_value()" shape:box } edge: {sourcename:"data.clientmodule_test.Specialization" targetname:"data.clientmodule_test.Ancestor" arrowstyle:solid diff --git a/tests/pyreverse/data/classes_colorized.dot b/tests/pyreverse/data/classes_colorized.dot index 0ed3285666..3b68c79336 100644 --- a/tests/pyreverse/data/classes_colorized.dot +++ b/tests/pyreverse/data/classes_colorized.dot @@ -8,7 +8,7 @@ charset="utf-8" "data.suppliermodule_test.DoSomething" [color="aliceblue", fontcolor="black", label="{DoSomething|my_int : Optional[int]\lmy_int_2 : Optional[int]\lmy_string : str\l|do_it(new_int: int): int\l}", shape="record", style="filled"]; "data.suppliermodule_test.Interface" [color="aliceblue", fontcolor="black", label="{Interface|\l|get_value()\lset_value(value)\l}", shape="record", style="filled"]; "data.property_pattern.PropertyPatterns" [color="aliceblue", fontcolor="black", label="{PropertyPatterns|prop1\lprop2\l|}", shape="record", style="filled"]; -"data.clientmodule_test.Specialization" [color="aliceblue", fontcolor="black", label="{Specialization|TYPE : str\lrelation\lrelation2\ltop : str\l|}", shape="record", style="filled"]; +"data.clientmodule_test.Specialization" [color="aliceblue", fontcolor="black", label="{Specialization|TYPE : str\lrelation\lrelation2\ltop : str\l|from_value(value: int)\ltransform_value(value: int): int\l}", shape="record", style="filled"]; "data.clientmodule_test.Specialization" -> "data.clientmodule_test.Ancestor" [arrowhead="empty", arrowtail="none"]; "data.clientmodule_test.Ancestor" -> "data.suppliermodule_test.Interface" [arrowhead="empty", arrowtail="node", style="dashed"]; "data.suppliermodule_test.DoNothing" -> "data.clientmodule_test.Ancestor" [arrowhead="diamond", arrowtail="none", fontcolor="green", label="cls_member", style="solid"]; diff --git a/tests/pyreverse/data/classes_colorized.puml b/tests/pyreverse/data/classes_colorized.puml index 611a669dbf..8a37f090f4 100644 --- a/tests/pyreverse/data/classes_colorized.puml +++ b/tests/pyreverse/data/classes_colorized.puml @@ -31,6 +31,8 @@ class "Specialization" as data.clientmodule_test.Specialization #aliceblue { relation relation2 top : str + from_value(value: int) + transform_value(value: int) -> int } data.clientmodule_test.Specialization --|> data.clientmodule_test.Ancestor data.clientmodule_test.Ancestor ..|> data.suppliermodule_test.Interface diff --git a/tests/pyreverse/test_printer.py b/tests/pyreverse/test_printer.py index 6d240c8362..5406c6e83f 100644 --- a/tests/pyreverse/test_printer.py +++ b/tests/pyreverse/test_printer.py @@ -8,6 +8,7 @@ from typing import Type import pytest +from astroid import nodes from pylint.pyreverse.dot_printer import DotPrinter from pylint.pyreverse.plantuml_printer import PlantUmlPrinter @@ -46,6 +47,15 @@ def test_unsupported_layout(layout: Layout, printer_class: Type[Printer]): printer_class(title="unittest", layout=layout) +def test_method_arguments_none(): + func = nodes.FunctionDef() + args = nodes.Arguments() + args.args = None + func.postinit(args, body=None) + parsed_args = Printer._get_method_arguments(func) + assert parsed_args == [] + + class TestPlantUmlPrinter: printer = PlantUmlPrinter(title="unittest", layout=Layout.TOP_TO_BOTTOM) From 51d414dc472e0d977c7a60b37801e22be8611f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Thu, 10 Mar 2022 13:43:20 +0100 Subject: [PATCH 021/473] Use the ``tomli`` package instead of ``toml`` to parse ``.toml`` (#5887) Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> --- .pre-commit-config.yaml | 3 +-- ChangeLog | 4 ++++ doc/whatsnew/2.13.rst | 4 ++++ pylint/config/find_default_config_files.py | 13 ++++++++----- pylint/config/option_manager_mixin.py | 13 ++++++++----- requirements_test.txt | 1 - setup.cfg | 5 +---- .../toml/issue_3181/toml_decode_error.1.out | 2 +- 8 files changed, 27 insertions(+), 18 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e3a1ad58f6..c440a0ca37 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -86,8 +86,7 @@ repos: types: [python] args: [] require_serial: true - additional_dependencies: - ["platformdirs==2.2.0", "types-pkg_resources==0.1.3", "types-toml==0.1.3"] + additional_dependencies: ["platformdirs==2.2.0", "types-pkg_resources==0.1.3"] exclude: tests/functional/|tests/input|tests(/.*)*/data|tests/regrtest_data/|tests/data/|tests(/.*)+/conftest.py|doc/|bin/ - repo: https://github.com/pre-commit/mirrors-prettier rev: v2.5.1 diff --git a/ChangeLog b/ChangeLog index d97f87c9fb..2e824df6ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -83,6 +83,10 @@ Release date: TBA Closes #5281 +* Use the ``tomli`` package instead of ``toml`` to parse ``.toml`` files. + + Closes #5885 + * Fix false positive - Allow unpacking of ``self`` in a subclass of ``typing.NamedTuple``. Closes #5312 diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index a0e5273db9..0830fd561a 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -129,6 +129,10 @@ Other Changes Closes #5614 +* Use the ``tomli`` package instead of ``toml`` to parse ``.toml`` files. + + Closes #5885 + * Fixed false positive ``consider-using-dict-comprehension`` when creating a dict using a list of tuples where key AND value vary depending on the same condition. diff --git a/pylint/config/find_default_config_files.py b/pylint/config/find_default_config_files.py index 10c31345de..73a7f0f8a5 100644 --- a/pylint/config/find_default_config_files.py +++ b/pylint/config/find_default_config_files.py @@ -3,17 +3,20 @@ import configparser import os +import sys from typing import Iterator, Optional -import toml -from toml import TomlDecodeError +if sys.version_info >= (3, 11): + import tomllib +else: + import tomli as tomllib def _toml_has_config(path): - with open(path, encoding="utf-8") as toml_handle: + with open(path, mode="rb") as toml_handle: try: - content = toml.load(toml_handle) - except TomlDecodeError as error: + content = tomllib.load(toml_handle) + except tomllib.TOMLDecodeError as error: print(f"Failed to load '{path}': {error}") return False diff --git a/pylint/config/option_manager_mixin.py b/pylint/config/option_manager_mixin.py index 9260f75930..387c628235 100644 --- a/pylint/config/option_manager_mixin.py +++ b/pylint/config/option_manager_mixin.py @@ -14,13 +14,16 @@ from types import ModuleType from typing import Dict, List, Optional, TextIO, Tuple, Union -import toml - from pylint import utils from pylint.config.man_help_formatter import _ManHelpFormatter from pylint.config.option import Option from pylint.config.option_parser import OptionParser +if sys.version_info >= (3, 11): + import tomllib +else: + import tomli as tomllib + def _expand_default(self, option): """Patch OptionParser.expand_default with custom behaviour. @@ -276,7 +279,7 @@ def read_config_file(self, config_file=None, verbose=None): if config_file.endswith(".toml"): try: self._parse_toml(config_file, parser) - except toml.TomlDecodeError as e: + except tomllib.TOMLDecodeError as e: self.add_message("config-parse-error", line=0, args=str(e)) else: # Use this encoding in order to strip the BOM marker, if any. @@ -300,8 +303,8 @@ def _parse_toml( self, config_file: Union[Path, str], parser: configparser.ConfigParser ) -> None: """Parse and handle errors of a toml configuration file.""" - with open(config_file, encoding="utf-8") as fp: - content = toml.load(fp) + with open(config_file, mode="rb") as fp: + content = tomllib.load(fp) try: sections_values = content["tool"]["pylint"] except KeyError: diff --git a/requirements_test.txt b/requirements_test.txt index 052ac74d55..bcc6311fc2 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -10,4 +10,3 @@ pytest-profiling~=1.7 pytest-xdist~=2.5 # Type packages for mypy types-pkg_resources==0.1.3 -types-toml==0.10.4 diff --git a/setup.cfg b/setup.cfg index 26318dd7cb..8c148180fb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -51,7 +51,7 @@ install_requires = astroid>=2.9.2,<=2.10.0-dev0 isort>=4.2.5,<6 mccabe>=0.6,<0.7 - toml>=0.9.2 + tomli>=1.1.0;python_version<"3.11" colorama;sys_platform=="win32" typing-extensions>=3.10.0;python_version<"3.10" python_requires = >=3.6.2 @@ -125,9 +125,6 @@ ignore_missing_imports = True [mypy-_string] ignore_missing_imports = True -[mypy-toml.decoder] -ignore_missing_imports = True - [mypy-git.*] ignore_missing_imports = True diff --git a/tests/config/functional/toml/issue_3181/toml_decode_error.1.out b/tests/config/functional/toml/issue_3181/toml_decode_error.1.out index 545acbd2dd..4511afc5c1 100644 --- a/tests/config/functional/toml/issue_3181/toml_decode_error.1.out +++ b/tests/config/functional/toml/issue_3181/toml_decode_error.1.out @@ -1,2 +1,2 @@ ************* Module {abspath} -{relpath}:1:0: F0011: error while parsing the configuration: Found invalid character in key name: '*'. Try quoting the key name. (line 3 column 2 char 48) (config-parse-error) +{relpath}:1:0: F0011: error while parsing the configuration: Invalid statement (at line 3, column 1) (config-parse-error) From c01758eebcc2e15c0fc9b95095230f07a0ac8a02 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Mon, 7 Mar 2022 18:42:22 -0500 Subject: [PATCH 022/473] Fix typo in ColorizedTextReporter deprecation warning --- pylint/reporters/text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylint/reporters/text.py b/pylint/reporters/text.py index 6743ab5b15..2e1abf6bfa 100644 --- a/pylint/reporters/text.py +++ b/pylint/reporters/text.py @@ -303,7 +303,7 @@ def __init__( list(color_mapping.values())[0], MessageStyle ): warnings.warn( - "In pylint 3.0, the ColoreziedTextReporter will only accept ColorMappingDict as color_mapping parameter", + "In pylint 3.0, the ColorizedTextReporter will only accept ColorMappingDict as color_mapping parameter", DeprecationWarning, ) temp_color_mapping: ColorMappingDict = {} From 94f8099ce2365f2a94b93789cdf634bd4f031c71 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Mon, 7 Mar 2022 18:45:45 -0500 Subject: [PATCH 023/473] Correct type annotation of ImportsChecker.dependencies_stat --- pylint/checkers/imports.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylint/checkers/imports.py b/pylint/checkers/imports.py index 96e0066eba..bcad7692ed 100644 --- a/pylint/checkers/imports.py +++ b/pylint/checkers/imports.py @@ -829,7 +829,7 @@ def _add_imported_module( self._module_pkg[context_name] = context_name.rsplit(".", 1)[0] # handle dependencies - dependencies_stat: Dict[str, Union[Set]] = self.linter.stats.dependencies + dependencies_stat: Dict[str, Set[str]] = self.linter.stats.dependencies importedmodnames = dependencies_stat.setdefault(importedmodname, set()) if context_name not in importedmodnames: importedmodnames.add(context_name) From 1faf365b6a45e9a3776287d13d3a7e634b42af29 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Thu, 10 Mar 2022 17:13:47 +0100 Subject: [PATCH 024/473] Add broken NoReturn check (#5304) --- ChangeLog | 7 +++ doc/whatsnew/2.13.rst | 6 +++ pylint/extensions/typing.py | 51 ++++++++++++++++++- requirements_test_min.txt | 1 + .../ext/typing/typing_broken_noreturn.py | 32 ++++++++++++ .../ext/typing/typing_broken_noreturn.rc | 3 ++ .../ext/typing/typing_broken_noreturn.txt | 4 ++ .../typing_broken_noreturn_future_import.py | 37 ++++++++++++++ .../typing_broken_noreturn_future_import.rc | 6 +++ .../typing_broken_noreturn_future_import.txt | 1 + .../typing/typing_broken_noreturn_py372.py | 34 +++++++++++++ .../typing/typing_broken_noreturn_py372.rc | 3 ++ 12 files changed, 184 insertions(+), 1 deletion(-) create mode 100644 tests/functional/ext/typing/typing_broken_noreturn.py create mode 100644 tests/functional/ext/typing/typing_broken_noreturn.rc create mode 100644 tests/functional/ext/typing/typing_broken_noreturn.txt create mode 100644 tests/functional/ext/typing/typing_broken_noreturn_future_import.py create mode 100644 tests/functional/ext/typing/typing_broken_noreturn_future_import.rc create mode 100644 tests/functional/ext/typing/typing_broken_noreturn_future_import.txt create mode 100644 tests/functional/ext/typing/typing_broken_noreturn_py372.py create mode 100644 tests/functional/ext/typing/typing_broken_noreturn_py372.rc diff --git a/ChangeLog b/ChangeLog index 2e824df6ed..3d80754279 100644 --- a/ChangeLog +++ b/ChangeLog @@ -400,6 +400,12 @@ Release date: TBA Closes #5371 +* ``TypingChecker`` + + * Added new check ``broken-noreturn`` to detect broken uses of ``typing.NoReturn`` + if ``py-version`` is set to Python ``3.7.1`` or below. + https://bugs.python.org/issue34921 + * The ``testutils`` for unittests now accept ``end_lineno`` and ``end_column``. Tests without these will trigger a ``DeprecationWarning``. @@ -555,6 +561,7 @@ Release date: 2021-11-24 * Properly identify parameters with no documentation and add new message called ``missing-any-param-doc`` Closes #3799 + * Add checkers ``overridden-final-method`` & ``subclassed-final-class`` Closes #3197 diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 0830fd561a..47a6ba8446 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -75,6 +75,12 @@ Extensions * Pyreverse - add output in mermaid-js format and html which is an mermaid js diagram with html boilerplate +* ``TypingChecker`` + + * Added new check ``broken-noreturn`` to detect broken uses of ``typing.NoReturn`` + if ``py-version`` is set to Python ``3.7.1`` or below. + https://bugs.python.org/issue34921 + * ``DocstringParameterChecker`` * Fixed incorrect classification of Numpy-style docstring as Google-style docstring for diff --git a/pylint/extensions/typing.py b/pylint/extensions/typing.py index cc68bc35ef..949156fde5 100644 --- a/pylint/extensions/typing.py +++ b/pylint/extensions/typing.py @@ -7,9 +7,10 @@ from pylint.checkers.utils import ( check_messages, is_node_in_type_annotation_context, + is_postponed_evaluation_enabled, safe_infer, ) -from pylint.interfaces import IAstroidChecker +from pylint.interfaces import INFERENCE, IAstroidChecker from pylint.utils.utils import get_global_option if TYPE_CHECKING: @@ -68,6 +69,12 @@ class TypingAlias(NamedTuple): ALIAS_NAMES = frozenset(key.split(".")[1] for key in DEPRECATED_TYPING_ALIASES) UNION_NAMES = ("Optional", "Union") +TYPING_NORETURN = frozenset( + ( + "typing.NoReturn", + "typing_extensions.NoReturn", + ) +) class DeprecatedTypingAliasMsg(NamedTuple): @@ -103,6 +110,14 @@ class TypingChecker(BaseChecker): "Emitted when 'typing.Union' or 'typing.Optional' is used " "instead of the alternative Union syntax 'int | None'.", ), + "E6004": ( + "'NoReturn' inside compound types is broken in 3.7.0 / 3.7.1", + "broken-noreturn", + "``typing.NoReturn`` inside compound types is broken in " + "Python 3.7.0 and 3.7.1. If not dependent on runtime introspection, " + "use string annotation instead. E.g. " + "``Callable[..., 'NoReturn']``. https://bugs.python.org/issue34921", + ), } options = ( ( @@ -153,6 +168,8 @@ def open(self) -> None: self._py37_plus and self.config.runtime_typing is False ) + self._should_check_noreturn = py_version < (3, 7, 2) + def _msg_postponed_eval_hint(self, node) -> str: """Message hint if postponed evaluation isn't enabled.""" if self._py310_plus or "annotations" in node.root().future_imports: @@ -163,23 +180,29 @@ def _msg_postponed_eval_hint(self, node) -> str: "deprecated-typing-alias", "consider-using-alias", "consider-alternative-union-syntax", + "broken-noreturn", ) def visit_name(self, node: nodes.Name) -> None: if self._should_check_typing_alias and node.name in ALIAS_NAMES: self._check_for_typing_alias(node) if self._should_check_alternative_union_syntax and node.name in UNION_NAMES: self._check_for_alternative_union_syntax(node, node.name) + if self._should_check_noreturn and node.name == "NoReturn": + self._check_broken_noreturn(node) @check_messages( "deprecated-typing-alias", "consider-using-alias", "consider-alternative-union-syntax", + "broken-noreturn", ) def visit_attribute(self, node: nodes.Attribute) -> None: if self._should_check_typing_alias and node.attrname in ALIAS_NAMES: self._check_for_typing_alias(node) if self._should_check_alternative_union_syntax and node.attrname in UNION_NAMES: self._check_for_alternative_union_syntax(node, node.attrname) + if self._should_check_noreturn and node.attrname == "NoReturn": + self._check_broken_noreturn(node) def _check_for_alternative_union_syntax( self, @@ -279,6 +302,32 @@ def leave_module(self, node: nodes.Module) -> None: self._alias_name_collisions.clear() self._consider_using_alias_msgs.clear() + def _check_broken_noreturn(self, node: Union[nodes.Name, nodes.Attribute]) -> None: + """Check for 'NoReturn' inside compound types.""" + if not isinstance(node.parent, nodes.BaseContainer): + # NoReturn not part of a Union or Callable type + return + + if is_postponed_evaluation_enabled(node) and is_node_in_type_annotation_context( + node + ): + return + + for inferred in node.infer(): + # To deal with typing_extensions, don't use safe_infer + if ( + isinstance(inferred, (nodes.FunctionDef, nodes.ClassDef)) + and inferred.qname() in TYPING_NORETURN + # In Python 3.6, NoReturn is alias of '_NoReturn' + # In Python 3.7 - 3.8, NoReturn is alias of '_SpecialForm' + or isinstance(inferred, astroid.bases.BaseInstance) + and isinstance(inferred._proxied, nodes.ClassDef) + and inferred._proxied.qname() + in {"typing._NoReturn", "typing._SpecialForm"} + ): + self.add_message("broken-noreturn", node=node, confidence=INFERENCE) + break + def register(linter: "PyLinter") -> None: linter.register_checker(TypingChecker(linter)) diff --git a/requirements_test_min.txt b/requirements_test_min.txt index 79f99044b4..8c5b0f9c38 100644 --- a/requirements_test_min.txt +++ b/requirements_test_min.txt @@ -1,5 +1,6 @@ -e .[testutil] # astroid dependency is also defined in setup.cfg astroid==2.9.3 # Pinned to a specific version for tests +typing-extensions~=4.0 pytest~=7.0 pytest-benchmark~=3.4 diff --git a/tests/functional/ext/typing/typing_broken_noreturn.py b/tests/functional/ext/typing/typing_broken_noreturn.py new file mode 100644 index 0000000000..f675fce6aa --- /dev/null +++ b/tests/functional/ext/typing/typing_broken_noreturn.py @@ -0,0 +1,32 @@ +""" +'typing.NoReturn' is broken inside compond types for Python 3.7.0 +https://bugs.python.org/issue34921 + +If no runtime introspection is required, use string annotations instead. +""" +# pylint: disable=missing-docstring +import typing +from typing import Callable, NoReturn, Union + +import typing_extensions + + +def func1() -> NoReturn: + raise Exception + +def func2() -> Union[None, NoReturn]: # [broken-noreturn] + pass + +def func3() -> Union[None, "NoReturn"]: + pass + +def func4() -> Union[None, typing.NoReturn]: # [broken-noreturn] + pass + +def func5() -> Union[None, typing_extensions.NoReturn]: # [broken-noreturn] + pass + + +Alias1 = NoReturn +Alias2 = Callable[..., NoReturn] # [broken-noreturn] +Alias3 = Callable[..., "NoReturn"] diff --git a/tests/functional/ext/typing/typing_broken_noreturn.rc b/tests/functional/ext/typing/typing_broken_noreturn.rc new file mode 100644 index 0000000000..56e0bed570 --- /dev/null +++ b/tests/functional/ext/typing/typing_broken_noreturn.rc @@ -0,0 +1,3 @@ +[master] +py-version=3.7 +load-plugins=pylint.extensions.typing diff --git a/tests/functional/ext/typing/typing_broken_noreturn.txt b/tests/functional/ext/typing/typing_broken_noreturn.txt new file mode 100644 index 0000000000..ce4503341f --- /dev/null +++ b/tests/functional/ext/typing/typing_broken_noreturn.txt @@ -0,0 +1,4 @@ +broken-noreturn:17:27:17:35:func2:'NoReturn' inside compound types is broken in 3.7.0 / 3.7.1:INFERENCE +broken-noreturn:23:27:23:42:func4:'NoReturn' inside compound types is broken in 3.7.0 / 3.7.1:INFERENCE +broken-noreturn:26:27:26:53:func5:'NoReturn' inside compound types is broken in 3.7.0 / 3.7.1:INFERENCE +broken-noreturn:31:23:31:31::'NoReturn' inside compound types is broken in 3.7.0 / 3.7.1:INFERENCE diff --git a/tests/functional/ext/typing/typing_broken_noreturn_future_import.py b/tests/functional/ext/typing/typing_broken_noreturn_future_import.py new file mode 100644 index 0000000000..83ec547499 --- /dev/null +++ b/tests/functional/ext/typing/typing_broken_noreturn_future_import.py @@ -0,0 +1,37 @@ +""" +'typing.NoReturn' is broken inside compond types for Python 3.7.0 +https://bugs.python.org/issue34921 + +If no runtime introspection is required, use string annotations instead. + +With 'from __future__ import annotations', only emit errors for nodes +not in a type annotation context. +""" +# pylint: disable=missing-docstring +from __future__ import annotations + +import typing +from typing import Callable, NoReturn, Union + +import typing_extensions + + +def func1() -> NoReturn: + raise Exception + +def func2() -> Union[None, NoReturn]: + pass + +def func3() -> Union[None, "NoReturn"]: + pass + +def func4() -> Union[None, typing.NoReturn]: + pass + +def func5() -> Union[None, typing_extensions.NoReturn]: + pass + + +Alias1 = NoReturn +Alias2 = Callable[..., NoReturn] # [broken-noreturn] +Alias3 = Callable[..., "NoReturn"] diff --git a/tests/functional/ext/typing/typing_broken_noreturn_future_import.rc b/tests/functional/ext/typing/typing_broken_noreturn_future_import.rc new file mode 100644 index 0000000000..92ef9524a3 --- /dev/null +++ b/tests/functional/ext/typing/typing_broken_noreturn_future_import.rc @@ -0,0 +1,6 @@ +[master] +py-version=3.7 +load-plugins=pylint.extensions.typing + +[testoptions] +min_pyver=3.7 diff --git a/tests/functional/ext/typing/typing_broken_noreturn_future_import.txt b/tests/functional/ext/typing/typing_broken_noreturn_future_import.txt new file mode 100644 index 0000000000..891a3a4d8b --- /dev/null +++ b/tests/functional/ext/typing/typing_broken_noreturn_future_import.txt @@ -0,0 +1 @@ +broken-noreturn:36:23:36:31::'NoReturn' inside compound types is broken in 3.7.0 / 3.7.1:INFERENCE diff --git a/tests/functional/ext/typing/typing_broken_noreturn_py372.py b/tests/functional/ext/typing/typing_broken_noreturn_py372.py new file mode 100644 index 0000000000..c4b18a0337 --- /dev/null +++ b/tests/functional/ext/typing/typing_broken_noreturn_py372.py @@ -0,0 +1,34 @@ +""" +'typing.NoReturn' is broken inside compond types for Python 3.7.0 +https://bugs.python.org/issue34921 + +If no runtime introspection is required, use string annotations instead. + +Don't emit errors if py-version set to >= 3.7.2. +""" +# pylint: disable=missing-docstring +import typing +from typing import Callable, NoReturn, Union + +import typing_extensions + + +def func1() -> NoReturn: + raise Exception + +def func2() -> Union[None, NoReturn]: + pass + +def func3() -> Union[None, "NoReturn"]: + pass + +def func4() -> Union[None, typing.NoReturn]: + pass + +def func5() -> Union[None, typing_extensions.NoReturn]: + pass + + +Alias1 = NoReturn +Alias2 = Callable[..., NoReturn] +Alias3 = Callable[..., "NoReturn"] diff --git a/tests/functional/ext/typing/typing_broken_noreturn_py372.rc b/tests/functional/ext/typing/typing_broken_noreturn_py372.rc new file mode 100644 index 0000000000..24550b2c9d --- /dev/null +++ b/tests/functional/ext/typing/typing_broken_noreturn_py372.rc @@ -0,0 +1,3 @@ +[master] +py-version=3.7.2 +load-plugins=pylint.extensions.typing From 6d30e12f4413f1252fde58950e4b9a430585e5d0 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Thu, 10 Mar 2022 23:16:58 +0100 Subject: [PATCH 025/473] Add broken Callable check (#5891) --- ChangeLog | 4 + doc/whatsnew/2.13.rst | 4 + pylint/extensions/typing.py | 104 ++++++++++++++++-- .../ext/typing/typing_broken_callable.py | 28 +++++ .../ext/typing/typing_broken_callable.rc | 6 + .../ext/typing/typing_broken_callable.txt | 4 + ...typing_broken_callable_deprecated_alias.py | 26 +++++ ...typing_broken_callable_deprecated_alias.rc | 6 + .../typing_broken_callable_future_import.py | 30 +++++ .../typing_broken_callable_future_import.rc | 6 + .../typing_broken_callable_future_import.txt | 2 + 11 files changed, 213 insertions(+), 7 deletions(-) create mode 100644 tests/functional/ext/typing/typing_broken_callable.py create mode 100644 tests/functional/ext/typing/typing_broken_callable.rc create mode 100644 tests/functional/ext/typing/typing_broken_callable.txt create mode 100644 tests/functional/ext/typing/typing_broken_callable_deprecated_alias.py create mode 100644 tests/functional/ext/typing/typing_broken_callable_deprecated_alias.rc create mode 100644 tests/functional/ext/typing/typing_broken_callable_future_import.py create mode 100644 tests/functional/ext/typing/typing_broken_callable_future_import.rc create mode 100644 tests/functional/ext/typing/typing_broken_callable_future_import.txt diff --git a/ChangeLog b/ChangeLog index 3d80754279..ff34a28ce3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -406,6 +406,10 @@ Release date: TBA if ``py-version`` is set to Python ``3.7.1`` or below. https://bugs.python.org/issue34921 + * Added new check ``broken-collections-callable`` to detect broken uses of ``collections.abc.Callable`` + if ``py-version`` is set to Python ``3.9.1`` or below. + https://bugs.python.org/issue42965 + * The ``testutils`` for unittests now accept ``end_lineno`` and ``end_column``. Tests without these will trigger a ``DeprecationWarning``. diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 47a6ba8446..a71a18b4b9 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -81,6 +81,10 @@ Extensions if ``py-version`` is set to Python ``3.7.1`` or below. https://bugs.python.org/issue34921 + * Added new check ``broken-collections-callable`` to detect broken uses of ``collections.abc.Callable`` + if ``py-version`` is set to Python ``3.9.1`` or below. + https://bugs.python.org/issue42965 + * ``DocstringParameterChecker`` * Fixed incorrect classification of Numpy-style docstring as Google-style docstring for diff --git a/pylint/extensions/typing.py b/pylint/extensions/typing.py index 949156fde5..9da7b109f6 100644 --- a/pylint/extensions/typing.py +++ b/pylint/extensions/typing.py @@ -81,7 +81,7 @@ class DeprecatedTypingAliasMsg(NamedTuple): node: Union[nodes.Name, nodes.Attribute] qname: str alias: str - parent_subscript: bool + parent_subscript: bool = False class TypingChecker(BaseChecker): @@ -118,6 +118,14 @@ class TypingChecker(BaseChecker): "use string annotation instead. E.g. " "``Callable[..., 'NoReturn']``. https://bugs.python.org/issue34921", ), + "E6005": ( + "'collections.abc.Callable' inside Optional and Union is broken in " + "3.9.0 / 3.9.1 (use 'typing.Callable' instead)", + "broken-collections-callable", + "``collections.abc.Callable`` inside Optional and Union is broken in " + "Python 3.9.0 and 3.9.1. Use ``typing.Callable`` for these cases instead. " + "https://bugs.python.org/issue42965", + ), } options = ( ( @@ -152,7 +160,9 @@ class TypingChecker(BaseChecker): def __init__(self, linter: "PyLinter") -> None: """Initialize checker instance.""" super().__init__(linter=linter) + self._found_broken_callable_location: bool = False self._alias_name_collisions: Set[str] = set() + self._deprecated_typing_alias_msgs: List[DeprecatedTypingAliasMsg] = [] self._consider_using_alias_msgs: List[DeprecatedTypingAliasMsg] = [] def open(self) -> None: @@ -169,8 +179,9 @@ def open(self) -> None: ) self._should_check_noreturn = py_version < (3, 7, 2) + self._should_check_callable = py_version < (3, 9, 2) - def _msg_postponed_eval_hint(self, node) -> str: + def _msg_postponed_eval_hint(self, node: nodes.NodeNG) -> str: """Message hint if postponed evaluation isn't enabled.""" if self._py310_plus or "annotations" in node.root().future_imports: return "" @@ -181,6 +192,7 @@ def _msg_postponed_eval_hint(self, node) -> str: "consider-using-alias", "consider-alternative-union-syntax", "broken-noreturn", + "broken-collections-callable", ) def visit_name(self, node: nodes.Name) -> None: if self._should_check_typing_alias and node.name in ALIAS_NAMES: @@ -189,12 +201,15 @@ def visit_name(self, node: nodes.Name) -> None: self._check_for_alternative_union_syntax(node, node.name) if self._should_check_noreturn and node.name == "NoReturn": self._check_broken_noreturn(node) + if self._should_check_callable and node.name == "Callable": + self._check_broken_callable(node) @check_messages( "deprecated-typing-alias", "consider-using-alias", "consider-alternative-union-syntax", "broken-noreturn", + "broken-collections-callable", ) def visit_attribute(self, node: nodes.Attribute) -> None: if self._should_check_typing_alias and node.attrname in ALIAS_NAMES: @@ -203,6 +218,8 @@ def visit_attribute(self, node: nodes.Attribute) -> None: self._check_for_alternative_union_syntax(node, node.attrname) if self._should_check_noreturn and node.attrname == "NoReturn": self._check_broken_noreturn(node) + if self._should_check_callable and node.attrname == "Callable": + self._check_broken_callable(node) def _check_for_alternative_union_syntax( self, @@ -255,10 +272,16 @@ def _check_for_typing_alias( return if self._py39_plus: - self.add_message( - "deprecated-typing-alias", - node=node, - args=(inferred.qname(), alias.name), + if inferred.qname() == "typing.Callable" and self._broken_callable_location( + node + ): + self._found_broken_callable_location = True + self._deprecated_typing_alias_msgs.append( + DeprecatedTypingAliasMsg( + node, + inferred.qname(), + alias.name, + ) ) return @@ -284,7 +307,20 @@ def leave_module(self, node: nodes.Module) -> None: 'consider-using-alias' check. Make sure results are safe to recommend / collision free. """ - if self._py37_plus and not self._py39_plus: + if self._py39_plus: + for msg in self._deprecated_typing_alias_msgs: + if ( + self._found_broken_callable_location + and msg.qname == "typing.Callable" + ): + continue + self.add_message( + "deprecated-typing-alias", + node=msg.node, + args=(msg.qname, msg.alias), + ) + + elif self._py37_plus: msg_future_import = self._msg_postponed_eval_hint(node) for msg in self._consider_using_alias_msgs: if msg.qname in self._alias_name_collisions: @@ -298,7 +334,10 @@ def leave_module(self, node: nodes.Module) -> None: msg_future_import if msg.parent_subscript else "", ), ) + # Clear all module cache variables + self._found_broken_callable_location = False + self._deprecated_typing_alias_msgs.clear() self._alias_name_collisions.clear() self._consider_using_alias_msgs.clear() @@ -328,6 +367,57 @@ def _check_broken_noreturn(self, node: Union[nodes.Name, nodes.Attribute]) -> No self.add_message("broken-noreturn", node=node, confidence=INFERENCE) break + def _check_broken_callable(self, node: Union[nodes.Name, nodes.Attribute]) -> None: + """Check for 'collections.abc.Callable' inside Optional and Union.""" + inferred = safe_infer(node) + if not ( + isinstance(inferred, nodes.ClassDef) + and inferred.qname() == "_collections_abc.Callable" + and self._broken_callable_location(node) + ): + return + + self.add_message("broken-collections-callable", node=node, confidence=INFERENCE) + + def _broken_callable_location( # pylint: disable=no-self-use + self, node: Union[nodes.Name, nodes.Attribute] + ) -> bool: + """Check if node would be a broken location for collections.abc.Callable.""" + if is_postponed_evaluation_enabled(node) and is_node_in_type_annotation_context( + node + ): + return False + + # Check first Callable arg is a list of arguments -> Callable[[int], None] + if not ( + isinstance(node.parent, nodes.Subscript) + and isinstance(node.parent.slice, nodes.Tuple) + and len(node.parent.slice.elts) == 2 + and isinstance(node.parent.slice.elts[0], nodes.List) + ): + return False + + # Check nested inside Optional or Union + parent_subscript = node.parent.parent + if isinstance(parent_subscript, nodes.BaseContainer): + parent_subscript = parent_subscript.parent + if not ( + isinstance(parent_subscript, nodes.Subscript) + and isinstance(parent_subscript.value, (nodes.Name, nodes.Attribute)) + ): + return False + + inferred_parent = safe_infer(parent_subscript.value) + if not ( + isinstance(inferred_parent, nodes.FunctionDef) + and inferred_parent.qname() in {"typing.Optional", "typing.Union"} + or isinstance(inferred_parent, astroid.bases.Instance) + and inferred_parent.qname() == "typing._SpecialForm" + ): + return False + + return True + def register(linter: "PyLinter") -> None: linter.register_checker(TypingChecker(linter)) diff --git a/tests/functional/ext/typing/typing_broken_callable.py b/tests/functional/ext/typing/typing_broken_callable.py new file mode 100644 index 0000000000..5cdac7dd75 --- /dev/null +++ b/tests/functional/ext/typing/typing_broken_callable.py @@ -0,0 +1,28 @@ +""" +'collections.abc.Callable' is broken inside Optional and Union types for Python 3.9.0 +https://bugs.python.org/issue42965 + +Use 'typing.Callable' instead. +""" +# pylint: disable=missing-docstring,unsubscriptable-object +import collections.abc +from collections.abc import Callable +from typing import Optional, Union + +Alias1 = Optional[Callable[[int], None]] # [broken-collections-callable] +Alias2 = Union[Callable[[int], None], None] # [broken-collections-callable] + +Alias3 = Optional[Callable[..., None]] +Alias4 = Union[Callable[..., None], None] +Alias5 = list[Callable[..., None]] +Alias6 = Callable[[int], None] + + +def func1() -> Optional[Callable[[int], None]]: # [broken-collections-callable] + ... + +def func2() -> Optional["Callable[[int], None]"]: + ... + +def func3() -> Union[collections.abc.Callable[[int], None], None]: # [broken-collections-callable] + ... diff --git a/tests/functional/ext/typing/typing_broken_callable.rc b/tests/functional/ext/typing/typing_broken_callable.rc new file mode 100644 index 0000000000..301a67b7c8 --- /dev/null +++ b/tests/functional/ext/typing/typing_broken_callable.rc @@ -0,0 +1,6 @@ +[master] +py-version=3.9 +load-plugins=pylint.extensions.typing + +[testoptions] +min_pyver=3.7 diff --git a/tests/functional/ext/typing/typing_broken_callable.txt b/tests/functional/ext/typing/typing_broken_callable.txt new file mode 100644 index 0000000000..360cd896bc --- /dev/null +++ b/tests/functional/ext/typing/typing_broken_callable.txt @@ -0,0 +1,4 @@ +broken-collections-callable:12:18:12:26::'collections.abc.Callable' inside Optional and Union is broken in 3.9.0 / 3.9.1 (use 'typing.Callable' instead):INFERENCE +broken-collections-callable:13:15:13:23::'collections.abc.Callable' inside Optional and Union is broken in 3.9.0 / 3.9.1 (use 'typing.Callable' instead):INFERENCE +broken-collections-callable:21:24:21:32:func1:'collections.abc.Callable' inside Optional and Union is broken in 3.9.0 / 3.9.1 (use 'typing.Callable' instead):INFERENCE +broken-collections-callable:27:21:27:45:func3:'collections.abc.Callable' inside Optional and Union is broken in 3.9.0 / 3.9.1 (use 'typing.Callable' instead):INFERENCE diff --git a/tests/functional/ext/typing/typing_broken_callable_deprecated_alias.py b/tests/functional/ext/typing/typing_broken_callable_deprecated_alias.py new file mode 100644 index 0000000000..f01592a59a --- /dev/null +++ b/tests/functional/ext/typing/typing_broken_callable_deprecated_alias.py @@ -0,0 +1,26 @@ +""" +'collections.abc.Callable' is broken inside Optional and Union types for Python 3.9.0 +https://bugs.python.org/issue42965 + +Use 'typing.Callable' instead. + +Don't emit 'deprecated-typing-alias' for 'Callable' if at least one replacement +would create broken instances. +""" +# pylint: disable=missing-docstring,unsubscriptable-object +from typing import Callable, Optional, Union + +Alias1 = Optional[Callable[[int], None]] +Alias2 = Union[Callable[[int], None], None] + +Alias3 = Optional[Callable[..., None]] +Alias4 = Union[Callable[..., None], None] +Alias5 = list[Callable[[int], None]] +Alias6 = Callable[[int], None] + + +def func1() -> Optional[Callable[[int], None]]: + ... + +def func2() -> Optional["Callable[[int], None]"]: + ... diff --git a/tests/functional/ext/typing/typing_broken_callable_deprecated_alias.rc b/tests/functional/ext/typing/typing_broken_callable_deprecated_alias.rc new file mode 100644 index 0000000000..301a67b7c8 --- /dev/null +++ b/tests/functional/ext/typing/typing_broken_callable_deprecated_alias.rc @@ -0,0 +1,6 @@ +[master] +py-version=3.9 +load-plugins=pylint.extensions.typing + +[testoptions] +min_pyver=3.7 diff --git a/tests/functional/ext/typing/typing_broken_callable_future_import.py b/tests/functional/ext/typing/typing_broken_callable_future_import.py new file mode 100644 index 0000000000..947e060b98 --- /dev/null +++ b/tests/functional/ext/typing/typing_broken_callable_future_import.py @@ -0,0 +1,30 @@ +""" +'collections.abc.Callable' is broken inside Optional and Union types for Python 3.9.0 +https://bugs.python.org/issue42965 + +Use 'typing.Callable' instead. +""" +# pylint: disable=missing-docstring,unsubscriptable-object +from __future__ import annotations + +import collections.abc +from collections.abc import Callable +from typing import Optional, Union + +Alias1 = Optional[Callable[[int], None]] # [broken-collections-callable] +Alias2 = Union[Callable[[int], None], None] # [broken-collections-callable] + +Alias3 = Optional[Callable[..., None]] +Alias4 = Union[Callable[..., None], None] +Alias5 = list[Callable[[int], None]] +Alias6 = Callable[[int], None] + + +def func1() -> Optional[Callable[[int], None]]: + ... + +def func2() -> Optional["Callable[[int], None]"]: + ... + +def func3() -> Union[collections.abc.Callable[[int], None], None]: + ... diff --git a/tests/functional/ext/typing/typing_broken_callable_future_import.rc b/tests/functional/ext/typing/typing_broken_callable_future_import.rc new file mode 100644 index 0000000000..301a67b7c8 --- /dev/null +++ b/tests/functional/ext/typing/typing_broken_callable_future_import.rc @@ -0,0 +1,6 @@ +[master] +py-version=3.9 +load-plugins=pylint.extensions.typing + +[testoptions] +min_pyver=3.7 diff --git a/tests/functional/ext/typing/typing_broken_callable_future_import.txt b/tests/functional/ext/typing/typing_broken_callable_future_import.txt new file mode 100644 index 0000000000..a3f3553f6a --- /dev/null +++ b/tests/functional/ext/typing/typing_broken_callable_future_import.txt @@ -0,0 +1,2 @@ +broken-collections-callable:14:18:14:26::'collections.abc.Callable' inside Optional and Union is broken in 3.9.0 / 3.9.1 (use 'typing.Callable' instead):INFERENCE +broken-collections-callable:15:15:15:23::'collections.abc.Callable' inside Optional and Union is broken in 3.9.0 / 3.9.1 (use 'typing.Callable' instead):INFERENCE From 8bc9eab5ce3386ce843043ae8377c1eee3469d9b Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Fri, 11 Mar 2022 08:27:59 +0100 Subject: [PATCH 026/473] Add confidence value to typing extension messages (#5892) --- pylint/extensions/typing.py | 3 + .../typing/typing_consider_using_alias.txt | 40 ++++++------- ...ng_consider_using_alias_without_future.txt | 40 ++++++------- .../typing/typing_consider_using_union.txt | 20 +++---- .../typing_consider_using_union_py310.txt | 36 ++++++------ ...ng_consider_using_union_without_future.txt | 20 +++---- .../ext/typing/typing_deprecated_alias.txt | 56 +++++++++---------- 7 files changed, 109 insertions(+), 106 deletions(-) diff --git a/pylint/extensions/typing.py b/pylint/extensions/typing.py index 9da7b109f6..b2e6d769d0 100644 --- a/pylint/extensions/typing.py +++ b/pylint/extensions/typing.py @@ -247,6 +247,7 @@ def _check_for_alternative_union_syntax( "consider-alternative-union-syntax", node=node, args=(name, self._msg_postponed_eval_hint(node)), + confidence=INFERENCE, ) def _check_for_typing_alias( @@ -318,6 +319,7 @@ def leave_module(self, node: nodes.Module) -> None: "deprecated-typing-alias", node=msg.node, args=(msg.qname, msg.alias), + confidence=INFERENCE, ) elif self._py37_plus: @@ -333,6 +335,7 @@ def leave_module(self, node: nodes.Module) -> None: msg.alias, msg_future_import if msg.parent_subscript else "", ), + confidence=INFERENCE, ) # Clear all module cache variables diff --git a/tests/functional/ext/typing/typing_consider_using_alias.txt b/tests/functional/ext/typing/typing_consider_using_alias.txt index f4ddbd213f..0845e2c9cd 100644 --- a/tests/functional/ext/typing/typing_consider_using_alias.txt +++ b/tests/functional/ext/typing/typing_consider_using_alias.txt @@ -1,20 +1,20 @@ -consider-using-alias:16:6:16:17::'typing.Dict' will be deprecated with PY39, consider using 'dict' instead:UNDEFINED -consider-using-alias:17:6:17:10::'typing.List' will be deprecated with PY39, consider using 'list' instead:UNDEFINED -consider-using-alias:19:6:19:24::'typing.OrderedDict' will be deprecated with PY39, consider using 'collections.OrderedDict' instead:UNDEFINED -consider-using-alias:20:6:20:22::'typing.Awaitable' will be deprecated with PY39, consider using 'collections.abc.Awaitable' instead:UNDEFINED -consider-using-alias:21:6:21:21::'typing.Iterable' will be deprecated with PY39, consider using 'collections.abc.Iterable' instead:UNDEFINED -consider-using-alias:22:6:22:21::'typing.Hashable' will be deprecated with PY39, consider using 'collections.abc.Hashable' instead:UNDEFINED -consider-using-alias:23:6:23:27::'typing.ContextManager' will be deprecated with PY39, consider using 'contextlib.AbstractContextManager' instead:UNDEFINED -consider-using-alias:24:6:24:20::'typing.Pattern' will be deprecated with PY39, consider using 're.Pattern' instead:UNDEFINED -consider-using-alias:25:7:25:22::'typing.Match' will be deprecated with PY39, consider using 're.Match' instead:UNDEFINED -consider-using-alias:34:9:34:13::'typing.List' will be deprecated with PY39, consider using 'list' instead:UNDEFINED -consider-using-alias:36:7:36:11::'typing.Type' will be deprecated with PY39, consider using 'type' instead:UNDEFINED -consider-using-alias:37:7:37:12::'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead:UNDEFINED -consider-using-alias:38:7:38:15::'typing.Callable' will be deprecated with PY39, consider using 'collections.abc.Callable' instead:UNDEFINED -consider-using-alias:44:74:44:78:func1:'typing.Dict' will be deprecated with PY39, consider using 'dict' instead:UNDEFINED -consider-using-alias:44:16:44:20:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead:UNDEFINED -consider-using-alias:44:37:44:41:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead:UNDEFINED -consider-using-alias:44:93:44:105:func1:'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead:UNDEFINED -consider-using-alias:60:12:60:16:CustomNamedTuple:'typing.List' will be deprecated with PY39, consider using 'list' instead:UNDEFINED -consider-using-alias:65:12:65:16:CustomTypedDict2:'typing.List' will be deprecated with PY39, consider using 'list' instead:UNDEFINED -consider-using-alias:69:12:69:16:CustomDataClass:'typing.List' will be deprecated with PY39, consider using 'list' instead:UNDEFINED +consider-using-alias:16:6:16:17::'typing.Dict' will be deprecated with PY39, consider using 'dict' instead:INFERENCE +consider-using-alias:17:6:17:10::'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE +consider-using-alias:19:6:19:24::'typing.OrderedDict' will be deprecated with PY39, consider using 'collections.OrderedDict' instead:INFERENCE +consider-using-alias:20:6:20:22::'typing.Awaitable' will be deprecated with PY39, consider using 'collections.abc.Awaitable' instead:INFERENCE +consider-using-alias:21:6:21:21::'typing.Iterable' will be deprecated with PY39, consider using 'collections.abc.Iterable' instead:INFERENCE +consider-using-alias:22:6:22:21::'typing.Hashable' will be deprecated with PY39, consider using 'collections.abc.Hashable' instead:INFERENCE +consider-using-alias:23:6:23:27::'typing.ContextManager' will be deprecated with PY39, consider using 'contextlib.AbstractContextManager' instead:INFERENCE +consider-using-alias:24:6:24:20::'typing.Pattern' will be deprecated with PY39, consider using 're.Pattern' instead:INFERENCE +consider-using-alias:25:7:25:22::'typing.Match' will be deprecated with PY39, consider using 're.Match' instead:INFERENCE +consider-using-alias:34:9:34:13::'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE +consider-using-alias:36:7:36:11::'typing.Type' will be deprecated with PY39, consider using 'type' instead:INFERENCE +consider-using-alias:37:7:37:12::'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead:INFERENCE +consider-using-alias:38:7:38:15::'typing.Callable' will be deprecated with PY39, consider using 'collections.abc.Callable' instead:INFERENCE +consider-using-alias:44:74:44:78:func1:'typing.Dict' will be deprecated with PY39, consider using 'dict' instead:INFERENCE +consider-using-alias:44:16:44:20:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE +consider-using-alias:44:37:44:41:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE +consider-using-alias:44:93:44:105:func1:'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead:INFERENCE +consider-using-alias:60:12:60:16:CustomNamedTuple:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE +consider-using-alias:65:12:65:16:CustomTypedDict2:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE +consider-using-alias:69:12:69:16:CustomDataClass:'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE diff --git a/tests/functional/ext/typing/typing_consider_using_alias_without_future.txt b/tests/functional/ext/typing/typing_consider_using_alias_without_future.txt index e4552cae35..d7ed5fc845 100644 --- a/tests/functional/ext/typing/typing_consider_using_alias_without_future.txt +++ b/tests/functional/ext/typing/typing_consider_using_alias_without_future.txt @@ -1,20 +1,20 @@ -consider-using-alias:13:6:13:17::'typing.Dict' will be deprecated with PY39, consider using 'dict' instead. Add 'from __future__ import annotations' as well:UNDEFINED -consider-using-alias:14:6:14:10::'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:UNDEFINED -consider-using-alias:16:6:16:24::'typing.OrderedDict' will be deprecated with PY39, consider using 'collections.OrderedDict' instead. Add 'from __future__ import annotations' as well:UNDEFINED -consider-using-alias:17:6:17:22::'typing.Awaitable' will be deprecated with PY39, consider using 'collections.abc.Awaitable' instead. Add 'from __future__ import annotations' as well:UNDEFINED -consider-using-alias:18:6:18:21::'typing.Iterable' will be deprecated with PY39, consider using 'collections.abc.Iterable' instead. Add 'from __future__ import annotations' as well:UNDEFINED -consider-using-alias:19:6:19:21::'typing.Hashable' will be deprecated with PY39, consider using 'collections.abc.Hashable' instead:UNDEFINED -consider-using-alias:20:6:20:27::'typing.ContextManager' will be deprecated with PY39, consider using 'contextlib.AbstractContextManager' instead. Add 'from __future__ import annotations' as well:UNDEFINED -consider-using-alias:21:6:21:20::'typing.Pattern' will be deprecated with PY39, consider using 're.Pattern' instead. Add 'from __future__ import annotations' as well:UNDEFINED -consider-using-alias:22:7:22:22::'typing.Match' will be deprecated with PY39, consider using 're.Match' instead. Add 'from __future__ import annotations' as well:UNDEFINED -consider-using-alias:31:9:31:13::'typing.List' will be deprecated with PY39, consider using 'list' instead:UNDEFINED -consider-using-alias:33:7:33:11::'typing.Type' will be deprecated with PY39, consider using 'type' instead. Add 'from __future__ import annotations' as well:UNDEFINED -consider-using-alias:34:7:34:12::'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead. Add 'from __future__ import annotations' as well:UNDEFINED -consider-using-alias:35:7:35:15::'typing.Callable' will be deprecated with PY39, consider using 'collections.abc.Callable' instead. Add 'from __future__ import annotations' as well:UNDEFINED -consider-using-alias:41:74:41:78:func1:'typing.Dict' will be deprecated with PY39, consider using 'dict' instead. Add 'from __future__ import annotations' as well:UNDEFINED -consider-using-alias:41:16:41:20:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:UNDEFINED -consider-using-alias:41:37:41:41:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:UNDEFINED -consider-using-alias:41:93:41:105:func1:'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead. Add 'from __future__ import annotations' as well:UNDEFINED -consider-using-alias:57:12:57:16:CustomNamedTuple:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:UNDEFINED -consider-using-alias:62:12:62:16:CustomTypedDict2:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:UNDEFINED -consider-using-alias:66:12:66:16:CustomDataClass:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:UNDEFINED +consider-using-alias:13:6:13:17::'typing.Dict' will be deprecated with PY39, consider using 'dict' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:14:6:14:10::'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:16:6:16:24::'typing.OrderedDict' will be deprecated with PY39, consider using 'collections.OrderedDict' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:17:6:17:22::'typing.Awaitable' will be deprecated with PY39, consider using 'collections.abc.Awaitable' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:18:6:18:21::'typing.Iterable' will be deprecated with PY39, consider using 'collections.abc.Iterable' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:19:6:19:21::'typing.Hashable' will be deprecated with PY39, consider using 'collections.abc.Hashable' instead:INFERENCE +consider-using-alias:20:6:20:27::'typing.ContextManager' will be deprecated with PY39, consider using 'contextlib.AbstractContextManager' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:21:6:21:20::'typing.Pattern' will be deprecated with PY39, consider using 're.Pattern' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:22:7:22:22::'typing.Match' will be deprecated with PY39, consider using 're.Match' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:31:9:31:13::'typing.List' will be deprecated with PY39, consider using 'list' instead:INFERENCE +consider-using-alias:33:7:33:11::'typing.Type' will be deprecated with PY39, consider using 'type' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:34:7:34:12::'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:35:7:35:15::'typing.Callable' will be deprecated with PY39, consider using 'collections.abc.Callable' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:41:74:41:78:func1:'typing.Dict' will be deprecated with PY39, consider using 'dict' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:41:16:41:20:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:41:37:41:41:func1:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:41:93:41:105:func1:'typing.Tuple' will be deprecated with PY39, consider using 'tuple' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:57:12:57:16:CustomNamedTuple:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:62:12:62:16:CustomTypedDict2:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE +consider-using-alias:66:12:66:16:CustomDataClass:'typing.List' will be deprecated with PY39, consider using 'list' instead. Add 'from __future__ import annotations' as well:INFERENCE diff --git a/tests/functional/ext/typing/typing_consider_using_union.txt b/tests/functional/ext/typing/typing_consider_using_union.txt index 58b8e74ce5..4a1e7521d2 100644 --- a/tests/functional/ext/typing/typing_consider_using_union.txt +++ b/tests/functional/ext/typing/typing_consider_using_union.txt @@ -1,10 +1,10 @@ -consider-alternative-union-syntax:13:6:13:11::Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:14:11:14:16::Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:15:16:15:28::Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:16:6:16:14::Consider using alternative Union syntax instead of 'Optional':UNDEFINED -consider-alternative-union-syntax:24:10:24:18:func1:Consider using alternative Union syntax instead of 'Optional':UNDEFINED -consider-alternative-union-syntax:25:24:25:29:func1:Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:26:5:26:10:func1:Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:38:12:38:17:CustomNamedTuple:Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:43:27:43:32:CustomTypedDict2:Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:47:12:47:20:CustomDataClass:Consider using alternative Union syntax instead of 'Optional':UNDEFINED +consider-alternative-union-syntax:13:6:13:11::Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:14:11:14:16::Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:15:16:15:28::Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:16:6:16:14::Consider using alternative Union syntax instead of 'Optional':INFERENCE +consider-alternative-union-syntax:24:10:24:18:func1:Consider using alternative Union syntax instead of 'Optional':INFERENCE +consider-alternative-union-syntax:25:24:25:29:func1:Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:26:5:26:10:func1:Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:38:12:38:17:CustomNamedTuple:Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:43:27:43:32:CustomTypedDict2:Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:47:12:47:20:CustomDataClass:Consider using alternative Union syntax instead of 'Optional':INFERENCE diff --git a/tests/functional/ext/typing/typing_consider_using_union_py310.txt b/tests/functional/ext/typing/typing_consider_using_union_py310.txt index dec5556e7d..fde1d7e2b2 100644 --- a/tests/functional/ext/typing/typing_consider_using_union_py310.txt +++ b/tests/functional/ext/typing/typing_consider_using_union_py310.txt @@ -1,18 +1,18 @@ -consider-alternative-union-syntax:11:6:11:11::Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:12:11:12:16::Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:13:16:13:28::Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:14:6:14:14::Consider using alternative Union syntax instead of 'Optional':UNDEFINED -consider-alternative-union-syntax:16:9:16:14::Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:17:14:17:19::Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:18:19:18:31::Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:19:9:19:17::Consider using alternative Union syntax instead of 'Optional':UNDEFINED -consider-alternative-union-syntax:22:10:22:18:func1:Consider using alternative Union syntax instead of 'Optional':UNDEFINED -consider-alternative-union-syntax:23:24:23:29:func1:Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:24:5:24:10:func1:Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:27:19:27:24:Custom1:Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:31:28:31:33::Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:33:14:33:22::Consider using alternative Union syntax instead of 'Optional':UNDEFINED -consider-alternative-union-syntax:36:12:36:17:CustomNamedTuple:Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:38:56:38:64::Consider using alternative Union syntax instead of 'Optional':UNDEFINED -consider-alternative-union-syntax:41:27:41:32:CustomTypedDict2:Consider using alternative Union syntax instead of 'Union':UNDEFINED -consider-alternative-union-syntax:45:12:45:20:CustomDataClass:Consider using alternative Union syntax instead of 'Optional':UNDEFINED +consider-alternative-union-syntax:11:6:11:11::Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:12:11:12:16::Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:13:16:13:28::Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:14:6:14:14::Consider using alternative Union syntax instead of 'Optional':INFERENCE +consider-alternative-union-syntax:16:9:16:14::Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:17:14:17:19::Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:18:19:18:31::Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:19:9:19:17::Consider using alternative Union syntax instead of 'Optional':INFERENCE +consider-alternative-union-syntax:22:10:22:18:func1:Consider using alternative Union syntax instead of 'Optional':INFERENCE +consider-alternative-union-syntax:23:24:23:29:func1:Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:24:5:24:10:func1:Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:27:19:27:24:Custom1:Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:31:28:31:33::Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:33:14:33:22::Consider using alternative Union syntax instead of 'Optional':INFERENCE +consider-alternative-union-syntax:36:12:36:17:CustomNamedTuple:Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:38:56:38:64::Consider using alternative Union syntax instead of 'Optional':INFERENCE +consider-alternative-union-syntax:41:27:41:32:CustomTypedDict2:Consider using alternative Union syntax instead of 'Union':INFERENCE +consider-alternative-union-syntax:45:12:45:20:CustomDataClass:Consider using alternative Union syntax instead of 'Optional':INFERENCE diff --git a/tests/functional/ext/typing/typing_consider_using_union_without_future.txt b/tests/functional/ext/typing/typing_consider_using_union_without_future.txt index 4eccda9518..bc8ca4c075 100644 --- a/tests/functional/ext/typing/typing_consider_using_union_without_future.txt +++ b/tests/functional/ext/typing/typing_consider_using_union_without_future.txt @@ -1,10 +1,10 @@ -consider-alternative-union-syntax:11:6:11:11::Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:UNDEFINED -consider-alternative-union-syntax:12:11:12:16::Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:UNDEFINED -consider-alternative-union-syntax:13:16:13:28::Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:UNDEFINED -consider-alternative-union-syntax:14:6:14:14::Consider using alternative Union syntax instead of 'Optional'. Add 'from __future__ import annotations' as well:UNDEFINED -consider-alternative-union-syntax:22:10:22:18:func1:Consider using alternative Union syntax instead of 'Optional'. Add 'from __future__ import annotations' as well:UNDEFINED -consider-alternative-union-syntax:23:24:23:29:func1:Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:UNDEFINED -consider-alternative-union-syntax:24:5:24:10:func1:Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:UNDEFINED -consider-alternative-union-syntax:36:12:36:17:CustomNamedTuple:Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:UNDEFINED -consider-alternative-union-syntax:41:27:41:32:CustomTypedDict2:Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:UNDEFINED -consider-alternative-union-syntax:45:12:45:20:CustomDataClass:Consider using alternative Union syntax instead of 'Optional'. Add 'from __future__ import annotations' as well:UNDEFINED +consider-alternative-union-syntax:11:6:11:11::Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:12:11:12:16::Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:13:16:13:28::Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:14:6:14:14::Consider using alternative Union syntax instead of 'Optional'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:22:10:22:18:func1:Consider using alternative Union syntax instead of 'Optional'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:23:24:23:29:func1:Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:24:5:24:10:func1:Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:36:12:36:17:CustomNamedTuple:Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:41:27:41:32:CustomTypedDict2:Consider using alternative Union syntax instead of 'Union'. Add 'from __future__ import annotations' as well:INFERENCE +consider-alternative-union-syntax:45:12:45:20:CustomDataClass:Consider using alternative Union syntax instead of 'Optional'. Add 'from __future__ import annotations' as well:INFERENCE diff --git a/tests/functional/ext/typing/typing_deprecated_alias.txt b/tests/functional/ext/typing/typing_deprecated_alias.txt index 585f71c235..62cf9902ad 100644 --- a/tests/functional/ext/typing/typing_deprecated_alias.txt +++ b/tests/functional/ext/typing/typing_deprecated_alias.txt @@ -1,28 +1,28 @@ -deprecated-typing-alias:13:6:13:17::'typing.Dict' is deprecated, use 'dict' instead:UNDEFINED -deprecated-typing-alias:14:6:14:10::'typing.List' is deprecated, use 'list' instead:UNDEFINED -deprecated-typing-alias:16:6:16:24::'typing.OrderedDict' is deprecated, use 'collections.OrderedDict' instead:UNDEFINED -deprecated-typing-alias:17:6:17:22::'typing.Awaitable' is deprecated, use 'collections.abc.Awaitable' instead:UNDEFINED -deprecated-typing-alias:18:6:18:21::'typing.Iterable' is deprecated, use 'collections.abc.Iterable' instead:UNDEFINED -deprecated-typing-alias:19:6:19:21::'typing.Hashable' is deprecated, use 'collections.abc.Hashable' instead:UNDEFINED -deprecated-typing-alias:20:6:20:27::'typing.ContextManager' is deprecated, use 'contextlib.AbstractContextManager' instead:UNDEFINED -deprecated-typing-alias:21:6:21:20::'typing.Pattern' is deprecated, use 're.Pattern' instead:UNDEFINED -deprecated-typing-alias:22:7:22:22::'typing.Match' is deprecated, use 're.Match' instead:UNDEFINED -deprecated-typing-alias:28:9:28:12::'typing.Set' is deprecated, use 'set' instead:UNDEFINED -deprecated-typing-alias:29:9:29:13::'typing.Dict' is deprecated, use 'dict' instead:UNDEFINED -deprecated-typing-alias:29:19:29:23::'typing.List' is deprecated, use 'list' instead:UNDEFINED -deprecated-typing-alias:30:20:30:31::'typing.List' is deprecated, use 'list' instead:UNDEFINED -deprecated-typing-alias:31:9:31:13::'typing.List' is deprecated, use 'list' instead:UNDEFINED -deprecated-typing-alias:33:7:33:11::'typing.Type' is deprecated, use 'type' instead:UNDEFINED -deprecated-typing-alias:34:7:34:12::'typing.Tuple' is deprecated, use 'tuple' instead:UNDEFINED -deprecated-typing-alias:35:7:35:15::'typing.Callable' is deprecated, use 'collections.abc.Callable' instead:UNDEFINED -deprecated-typing-alias:41:74:41:78:func1:'typing.Dict' is deprecated, use 'dict' instead:UNDEFINED -deprecated-typing-alias:41:16:41:20:func1:'typing.List' is deprecated, use 'list' instead:UNDEFINED -deprecated-typing-alias:41:37:41:41:func1:'typing.List' is deprecated, use 'list' instead:UNDEFINED -deprecated-typing-alias:41:93:41:105:func1:'typing.Tuple' is deprecated, use 'tuple' instead:UNDEFINED -deprecated-typing-alias:48:20:48:31:CustomIntList:'typing.List' is deprecated, use 'list' instead:UNDEFINED -deprecated-typing-alias:52:28:52:32::'typing.List' is deprecated, use 'list' instead:UNDEFINED -deprecated-typing-alias:54:14:54:18::'typing.List' is deprecated, use 'list' instead:UNDEFINED -deprecated-typing-alias:57:12:57:16:CustomNamedTuple:'typing.List' is deprecated, use 'list' instead:UNDEFINED -deprecated-typing-alias:59:56:59:60::'typing.List' is deprecated, use 'list' instead:UNDEFINED -deprecated-typing-alias:62:12:62:16:CustomTypedDict2:'typing.List' is deprecated, use 'list' instead:UNDEFINED -deprecated-typing-alias:66:12:66:16:CustomDataClass:'typing.List' is deprecated, use 'list' instead:UNDEFINED +deprecated-typing-alias:13:6:13:17::'typing.Dict' is deprecated, use 'dict' instead:INFERENCE +deprecated-typing-alias:14:6:14:10::'typing.List' is deprecated, use 'list' instead:INFERENCE +deprecated-typing-alias:16:6:16:24::'typing.OrderedDict' is deprecated, use 'collections.OrderedDict' instead:INFERENCE +deprecated-typing-alias:17:6:17:22::'typing.Awaitable' is deprecated, use 'collections.abc.Awaitable' instead:INFERENCE +deprecated-typing-alias:18:6:18:21::'typing.Iterable' is deprecated, use 'collections.abc.Iterable' instead:INFERENCE +deprecated-typing-alias:19:6:19:21::'typing.Hashable' is deprecated, use 'collections.abc.Hashable' instead:INFERENCE +deprecated-typing-alias:20:6:20:27::'typing.ContextManager' is deprecated, use 'contextlib.AbstractContextManager' instead:INFERENCE +deprecated-typing-alias:21:6:21:20::'typing.Pattern' is deprecated, use 're.Pattern' instead:INFERENCE +deprecated-typing-alias:22:7:22:22::'typing.Match' is deprecated, use 're.Match' instead:INFERENCE +deprecated-typing-alias:28:9:28:12::'typing.Set' is deprecated, use 'set' instead:INFERENCE +deprecated-typing-alias:29:9:29:13::'typing.Dict' is deprecated, use 'dict' instead:INFERENCE +deprecated-typing-alias:29:19:29:23::'typing.List' is deprecated, use 'list' instead:INFERENCE +deprecated-typing-alias:30:20:30:31::'typing.List' is deprecated, use 'list' instead:INFERENCE +deprecated-typing-alias:31:9:31:13::'typing.List' is deprecated, use 'list' instead:INFERENCE +deprecated-typing-alias:33:7:33:11::'typing.Type' is deprecated, use 'type' instead:INFERENCE +deprecated-typing-alias:34:7:34:12::'typing.Tuple' is deprecated, use 'tuple' instead:INFERENCE +deprecated-typing-alias:35:7:35:15::'typing.Callable' is deprecated, use 'collections.abc.Callable' instead:INFERENCE +deprecated-typing-alias:41:74:41:78:func1:'typing.Dict' is deprecated, use 'dict' instead:INFERENCE +deprecated-typing-alias:41:16:41:20:func1:'typing.List' is deprecated, use 'list' instead:INFERENCE +deprecated-typing-alias:41:37:41:41:func1:'typing.List' is deprecated, use 'list' instead:INFERENCE +deprecated-typing-alias:41:93:41:105:func1:'typing.Tuple' is deprecated, use 'tuple' instead:INFERENCE +deprecated-typing-alias:48:20:48:31:CustomIntList:'typing.List' is deprecated, use 'list' instead:INFERENCE +deprecated-typing-alias:52:28:52:32::'typing.List' is deprecated, use 'list' instead:INFERENCE +deprecated-typing-alias:54:14:54:18::'typing.List' is deprecated, use 'list' instead:INFERENCE +deprecated-typing-alias:57:12:57:16:CustomNamedTuple:'typing.List' is deprecated, use 'list' instead:INFERENCE +deprecated-typing-alias:59:56:59:60::'typing.List' is deprecated, use 'list' instead:INFERENCE +deprecated-typing-alias:62:12:62:16:CustomTypedDict2:'typing.List' is deprecated, use 'list' instead:INFERENCE +deprecated-typing-alias:66:12:66:16:CustomDataClass:'typing.List' is deprecated, use 'list' instead:INFERENCE From 588ed30f267a77d16233256e5f832d32533b795d Mon Sep 17 00:00:00 2001 From: Konrad Weihmann <46938494+priv-kweihmann@users.noreply.github.com> Date: Fri, 11 Mar 2022 12:54:22 +0100 Subject: [PATCH 027/473] Allow mccabe 0.7.x (#5896) python version < 3.7 will still remain on mccabe 0.6.x, while newer version will pick mccabe 0.7.x release Closes #5878 Signed-off-by: Konrad Weihmann --- CONTRIBUTORS.txt | 2 ++ ChangeLog | 4 ++++ setup.cfg | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 491a49dc1a..eeaaa13b1e 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -605,3 +605,5 @@ contributors: * Daniel Brookman: contributor * Téo Bouvard: contributor + +* Konrad Weihmann: contributor diff --git a/ChangeLog b/ChangeLog index ff34a28ce3..111a06ab44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -492,6 +492,10 @@ Release date: 2021-11-25 Closes #5316 +* Allow usage of mccabe 0.7.x release + + Closes #5878 + What's New in Pylint 2.12.1? ============================ diff --git a/setup.cfg b/setup.cfg index 8c148180fb..1c235c535f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -50,7 +50,7 @@ install_requires = # see https://github.com/PyCQA/astroid/issues/1341 astroid>=2.9.2,<=2.10.0-dev0 isort>=4.2.5,<6 - mccabe>=0.6,<0.7 + mccabe>=0.6,<0.8 tomli>=1.1.0;python_version<"3.11" colorama;sys_platform=="win32" typing-extensions>=3.10.0;python_version<"3.10" From a6e02fb6f0dd2c84dc1bf58df0f2511fe9ab90c2 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Fri, 11 Mar 2022 07:15:35 -0500 Subject: [PATCH 028/473] Prevent `useless-suppression` on disables for stdlib deprecation checker (#5876) Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> --- ChangeLog | 4 ++++ doc/whatsnew/2.13.rst | 4 ++++ pylint/checkers/stdlib.py | 20 ++++++++++-------- pylint/constants.py | 17 +++++++++++++++ pylint/utils/file_state.py | 21 ++++++++++++------- .../deprecated_method_suppression.py | 8 +++++++ .../d/deprecated/deprecated_methods_py39.py | 4 ++++ .../d/deprecated/deprecated_methods_py39.rc | 2 ++ .../d/deprecated/deprecated_methods_py39.txt | 1 + .../d/deprecated/deprecated_module_py3.txt | 2 +- .../d/deprecated/deprecated_module_py39.py | 4 ++++ .../d/deprecated/deprecated_module_py39.rc | 2 ++ .../d/deprecated/deprecated_module_py39.txt | 1 + ...eprecated_module_py39_earlier_pyversion.py | 6 ++++++ ...eprecated_module_py39_earlier_pyversion.rc | 5 +++++ ...precated_module_py39_earlier_pyversion.txt | 1 + 16 files changed, 84 insertions(+), 18 deletions(-) create mode 100644 tests/functional/d/deprecated/deprecated_method_suppression.py create mode 100644 tests/functional/d/deprecated/deprecated_methods_py39.py create mode 100644 tests/functional/d/deprecated/deprecated_methods_py39.rc create mode 100644 tests/functional/d/deprecated/deprecated_methods_py39.txt create mode 100644 tests/functional/d/deprecated/deprecated_module_py39.py create mode 100644 tests/functional/d/deprecated/deprecated_module_py39.rc create mode 100644 tests/functional/d/deprecated/deprecated_module_py39.txt create mode 100644 tests/functional/d/deprecated/deprecated_module_py39_earlier_pyversion.py create mode 100644 tests/functional/d/deprecated/deprecated_module_py39_earlier_pyversion.rc create mode 100644 tests/functional/d/deprecated/deprecated_module_py39_earlier_pyversion.txt diff --git a/ChangeLog b/ChangeLog index 111a06ab44..6e3a338e12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -421,6 +421,10 @@ Release date: TBA Closes #5862 +* Disables for ``deprecated-module`` and similar warnings for stdlib features deprecated + in newer versions of Python no longer raise ``useless-suppression`` when linting with + older Python interpreters where those features are not yet deprecated. + * Importing the deprecated stdlib module ``distutils`` now emits ``deprecated_module`` on Python 3.10+. * ``missing-raises-doc`` will now check the class hierarchy of the raised exceptions diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index a71a18b4b9..1aa94d4aff 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -402,6 +402,10 @@ Other Changes * The ``testutils`` for unittests now accept ``end_lineno`` and ``end_column``. Tests without these will trigger a ``DeprecationWarning``. +* Disables for ``deprecated-module`` and similar warnings for stdlib features deprecated + in newer versions of Python no longer raise ``useless-suppression`` when linting with + older Python interpreters where those features are not yet deprecated. + * Importing the deprecated stdlib module ``xml.etree.cElementTree`` now emits ``deprecated_module``. Closes #5862 diff --git a/pylint/checkers/stdlib.py b/pylint/checkers/stdlib.py index 8270eb88cc..3884fc32e4 100644 --- a/pylint/checkers/stdlib.py +++ b/pylint/checkers/stdlib.py @@ -39,7 +39,7 @@ import sys from collections.abc import Iterable -from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set +from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple import astroid from astroid import nodes @@ -473,24 +473,26 @@ class StdlibChecker(DeprecatedMixin, BaseChecker): def __init__(self, linter: Optional["PyLinter"] = None) -> None: BaseChecker.__init__(self, linter) - self._deprecated_methods: Set[Any] = set() - self._deprecated_methods.update(DEPRECATED_METHODS[0]) + self._deprecated_methods: Set[str] = set() + self._deprecated_arguments: Dict[ + str, Tuple[Tuple[Optional[int], str], ...] + ] = {} + self._deprecated_classes: Dict[str, Set[str]] = {} + self._deprecated_modules: Set[str] = set() + self._deprecated_decorators: Set[str] = set() + for since_vers, func_list in DEPRECATED_METHODS[sys.version_info[0]].items(): if since_vers <= sys.version_info: self._deprecated_methods.update(func_list) - self._deprecated_attributes = {} for since_vers, func_list in DEPRECATED_ARGUMENTS.items(): if since_vers <= sys.version_info: - self._deprecated_attributes.update(func_list) - self._deprecated_classes = {} + self._deprecated_arguments.update(func_list) for since_vers, class_list in DEPRECATED_CLASSES.items(): if since_vers <= sys.version_info: self._deprecated_classes.update(class_list) - self._deprecated_modules = set() for since_vers, mod_list in DEPRECATED_MODULES.items(): if since_vers <= sys.version_info: self._deprecated_modules.update(mod_list) - self._deprecated_decorators = set() for since_vers, decorator_list in DEPRECATED_DECORATORS.items(): if since_vers <= sys.version_info: self._deprecated_decorators.update(decorator_list) @@ -788,7 +790,7 @@ def deprecated_methods(self): return self._deprecated_methods def deprecated_arguments(self, method: str): - return self._deprecated_attributes.get(method, ()) + return self._deprecated_arguments.get(method, ()) def deprecated_classes(self, module: str): return self._deprecated_classes.get(module, ()) diff --git a/pylint/constants.py b/pylint/constants.py index 1a06ea8329..ae87d4293d 100644 --- a/pylint/constants.py +++ b/pylint/constants.py @@ -173,3 +173,20 @@ class DeletedMessage(NamedTuple): # https://github.com/PyCQA/pylint/pull/3571 DeletedMessage("C0330", "bad-continuation"), ] + + +# ignore some messages when emitting useless-suppression: +# - cyclic-import: can show false positives due to incomplete context +# - deprecated-{module, argument, class, method, decorator}: +# can cause false positives for multi-interpreter projects +# when linting with an interpreter on a lower python version +INCOMPATIBLE_WITH_USELESS_SUPPRESSION = frozenset( + [ + "R0401", # cyclic-import + "W0402", # deprecated-module + "W1505", # deprecated-method + "W1511", # deprecated-argument + "W1512", # deprecated-class + "W1513", # deprecated-decorator + ] +) diff --git a/pylint/utils/file_state.py b/pylint/utils/file_state.py index 654cb725b9..30e91c3ea1 100644 --- a/pylint/utils/file_state.py +++ b/pylint/utils/file_state.py @@ -16,7 +16,11 @@ from astroid import nodes -from pylint.constants import MSG_STATE_SCOPE_MODULE, WarningScope +from pylint.constants import ( + INCOMPATIBLE_WITH_USELESS_SUPPRESSION, + MSG_STATE_SCOPE_MODULE, + WarningScope, +) if sys.version_info >= (3, 8): from typing import Literal @@ -159,13 +163,14 @@ def iter_spurious_suppression_messages( ]: for warning, lines in self._raw_module_msgs_state.items(): for line, enable in lines.items(): - if not enable and (warning, line) not in self._ignored_msgs: - # ignore cyclic-import check which can show false positives - # here due to incomplete context - if warning != "R0401": - yield "useless-suppression", line, ( - msgs_store.get_msg_display_string(warning), - ) + if ( + not enable + and (warning, line) not in self._ignored_msgs + and warning not in INCOMPATIBLE_WITH_USELESS_SUPPRESSION + ): + yield "useless-suppression", line, ( + msgs_store.get_msg_display_string(warning), + ) # don't use iteritems here, _ignored_msgs may be modified by add_message for (warning, from_), ignored_lines in list(self._ignored_msgs.items()): for line in ignored_lines: diff --git a/tests/functional/d/deprecated/deprecated_method_suppression.py b/tests/functional/d/deprecated/deprecated_method_suppression.py new file mode 100644 index 0000000000..4f3bb63fe0 --- /dev/null +++ b/tests/functional/d/deprecated/deprecated_method_suppression.py @@ -0,0 +1,8 @@ +"""Test that versions below Py3.10 will not emit useless-suppression for +disabling deprecated-method (on a method deprecated in Py3.10. + +This test can be run on all Python versions, but it will lack value when +Pylint drops support for 3.9.""" +# pylint: disable=import-error, unused-import + +import threading.current_thread # pylint: disable=deprecated-method diff --git a/tests/functional/d/deprecated/deprecated_methods_py39.py b/tests/functional/d/deprecated/deprecated_methods_py39.py new file mode 100644 index 0000000000..9959b1c2a2 --- /dev/null +++ b/tests/functional/d/deprecated/deprecated_methods_py39.py @@ -0,0 +1,4 @@ +"""Test deprecated methods from Python 3.9.""" + +import binascii +binascii.b2a_hqx() # [deprecated-method] diff --git a/tests/functional/d/deprecated/deprecated_methods_py39.rc b/tests/functional/d/deprecated/deprecated_methods_py39.rc new file mode 100644 index 0000000000..16b75eea75 --- /dev/null +++ b/tests/functional/d/deprecated/deprecated_methods_py39.rc @@ -0,0 +1,2 @@ +[testoptions] +min_pyver=3.9 diff --git a/tests/functional/d/deprecated/deprecated_methods_py39.txt b/tests/functional/d/deprecated/deprecated_methods_py39.txt new file mode 100644 index 0000000000..292ca5ef16 --- /dev/null +++ b/tests/functional/d/deprecated/deprecated_methods_py39.txt @@ -0,0 +1 @@ +deprecated-method:4:0:4:18::Using deprecated method b2a_hqx():UNDEFINED diff --git a/tests/functional/d/deprecated/deprecated_module_py3.txt b/tests/functional/d/deprecated/deprecated_module_py3.txt index 79c0a418c2..bf41f781e9 100644 --- a/tests/functional/d/deprecated/deprecated_module_py3.txt +++ b/tests/functional/d/deprecated/deprecated_module_py3.txt @@ -1 +1 @@ -deprecated-module:4:::Uses of a deprecated module 'optparse' +deprecated-module:4:0:4:15::Uses of a deprecated module 'optparse':UNDEFINED diff --git a/tests/functional/d/deprecated/deprecated_module_py39.py b/tests/functional/d/deprecated/deprecated_module_py39.py new file mode 100644 index 0000000000..a897dd4e33 --- /dev/null +++ b/tests/functional/d/deprecated/deprecated_module_py39.py @@ -0,0 +1,4 @@ +"""Test deprecated modules from Python 3.9.""" +# pylint: disable=unused-import + +import binhex # [deprecated-module] diff --git a/tests/functional/d/deprecated/deprecated_module_py39.rc b/tests/functional/d/deprecated/deprecated_module_py39.rc new file mode 100644 index 0000000000..16b75eea75 --- /dev/null +++ b/tests/functional/d/deprecated/deprecated_module_py39.rc @@ -0,0 +1,2 @@ +[testoptions] +min_pyver=3.9 diff --git a/tests/functional/d/deprecated/deprecated_module_py39.txt b/tests/functional/d/deprecated/deprecated_module_py39.txt new file mode 100644 index 0000000000..c85cbcbffd --- /dev/null +++ b/tests/functional/d/deprecated/deprecated_module_py39.txt @@ -0,0 +1 @@ +deprecated-module:4:0:4:13::Uses of a deprecated module 'binhex':UNDEFINED diff --git a/tests/functional/d/deprecated/deprecated_module_py39_earlier_pyversion.py b/tests/functional/d/deprecated/deprecated_module_py39_earlier_pyversion.py new file mode 100644 index 0000000000..c1c2f17883 --- /dev/null +++ b/tests/functional/d/deprecated/deprecated_module_py39_earlier_pyversion.py @@ -0,0 +1,6 @@ +"""Test deprecated modules from Python 3.9, +but use an earlier --py-version and ensure a warning is still emitted. +""" +# pylint: disable=unused-import + +import binhex # [deprecated-module] diff --git a/tests/functional/d/deprecated/deprecated_module_py39_earlier_pyversion.rc b/tests/functional/d/deprecated/deprecated_module_py39_earlier_pyversion.rc new file mode 100644 index 0000000000..8118783a19 --- /dev/null +++ b/tests/functional/d/deprecated/deprecated_module_py39_earlier_pyversion.rc @@ -0,0 +1,5 @@ +[master] +py-version=3.8 + +[testoptions] +min_pyver=3.9 diff --git a/tests/functional/d/deprecated/deprecated_module_py39_earlier_pyversion.txt b/tests/functional/d/deprecated/deprecated_module_py39_earlier_pyversion.txt new file mode 100644 index 0000000000..558ed224a4 --- /dev/null +++ b/tests/functional/d/deprecated/deprecated_module_py39_earlier_pyversion.txt @@ -0,0 +1 @@ +deprecated-module:6:0:6:13::Uses of a deprecated module 'binhex':UNDEFINED From d01e5e167834097ff7e5bf26a069aa1339669183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Fri, 11 Mar 2022 15:37:59 +0100 Subject: [PATCH 029/473] Add ``typevar-name-missing-variance`` checker (#5825) Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Yudaka --- CONTRIBUTORS.txt | 2 + ChangeLog | 4 + doc/whatsnew/2.13.rst | 4 + pylint/checkers/base.py | 121 +++++++++++++++++- .../generic_alias_side_effects.py | 2 +- .../regression_2443_duplicate_bases.py | 2 +- .../t/typevar_name_incorrect_variance.py | 69 ++++++++++ .../t/typevar_name_incorrect_variance.txt | 21 +++ 8 files changed, 218 insertions(+), 7 deletions(-) create mode 100644 tests/functional/t/typevar_name_incorrect_variance.py create mode 100644 tests/functional/t/typevar_name_incorrect_variance.txt diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index eeaaa13b1e..ec76f57d7b 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -598,6 +598,8 @@ contributors: * Kian-Meng, Ang: contributor +* Nuzula H. Yudaka (Nuzhuka): contributor + * Carli Freudenberg (CarliJoy): contributor - Fixed issue 5281, added Unicode checker - Improve non-ascii-name checker diff --git a/ChangeLog b/ChangeLog index 6e3a338e12..33dacc56bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -450,6 +450,10 @@ Release date: TBA Insert your changelog randomly, it will reduce merge conflicts (Ie. not necessarily at the end) +* Added new checker ``typevar-name-missing-variance``. Emitted when a covariant + or contravariant ``TypeVar`` does not end with ``_co`` or ``_contra`` respectively or + when a ``TypeVar`` is not either but has a suffix. + What's New in Pylint 2.12.2? ============================ diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 1aa94d4aff..96dfa518a9 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -37,6 +37,10 @@ New checkers Closes #5460 +* Added new checker ``typevar-name-missing-variance``. Emitted when a covariant + or contravariant ``TypeVar`` does not end with ``_co`` or ``_contra`` respectively or + when a ``TypeVar`` is not either but has a suffix. + * Add ``modified-iterating-list``, ``modified-iterating-dict``, and ``modified-iterating-set``, emitted when items are added to or removed from respectively a list, dictionary or set being iterated through. diff --git a/pylint/checkers/base.py b/pylint/checkers/base.py index e2a3ece496..71dabd8efc 100644 --- a/pylint/checkers/base.py +++ b/pylint/checkers/base.py @@ -228,6 +228,7 @@ class AnyStyle(NamingStyle): # List of methods which can be redefined REDEFINABLE_METHODS = frozenset(("__module__",)) TYPING_FORWARD_REF_QNAME = "typing.ForwardRef" +TYPING_TYPE_VAR_QNAME = "typing.TypeVar" def _redefines_import(node): @@ -1738,6 +1739,16 @@ class NameChecker(_BasicChecker): ] }, ), + "C0105": ( + 'Type variable "%s" is %s, use "%s" instead', + "typevar-name-incorrect-variance", + "Emitted when a TypeVar name doesn't reflect its type variance. " + "According to PEP8, it is recommended to add suffixes '_co' and " + "'_contra' to the variables used to declare covariant or " + "contravariant behaviour respectively. Invariant (default) variables " + "do not require a suffix. The message is also emitted when invariant " + "variables do have a suffix.", + ), "W0111": ( "Name %s will become a keyword in Python %s", "assign-to-new-keyword", @@ -1940,33 +1951,69 @@ def visit_global(self, node: nodes.Global) -> None: for name in node.names: self._check_name("const", name, node) - @utils.check_messages("disallowed-name", "invalid-name", "assign-to-new-keyword") + @utils.check_messages( + "disallowed-name", + "invalid-name", + "assign-to-new-keyword", + "typevar-name-incorrect-variance", + ) def visit_assignname(self, node: nodes.AssignName) -> None: """Check module level assigned names.""" self._check_assign_to_new_keyword_violation(node.name, node) frame = node.frame(future=True) assign_type = node.assign_type() + + # Check names defined in comprehensions if isinstance(assign_type, nodes.Comprehension): self._check_name("inlinevar", node.name, node) + + # Check names defined in module scope elif isinstance(frame, nodes.Module): + # Check names defined in Assign nodes if isinstance(assign_type, nodes.Assign): - if isinstance(utils.safe_infer(assign_type.value), nodes.ClassDef): + inferred_assign_type = utils.safe_infer(assign_type.value) + + # Check TypeVar's assigned alone or in tuple assignment + if isinstance(node.parent, nodes.Assign) and self._assigns_typevar( + assign_type.value + ): + self._check_name("typevar", assign_type.targets[0].name, node) + elif ( + isinstance(node.parent, nodes.Tuple) + and isinstance(assign_type.value, nodes.Tuple) + and self._assigns_typevar( + assign_type.value.elts[node.parent.elts.index(node)] + ) + ): + self._check_name( + "typevar", + assign_type.targets[0].elts[node.parent.elts.index(node)].name, + node, + ) + + # Check classes (TypeVar's are classes so they need to be excluded first) + elif isinstance(inferred_assign_type, nodes.ClassDef): self._check_name("class", node.name, node) - # Don't emit if the name redefines an import - # in an ImportError except handler. + + # Don't emit if the name redefines an import in an ImportError except handler. elif not _redefines_import(node) and isinstance( - utils.safe_infer(assign_type.value), nodes.Const + inferred_assign_type, nodes.Const ): self._check_name("const", node.name, node) + # Check names defined in AnnAssign nodes elif isinstance( assign_type, nodes.AnnAssign ) and utils.is_assign_name_annotated_with(node, "Final"): self._check_name("const", node.name, node) + + # Check names defined in function scopes elif isinstance(frame, nodes.FunctionDef): # global introduced variable aren't in the function locals if node.name in frame and node.name not in frame.argnames(): if not _redefines_import(node): self._check_name("variable", node.name, node) + + # Check names defined in class scopes elif isinstance(frame, nodes.ClassDef): if not list(frame.local_attr_ancestors(node.name)): for ancestor in frame.ancestors(): @@ -2031,6 +2078,14 @@ def _name_disallowed_by_regex(self, name: str) -> bool: def _check_name(self, node_type, name, node, confidence=interfaces.HIGH): """Check for a name using the type's regexp.""" + # pylint: disable=fixme + # TODO: move this down in the function and check TypeVar + # for name patterns as well. + # Check TypeVar names for variance suffixes + if node_type == "typevar": + self._check_typevar_variance(name, node) + return + def _should_exempt_from_invalid_name(node): if node_type == "variable": inferred = utils.safe_infer(node) @@ -2075,6 +2130,62 @@ def _name_became_keyword_in_version(name, rules): return ".".join(str(v) for v in version) return None + @staticmethod + def _assigns_typevar(node: Optional[nodes.NodeNG]) -> bool: + """Check if a node is assigning a TypeVar.""" + if isinstance(node, astroid.Call): + inferred = utils.safe_infer(node.func) + if ( + isinstance(inferred, astroid.ClassDef) + and inferred.qname() == TYPING_TYPE_VAR_QNAME + ): + return True + return False + + def _check_typevar_variance(self, name: str, node: nodes.AssignName) -> None: + """Check if a TypeVar has a variance and if it's included in the name. + + Returns the args for the message to be displayed. + """ + if isinstance(node.parent, nodes.Assign): + keywords = node.assign_type().value.keywords + elif isinstance(node.parent, nodes.Tuple): + keywords = ( + node.assign_type().value.elts[node.parent.elts.index(node)].keywords + ) + + for kw in keywords: + if kw.arg == "covariant" and kw.value.value: + if not name.endswith("_co"): + suggest_name = f"{re.sub('_contra$', '', name)}_co" + self.add_message( + "typevar-name-incorrect-variance", + node=node, + args=(name, "covariant", suggest_name), + confidence=interfaces.INFERENCE, + ) + return + + if kw.arg == "contravariant" and kw.value.value: + if not name.endswith("_contra"): + suggest_name = f"{re.sub('_co$', '', name)}_contra" + self.add_message( + "typevar-name-incorrect-variance", + node=node, + args=(name, "contravariant", suggest_name), + confidence=interfaces.INFERENCE, + ) + return + + if name.endswith("_co") or name.endswith("_contra"): + suggest_name = re.sub("_contra$|_co$", "", name) + self.add_message( + "typevar-name-incorrect-variance", + node=node, + args=(name, "invariant", suggest_name), + confidence=interfaces.INFERENCE, + ) + class DocStringChecker(_BasicChecker): msgs = { diff --git a/tests/functional/g/generic_alias/generic_alias_side_effects.py b/tests/functional/g/generic_alias/generic_alias_side_effects.py index ea7d7a9ce9..344db95531 100644 --- a/tests/functional/g/generic_alias/generic_alias_side_effects.py +++ b/tests/functional/g/generic_alias/generic_alias_side_effects.py @@ -1,4 +1,4 @@ -# pylint: disable=missing-docstring,invalid-name,line-too-long,too-few-public-methods,use-list-literal,use-dict-literal +# pylint: disable=missing-docstring,invalid-name,line-too-long,too-few-public-methods,use-list-literal,use-dict-literal, typevar-name-incorrect-variance import typing import collections from typing import Generic, TypeVar diff --git a/tests/functional/r/regression/regression_2443_duplicate_bases.py b/tests/functional/r/regression/regression_2443_duplicate_bases.py index f32490c44a..b5ea1c9f98 100644 --- a/tests/functional/r/regression/regression_2443_duplicate_bases.py +++ b/tests/functional/r/regression/regression_2443_duplicate_bases.py @@ -1,4 +1,4 @@ -# pylint: disable=missing-docstring, too-many-ancestors,too-few-public-methods +# pylint: disable=missing-docstring, too-many-ancestors,too-few-public-methods, typevar-name-incorrect-variance from typing import Generic, TypeVar IN = TypeVar('IN', contravariant=True) diff --git a/tests/functional/t/typevar_name_incorrect_variance.py b/tests/functional/t/typevar_name_incorrect_variance.py new file mode 100644 index 0000000000..bb8a898801 --- /dev/null +++ b/tests/functional/t/typevar_name_incorrect_variance.py @@ -0,0 +1,69 @@ +"""Test case for typevar-name-incorrect-variance.""" + +from typing import TypeVar + +# Type variables without variance +T = TypeVar("T") +T_co = TypeVar("T_co") # [typevar-name-incorrect-variance] +T_contra = TypeVar("T_contra") # [typevar-name-incorrect-variance] +ScoresT_contra = TypeVar("ScoresT_contra") # [typevar-name-incorrect-variance] + +# Type variables not starting with T +N = TypeVar("N") +N_co = TypeVar("N_co", covariant=True) +N_contra = TypeVar("N_contra", contravariant=True) + +# Tests for combinations with contravariance +CT_co = TypeVar("CT_co", contravariant=True) # [typevar-name-incorrect-variance] +CT_contra = TypeVar("CT_contra") # [typevar-name-incorrect-variance] +CT_contra = TypeVar("CT_contra", contravariant=True) + +# Tests for combinations with covariance +VT = TypeVar("VT", covariant=True) # [typevar-name-incorrect-variance] +VT_contra = TypeVar("VT_contra", covariant=True) # [typevar-name-incorrect-variance] +VT_co = TypeVar("VT_co", covariant=True) + +# Tests for combinations with bound +VT = TypeVar("VT", bound=int) +VT_co = TypeVar("VT_co", bound=int) # [typevar-name-incorrect-variance] +VT_contra = TypeVar("VT_contra", bound=int) # [typevar-name-incorrect-variance] + +VT = TypeVar("VT", bound=int, covariant=True) # [typevar-name-incorrect-variance] +VT_co = TypeVar("VT_co", bound=int, covariant=True) +VT_contra = TypeVar( # [typevar-name-incorrect-variance] + "VT_contra", bound=int, covariant=True +) + +VT = TypeVar("VT", bound=int, covariant=False) +VT_co = TypeVar( # [typevar-name-incorrect-variance] + "VT_co", bound=int, covariant=False +) +VT_contra = TypeVar( # [typevar-name-incorrect-variance] + "VT_contra", bound=int, covariant=False +) + +VT = TypeVar("VT", bound=int, contravariant=True) # [typevar-name-incorrect-variance] +VT_co = TypeVar( # [typevar-name-incorrect-variance] + "VT_co", bound=int, contravariant=True +) +VT_contra = TypeVar("VT_contra", bound=int, contravariant=True) + +VT = TypeVar("VT", bound=int, contravariant=False) +VT_co = TypeVar( # [typevar-name-incorrect-variance] + "VT_co", bound=int, contravariant=False +) +VT_contra = TypeVar( # [typevar-name-incorrect-variance] + "VT_contra", bound=int, contravariant=False +) + +# Tests for combinations with tuple assignment +( + VT, # [typevar-name-incorrect-variance] + VT_contra, # [typevar-name-incorrect-variance] +) = TypeVar("VT", covariant=True), TypeVar("VT_contra", covariant=True) +VT_co, VT_contra = TypeVar( # [typevar-name-incorrect-variance] + "VT_co", covariant=True +), TypeVar("VT_contra", covariant=True) +VAR, VT_contra = "a string", TypeVar( # [typevar-name-incorrect-variance] + "VT_contra", covariant=True +) diff --git a/tests/functional/t/typevar_name_incorrect_variance.txt b/tests/functional/t/typevar_name_incorrect_variance.txt new file mode 100644 index 0000000000..d4dcfd2f9a --- /dev/null +++ b/tests/functional/t/typevar_name_incorrect_variance.txt @@ -0,0 +1,21 @@ +typevar-name-incorrect-variance:7:0:7:4::"Type variable ""T_co"" is invariant, use ""T"" instead":INFERENCE +typevar-name-incorrect-variance:8:0:8:8::"Type variable ""T_contra"" is invariant, use ""T"" instead":INFERENCE +typevar-name-incorrect-variance:9:0:9:14::"Type variable ""ScoresT_contra"" is invariant, use ""ScoresT"" instead":INFERENCE +typevar-name-incorrect-variance:17:0:17:5::"Type variable ""CT_co"" is contravariant, use ""CT_contra"" instead":INFERENCE +typevar-name-incorrect-variance:18:0:18:9::"Type variable ""CT_contra"" is invariant, use ""CT"" instead":INFERENCE +typevar-name-incorrect-variance:22:0:22:2::"Type variable ""VT"" is covariant, use ""VT_co"" instead":INFERENCE +typevar-name-incorrect-variance:23:0:23:9::"Type variable ""VT_contra"" is covariant, use ""VT_co"" instead":INFERENCE +typevar-name-incorrect-variance:28:0:28:5::"Type variable ""VT_co"" is invariant, use ""VT"" instead":INFERENCE +typevar-name-incorrect-variance:29:0:29:9::"Type variable ""VT_contra"" is invariant, use ""VT"" instead":INFERENCE +typevar-name-incorrect-variance:31:0:31:2::"Type variable ""VT"" is covariant, use ""VT_co"" instead":INFERENCE +typevar-name-incorrect-variance:33:0:33:9::"Type variable ""VT_contra"" is covariant, use ""VT_co"" instead":INFERENCE +typevar-name-incorrect-variance:38:0:38:5::"Type variable ""VT_co"" is invariant, use ""VT"" instead":INFERENCE +typevar-name-incorrect-variance:41:0:41:9::"Type variable ""VT_contra"" is invariant, use ""VT"" instead":INFERENCE +typevar-name-incorrect-variance:45:0:45:2::"Type variable ""VT"" is contravariant, use ""VT_contra"" instead":INFERENCE +typevar-name-incorrect-variance:46:0:46:5::"Type variable ""VT_co"" is contravariant, use ""VT_contra"" instead":INFERENCE +typevar-name-incorrect-variance:52:0:52:5::"Type variable ""VT_co"" is invariant, use ""VT"" instead":INFERENCE +typevar-name-incorrect-variance:55:0:55:9::"Type variable ""VT_contra"" is invariant, use ""VT"" instead":INFERENCE +typevar-name-incorrect-variance:61:4:61:6::"Type variable ""VT"" is covariant, use ""VT_co"" instead":INFERENCE +typevar-name-incorrect-variance:62:4:62:13::"Type variable ""VT_contra"" is covariant, use ""VT_co"" instead":INFERENCE +typevar-name-incorrect-variance:64:7:64:16::"Type variable ""VT_contra"" is covariant, use ""VT_co"" instead":INFERENCE +typevar-name-incorrect-variance:67:5:67:14::"Type variable ""VT_contra"" is covariant, use ""VT_co"" instead":INFERENCE From 6fd52958b1d6bb293e5cd3e857365d541d9a9fca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sat, 12 Mar 2022 10:39:49 +0100 Subject: [PATCH 030/473] Upgrade mypy to 0.940 (#5900) --- .pre-commit-config.yaml | 2 +- pylint/testutils/functional/test_file.py | 2 +- requirements_test_pre_commit.txt | 2 +- setup.cfg | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c440a0ca37..f4ace61f43 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -77,7 +77,7 @@ repos: types: [text] # necessary to include ChangeLog file files: ^(ChangeLog|doc/(.*/)*.*\.rst) - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.931 + rev: v0.940 hooks: - id: mypy name: mypy diff --git a/pylint/testutils/functional/test_file.py b/pylint/testutils/functional/test_file.py index bf2469e498..1ebc30d0e0 100644 --- a/pylint/testutils/functional/test_file.py +++ b/pylint/testutils/functional/test_file.py @@ -84,7 +84,7 @@ def _parse_options(self) -> None: assert ( name in POSSIBLE_TEST_OPTIONS ), f"[testoptions]' can only contains one of {POSSIBLE_TEST_OPTIONS}" - self.options[name] = conv(value) # type: ignore[misc] + self.options[name] = conv(value) # type: ignore[literal-required] @property def option_file(self) -> str: diff --git a/requirements_test_pre_commit.txt b/requirements_test_pre_commit.txt index 15ab3bd945..31bca7e84c 100644 --- a/requirements_test_pre_commit.txt +++ b/requirements_test_pre_commit.txt @@ -4,4 +4,4 @@ black==22.1.0 flake8==4.0.1 flake8-typing-imports==1.12.0 isort==5.10.1 -mypy==0.931 +mypy==0.940 diff --git a/setup.cfg b/setup.cfg index 1c235c535f..71462cb10c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -94,6 +94,7 @@ no_implicit_optional = True scripts_are_modules = True warn_unused_ignores = True show_error_codes = True +enable_error_code = ignore-without-code [mypy-astroid.*] ignore_missing_imports = True From 11807f0ae07af4d11a2ac8f9edbaa79558741cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sat, 12 Mar 2022 13:23:52 +0100 Subject: [PATCH 031/473] Update ``astroid`` requirement to 2.11.0 --- ChangeLog | 3 +++ doc/whatsnew/2.13.rst | 3 +++ requirements_test_min.txt | 2 +- setup.cfg | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 33dacc56bf..4f564286a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,9 @@ Release date: TBA Closes #5729 +* The line numbering for messages related to function arguments is now more accurate. This can + require some message disables to be relocated to updated positions. + * Add ``--recursive`` option to allow recursive discovery of all modules and packages in subtree. Running pylint with ``--recursive=y`` option will check all discovered ``.py`` files and packages found inside subtree of directory provided as parameter to pylint. diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 96dfa518a9..837a7ff330 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -110,6 +110,9 @@ Other Changes Closes #5840 +* The line numbering for messages related to function arguments is now more accurate. This can + require some message disables to be relocated to updated positions. + * ``using-f-string-in-unsupported-version`` and ``using-final-decorator-in-unsupported-version`` msgids were renamed from ``W1601`` and ``W1602`` to ``W2601`` and ``W2602``. Disables using these msgids will break. This is done in order to restore consistency with the already existing msgids for ``apply-builtin`` and diff --git a/requirements_test_min.txt b/requirements_test_min.txt index 8c5b0f9c38..10385cd5b6 100644 --- a/requirements_test_min.txt +++ b/requirements_test_min.txt @@ -1,6 +1,6 @@ -e .[testutil] # astroid dependency is also defined in setup.cfg -astroid==2.9.3 # Pinned to a specific version for tests +astroid==2.11.0 # Pinned to a specific version for tests typing-extensions~=4.0 pytest~=7.0 pytest-benchmark~=3.4 diff --git a/setup.cfg b/setup.cfg index 71462cb10c..31de3b711a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -48,7 +48,7 @@ install_requires = # Also upgrade requirements_test_min.txt if you are bumping astroid. # Pinned to dev of next minor update to allow editable installs, # see https://github.com/PyCQA/astroid/issues/1341 - astroid>=2.9.2,<=2.10.0-dev0 + astroid>=2.11.0,<=2.12.0-dev0 isort>=4.2.5,<6 mccabe>=0.6,<0.8 tomli>=1.1.0;python_version<"3.11" From 6273752b0e77b4cb9fe848225dfd72734707ae34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sat, 12 Mar 2022 13:37:05 +0100 Subject: [PATCH 032/473] Fixes for tests due to new ``tolineno`` behaviour --- tests/checkers/unittest_stdlib.py | 6 ++---- tests/checkers/unittest_unicode/unittest_bad_chars.py | 1 + .../ext/broad_try_clause/broad_try_clause_extension.txt | 2 +- tests/functional/i/invalid/invalid_name.py | 9 ++------- tests/functional/i/invalid/invalid_name.txt | 8 ++++---- tests/functional/r/regression/regression_2913.py | 2 +- tests/functional/r/regression/regression_2913.txt | 1 - 7 files changed, 11 insertions(+), 18 deletions(-) delete mode 100644 tests/functional/r/regression/regression_2913.txt diff --git a/tests/checkers/unittest_stdlib.py b/tests/checkers/unittest_stdlib.py index 88f5c79229..890fa7a8a9 100644 --- a/tests/checkers/unittest_stdlib.py +++ b/tests/checkers/unittest_stdlib.py @@ -49,10 +49,8 @@ def test_deprecated_no_qname_on_unexpected_nodes(self) -> None: """ def infer_func( - node: Name, context: Optional[Any] = None - ) -> Iterator[ - Union[Iterator, Iterator[AssignAttr]] - ]: # pylint: disable=unused-argument + node: Name, context: Optional[Any] = None # pylint: disable=unused-argument + ) -> Iterator[Union[Iterator, Iterator[AssignAttr]]]: new_node = nodes.AssignAttr(attrname="alpha", parent=node) yield new_node diff --git a/tests/checkers/unittest_unicode/unittest_bad_chars.py b/tests/checkers/unittest_unicode/unittest_bad_chars.py index 1f1e1e8d96..8c98e094bd 100644 --- a/tests/checkers/unittest_unicode/unittest_bad_chars.py +++ b/tests/checkers/unittest_unicode/unittest_bad_chars.py @@ -130,6 +130,7 @@ def test_find_bad_chars( # string module = astroid.MANAGER.ast_from_string(file) except AstroidBuildingError: + # pylint: disable-next=redefined-variable-type module = cast(nodes.Module, FakeNode(file.read_bytes())) expected = [ diff --git a/tests/functional/ext/broad_try_clause/broad_try_clause_extension.txt b/tests/functional/ext/broad_try_clause/broad_try_clause_extension.txt index 221d3a4c4d..d8d2c3e77c 100644 --- a/tests/functional/ext/broad_try_clause/broad_try_clause_extension.txt +++ b/tests/functional/ext/broad_try_clause/broad_try_clause_extension.txt @@ -1,4 +1,4 @@ too-many-try-statements:5:0:10:8::try clause contains 3 statements, expected at most 1:UNDEFINED too-many-try-statements:12:0:17:8::try clause contains 3 statements, expected at most 1:UNDEFINED -too-many-try-statements:19:0:27:8::try clause contains 4 statements, expected at most 1:UNDEFINED +too-many-try-statements:19:0:25:8::try clause contains 4 statements, expected at most 1:UNDEFINED too-many-try-statements:29:0:44:8::try clause contains 7 statements, expected at most 1:UNDEFINED diff --git a/tests/functional/i/invalid/invalid_name.py b/tests/functional/i/invalid/invalid_name.py index 527064c44c..201d5bf9f3 100644 --- a/tests/functional/i/invalid/invalid_name.py +++ b/tests/functional/i/invalid/invalid_name.py @@ -58,13 +58,8 @@ def wrapper(*args, **kwargs): return real_decorator -@dummy_decorator(1, [ - 0 # Fixing #119 should make this go away -# C0103 always points here - line 61 # [invalid-name] - - -]) -def a_very_very_very_long_function_name_WithCamelCase_to_make_it_sad(): # Should be line 65 +@dummy_decorator(1, [0]) +def a_very_very_very_long_function_name_WithCamelCase_to_make_it_sad(): # [invalid-name] """Docstring""" print('LOL') diff --git a/tests/functional/i/invalid/invalid_name.txt b/tests/functional/i/invalid/invalid_name.txt index 8f464f5d65..bec705f981 100644 --- a/tests/functional/i/invalid/invalid_name.txt +++ b/tests/functional/i/invalid/invalid_name.txt @@ -2,7 +2,7 @@ invalid-name:12:0:12:3::"Constant name ""aaa"" doesn't conform to UPPER_CASE nam invalid-name:16:4:16:8::"Constant name ""time"" doesn't conform to UPPER_CASE naming style":HIGH invalid-name:32:0:33:12:a:"Function name ""a"" doesn't conform to snake_case naming style":HIGH invalid-name:46:4:46:13::"Constant name ""Foocapfor"" doesn't conform to UPPER_CASE naming style":HIGH -invalid-name:63:0:69:16:a_very_very_very_long_function_name_WithCamelCase_to_make_it_sad:"Function name ""a_very_very_very_long_function_name_WithCamelCase_to_make_it_sad"" doesn't conform to snake_case naming style":HIGH -invalid-name:75:23:75:29:FooBar.__init__:"Argument name ""fooBar"" doesn't conform to snake_case naming style":HIGH -invalid-name:81:8:81:14:FooBar.func1:"Argument name ""fooBar"" doesn't conform to snake_case naming style":HIGH -invalid-name:101:8:101:15:FooBar.test_disable_mixed:"Argument name ""fooBar2"" doesn't conform to snake_case naming style":HIGH +invalid-name:62:0:64:16:a_very_very_very_long_function_name_WithCamelCase_to_make_it_sad:"Function name ""a_very_very_very_long_function_name_WithCamelCase_to_make_it_sad"" doesn't conform to snake_case naming style":HIGH +invalid-name:70:23:70:29:FooBar.__init__:"Argument name ""fooBar"" doesn't conform to snake_case naming style":HIGH +invalid-name:76:8:76:14:FooBar.func1:"Argument name ""fooBar"" doesn't conform to snake_case naming style":HIGH +invalid-name:96:8:96:15:FooBar.test_disable_mixed:"Argument name ""fooBar2"" doesn't conform to snake_case naming style":HIGH diff --git a/tests/functional/r/regression/regression_2913.py b/tests/functional/r/regression/regression_2913.py index f36adb4599..9bcc963faa 100644 --- a/tests/functional/r/regression/regression_2913.py +++ b/tests/functional/r/regression/regression_2913.py @@ -14,6 +14,6 @@ class BaseCorrect: # pylint: disable=too-few-public-methods """My base class.""" -class BaseInner: # [too-few-public-methods] +class BaseInner: # pylint: disable=too-few-public-methods """My base class.""" diff --git a/tests/functional/r/regression/regression_2913.txt b/tests/functional/r/regression/regression_2913.txt deleted file mode 100644 index f30ae1ae92..0000000000 --- a/tests/functional/r/regression/regression_2913.txt +++ /dev/null @@ -1 +0,0 @@ -too-few-public-methods:17:0:19:24:BaseInner:Too few public methods (0/2):UNDEFINED From 72193ab970705e532ecaffe91c1810bbc1745de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sat, 12 Mar 2022 15:33:50 +0100 Subject: [PATCH 033/473] Add regression test for issue #5408 (#5795) --- ChangeLog | 6 +++ doc/whatsnew/2.13.rst | 6 +++ .../r/regression_02/regression_5408.py | 37 +++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 tests/functional/r/regression_02/regression_5408.py diff --git a/ChangeLog b/ChangeLog index 4f564286a3..9422c8d21b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -131,6 +131,12 @@ Release date: TBA Closes #5670 +* Fixed crash with recursion error for inference of class attributes that referenced + the class itself. + + Closes #5408 + Ref PyCQA/astroid#1392 + * The issue template for crashes is now created for crashes which were previously not covered by this mechanism. diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 837a7ff330..22defda5df 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -219,6 +219,12 @@ Other Changes Closes #5177, #5212 +* Fixed crash with recursion error for inference of class attributes that referenced + the class itself. + + Closes #5408 + Ref PyCQA/astroid#1392 + * Fix ``unnecessary_dict_index_lookup`` false positive when deleting a dictionary's entry. Closes #4716 diff --git a/tests/functional/r/regression_02/regression_5408.py b/tests/functional/r/regression_02/regression_5408.py new file mode 100644 index 0000000000..b9bcdb9e83 --- /dev/null +++ b/tests/functional/r/regression_02/regression_5408.py @@ -0,0 +1,37 @@ +"""Regression test for issue 5408. + +Recursion error for self-referencing class attribute. +See: https://github.com/PyCQA/pylint/issues/5408 +""" + +# pylint: disable=missing-docstring, too-few-public-methods, invalid-name, inherit-non-class +# pylint: disable=no-self-argument + + +class MyInnerClass: + ... + + +class MySubClass: + inner_class = MyInnerClass + + +class MyClass: + sub_class = MySubClass() + + +def get_unpatched_class(cls): + return cls + + +def get_unpatched(item): + lookup = get_unpatched_class if isinstance(item, type) else lambda item: None + return lookup(item) + + +_Child = get_unpatched(MyClass.sub_class.inner_class) + + +class Child(_Child): + def patch(cls): + MyClass.sub_class.inner_class = cls From ae3853648ac012467c0c99e9388ffa008fc014af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sat, 12 Mar 2022 17:52:29 +0100 Subject: [PATCH 034/473] Add tests for #4826 (#5696) --- ChangeLog | 6 ++++++ doc/whatsnew/2.13.rst | 6 ++++++ .../functional/n/no/no_member_binary_operations.py | 13 +++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 tests/functional/n/no/no_member_binary_operations.py diff --git a/ChangeLog b/ChangeLog index 9422c8d21b..b73d77685e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,12 @@ Release date: TBA .. Put new features here and also in 'doc/whatsnew/2.13.rst' +* No longer emit ``no-member`` in for loops that reference ``self`` if the binary operation that + started the for loop uses a ``self`` that is encapsulated in tuples or lists. + + Ref PyCQA/astroid#1360 + Closes #4826 + * Fix pyreverse diagrams type hinting for classmethods and staticmethods. * Fix matching ``--notes`` options that end in a non-word character. diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 22defda5df..a3d10a9291 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -106,6 +106,12 @@ Extensions Other Changes ============= +* No longer emit ``no-member`` in for loops that reference ``self`` if the binary operation that + started the for loop uses a ``self`` that is encapsulated in tuples or lists. + + Ref PyCQA/astroid#1360 + Closes #4826 + * Fix matching ``--notes`` options that end in a non-word character. Closes #5840 diff --git a/tests/functional/n/no/no_member_binary_operations.py b/tests/functional/n/no/no_member_binary_operations.py new file mode 100644 index 0000000000..e998932ebe --- /dev/null +++ b/tests/functional/n/no/no_member_binary_operations.py @@ -0,0 +1,13 @@ +"""Tests for no-member in relation to binary operations.""" +# pylint: disable=too-few-public-methods, missing-class-docstring, missing-function-docstring + +# Test for: https://github.com/PyCQA/pylint/issues/4826 +class MyClass: + def __init__(self): + self.a_list = [] + self.data = [] + + def operator(self): + for i in [self] + self.a_list: + for _ in i.data: + pass From 7dcb3ae9020729e9fb3b53b171567620138d485b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sat, 12 Mar 2022 19:19:09 +0100 Subject: [PATCH 035/473] Add regression test for #5679 (#5725) --- ChangeLog | 5 ++ doc/whatsnew/2.13.rst | 5 ++ .../max_inferable_limit_for_classes/main.py | 38 +++++++++ .../nodes/roles.py | 82 +++++++++++++++++++ .../other_funcs.py | 31 +++++++ tests/test_self.py | 21 +++++ 6 files changed, 182 insertions(+) create mode 100644 tests/regrtest_data/max_inferable_limit_for_classes/main.py create mode 100644 tests/regrtest_data/max_inferable_limit_for_classes/nodes/roles.py create mode 100644 tests/regrtest_data/max_inferable_limit_for_classes/other_funcs.py diff --git a/ChangeLog b/ChangeLog index b73d77685e..ba2e3a20d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -333,6 +333,11 @@ Release date: TBA Closes #5557 +* Fixed a crash on ``__init__`` nodes when the attribute was previously uninferable due to a cache + limit size. This limit can be hit when the inheritance pattern of a class (and therefore of the ``__init__`` attribute) is very large. + + Closes #5679 + * Fix ``unnecessary_dict_index_lookup`` false positive when deleting a dictionary's entry. Closes #4716 diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index a3d10a9291..1b5fa13b93 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -210,6 +210,11 @@ Other Changes Closes #5713 +* Fixed a crash on ``__init__`` nodes when the attribute was previously uninferable due to a cache + limit size. This limit can be hit when the inheritance pattern of a class (and therefore of the ``__init__`` attribute) is very large. + + Closes #5679 + * Fixed extremely long processing of long lines with comma's. Closes #5483 diff --git a/tests/regrtest_data/max_inferable_limit_for_classes/main.py b/tests/regrtest_data/max_inferable_limit_for_classes/main.py new file mode 100644 index 0000000000..2588d916fe --- /dev/null +++ b/tests/regrtest_data/max_inferable_limit_for_classes/main.py @@ -0,0 +1,38 @@ +"""This example is based on sqlalchemy. + +See https://github.com/PyCQA/pylint/issues/5679 +""" +from other_funcs import FromClause + +from .nodes import roles + + +class HasMemoized(object): + ... + + +class Generative(HasMemoized): + ... + + +class ColumnElement( + roles.ColumnArgumentOrKeyRole, + roles.BinaryElementRole, + roles.OrderByRole, + roles.ColumnsClauseRole, + roles.LimitOffsetRole, + roles.DMLColumnRole, + roles.DDLConstraintColumnRole, + roles.StatementRole, + Generative, +): + ... + + +class FunctionElement(ColumnElement, FromClause): + ... + + +class months_between(FunctionElement): + def __init__(self): + super().__init__() diff --git a/tests/regrtest_data/max_inferable_limit_for_classes/nodes/roles.py b/tests/regrtest_data/max_inferable_limit_for_classes/nodes/roles.py new file mode 100644 index 0000000000..2f58f1b508 --- /dev/null +++ b/tests/regrtest_data/max_inferable_limit_for_classes/nodes/roles.py @@ -0,0 +1,82 @@ +class SQLRole(object): + ... + + +class UsesInspection(object): + ... + + +class AllowsLambdaRole(object): + ... + + +class ColumnArgumentRole(SQLRole): + ... + + +class ColumnArgumentOrKeyRole(ColumnArgumentRole): + ... + + +class ColumnListRole(SQLRole): + ... + + +class ColumnsClauseRole(AllowsLambdaRole, UsesInspection, ColumnListRole): + ... + + +class LimitOffsetRole(SQLRole): + ... + + +class ByOfRole(ColumnListRole): + ... + + +class OrderByRole(AllowsLambdaRole, ByOfRole): + ... + + +class StructuralRole(SQLRole): + ... + + +class ExpressionElementRole(SQLRole): + ... + + +class BinaryElementRole(ExpressionElementRole): + ... + + +class JoinTargetRole(AllowsLambdaRole, UsesInspection, StructuralRole): + ... + + +class FromClauseRole(ColumnsClauseRole, JoinTargetRole): + ... + + +class StrictFromClauseRole(FromClauseRole): + ... + + +class AnonymizedFromClauseRole(StrictFromClauseRole): + ... + + +class ReturnsRowsRole(SQLRole): + ... + + +class StatementRole(SQLRole): + ... + + +class DMLColumnRole(SQLRole): + ... + + +class DDLConstraintColumnRole(SQLRole): + ... diff --git a/tests/regrtest_data/max_inferable_limit_for_classes/other_funcs.py b/tests/regrtest_data/max_inferable_limit_for_classes/other_funcs.py new file mode 100644 index 0000000000..f737fbf5a8 --- /dev/null +++ b/tests/regrtest_data/max_inferable_limit_for_classes/other_funcs.py @@ -0,0 +1,31 @@ +from operator import attrgetter + +from .nodes import roles + + +class HasCacheKey(object): + ... + + +class HasMemoized(object): + ... + + +class MemoizedHasCacheKey(HasCacheKey, HasMemoized): + ... + + +class ClauseElement(MemoizedHasCacheKey): + ... + + +class ReturnsRows(roles.ReturnsRowsRole, ClauseElement): + ... + + +class Selectable(ReturnsRows): + ... + + +class FromClause(roles.AnonymizedFromClauseRole, Selectable): + c = property(attrgetter("columns")) diff --git a/tests/test_self.py b/tests/test_self.py index d22d2a5e48..0018b47a9b 100644 --- a/tests/test_self.py +++ b/tests/test_self.py @@ -1287,6 +1287,27 @@ def test_regex_paths_csv_validator() -> None: Run(["--ignore-paths", "test", join(HERE, "regrtest_data", "empty.py")]) assert ex.value.code == 0 + @staticmethod + def test_max_inferred_for_complicated_class_hierarchy() -> None: + """Regression test for a crash reported in https://github.com/PyCQA/pylint/issues/5679. + + The class hierarchy of 'sqlalchemy' is so intricate that it becomes uninferable with + the standard max_inferred of 100. We used to crash when this happened. + """ + with pytest.raises(SystemExit) as ex: + Run( + [ + join( + HERE, + "regrtest_data", + "max_inferable_limit_for_classes", + "main.py", + ), + ] + ) + # Error code should not include bit-value 1 for crash + assert not ex.value.code % 2 + def test_regression_recursive(self): self._test_output( [join(HERE, "regrtest_data", "directory", "subdirectory"), "--recursive=n"], From 49a2e193ac9b796867685b9caae67428c862ac24 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Sat, 12 Mar 2022 13:22:58 -0500 Subject: [PATCH 036/473] Fix false positive for `invalid-class-object` when inference fails (#5901) --- ChangeLog | 3 +++ doc/whatsnew/2.13.rst | 3 +++ pylint/checkers/classes/class_checker.py | 8 ++++++-- tests/functional/i/invalid/invalid_class_object.py | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ba2e3a20d4..825d1e15bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -230,6 +230,9 @@ Release date: TBA Closes #3793 +* Fixed a false positive for ``invalid-class-object`` when the object + being assigned to the ``__class__`` attribute is uninferable. + * Fixed false positive for ``used-before-assignment`` with self-referential type annotation in conditional statements within class methods. diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 1b5fa13b93..ed804f0624 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -307,6 +307,9 @@ Other Changes Closes #3793 +* Fixed a false positive for ``invalid-class-object`` when the object + being assigned to the ``__class__`` attribute is uninferable. + * Added a ``testutil`` extra require to the packaging, as ``gitpython`` should not be a dependency all the time but is still required to use the primer helper code in ``pylint.testutil``. You can install it with ``pip install pylint[testutil]``. diff --git a/pylint/checkers/classes/class_checker.py b/pylint/checkers/classes/class_checker.py index dcde9231b0..8dbb58fd4a 100644 --- a/pylint/checkers/classes/class_checker.py +++ b/pylint/checkers/classes/class_checker.py @@ -1482,8 +1482,12 @@ def _check_invalid_class_object(self, node: nodes.AssignAttr) -> None: if not node.attrname == "__class__": return inferred = safe_infer(node.parent.value) - if isinstance(inferred, nodes.ClassDef) or inferred is astroid.Uninferable: - # If is uninferrable, we allow it to prevent false positives + if ( + isinstance(inferred, nodes.ClassDef) + or inferred is astroid.Uninferable + or inferred is None + ): + # If is uninferable, we allow it to prevent false positives return self.add_message("invalid-class-object", node=node) diff --git a/tests/functional/i/invalid/invalid_class_object.py b/tests/functional/i/invalid/invalid_class_object.py index 367756eaa8..7c08ebae81 100644 --- a/tests/functional/i/invalid/invalid_class_object.py +++ b/tests/functional/i/invalid/invalid_class_object.py @@ -16,3 +16,17 @@ class B: A.__class__ = defaultdict A.__class__ = defaultdict(str) # [invalid-class-object] A.__class__ = 1 # [invalid-class-object] + + +# Here, ambiguity is found when inferring self.__class__ +class C: + @classmethod + def _new_instance(cls): + obj = C() + obj.__class__ = cls + return obj + + def __deepcopy__(self, memo): + obj = C() + obj.__class__ = self.__class__ + return obj From 6ead5fd8fbba5c63ecfa39ab269eaadc577b4cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sat, 12 Mar 2022 19:24:31 +0100 Subject: [PATCH 037/473] Use ``node.position`` in ``add_message`` if available (#5897) --- ChangeLog | 6 ++ doc/whatsnew/2.13.rst | 6 ++ pylint/lint/pylinter.py | 26 ++++--- pylint/testutils/unittest_linter.py | 26 ++++--- .../functional/a/abstract/abstract_method.txt | 32 ++++----- tests/functional/a/arguments_differ.txt | 24 +++---- tests/functional/a/arguments_renamed.txt | 22 +++--- tests/functional/a/async_functions.txt | 14 ++-- .../b/bad_staticmethod_argument.txt | 4 +- tests/functional/b/blacklisted_name.txt | 2 +- tests/functional/c/cached_property.txt | 2 +- .../functional/d/dangerous_default_value.txt | 44 ++++++------ tests/functional/d/dataclass_typecheck.txt | 2 +- tests/functional/d/disable_msg_next_line.txt | 2 +- tests/functional/d/docstrings.txt | 14 ++-- tests/functional/d/dotted_ancestor.txt | 2 +- tests/functional/d/duplicate_bases.txt | 2 +- tests/functional/ext/docparams/docparams.txt | 24 +++---- .../ext/docparams/missing_param_doc.txt | 36 +++++----- .../parameter/missing_param_doc_required.txt | 6 +- .../missing_param_doc_required_Google.txt | 52 +++++++------- .../missing_param_doc_required_Numpy.txt | 44 ++++++------ .../missing_param_doc_required_Sphinx.txt | 70 +++++++++---------- ...ram_doc_required_no_doc_rgx_check_init.txt | 2 +- ...param_doc_required_no_doc_rgx_test_all.txt | 2 +- .../docparams/raise/missing_raises_doc.txt | 2 +- .../raise/missing_raises_doc_Google.txt | 12 ++-- .../raise/missing_raises_doc_Numpy.txt | 12 ++-- .../raise/missing_raises_doc_Sphinx.txt | 12 ++-- .../raise/missing_raises_doc_required.txt | 2 +- ...ng_raises_doc_required_exc_inheritance.txt | 2 +- .../return/missing_return_doc_Google.txt | 10 +-- .../return/missing_return_doc_Numpy.txt | 10 +-- .../return/missing_return_doc_Sphinx.txt | 4 +- .../return/missing_return_doc_required.txt | 4 +- .../missing_return_doc_required_Google.txt | 16 ++--- .../missing_return_doc_required_Numpy.txt | 16 ++--- .../missing_return_doc_required_Sphinx.txt | 16 ++--- .../ext/docparams/useless_type_doc.txt | 8 +-- .../yield/missing_yield_doc_Google.txt | 2 +- .../yield/missing_yield_doc_Numpy.txt | 2 +- .../yield/missing_yield_doc_required.txt | 4 +- .../missing_yield_doc_required_Google.txt | 10 +-- .../missing_yield_doc_required_Numpy.txt | 6 +- .../missing_yield_doc_required_Sphinx.txt | 10 +-- .../docstyle/docstyle_first_line_empty.txt | 6 +- .../ext/docstyle/docstyle_quotes_py38.txt | 8 +-- .../ext/eq_without_hash/eq_without_hash.txt | 2 +- tests/functional/ext/mccabe/mccabe.txt | 28 ++++---- tests/functional/f/first_arg.txt | 10 +-- tests/functional/f/function_redefined.txt | 12 ++-- .../generic_alias_collections.txt | 22 +++--- .../generic_alias_collections_py37.txt | 10 +-- ...ric_alias_collections_py37_with_typing.txt | 10 +-- .../generic_alias_mixed_py37.txt | 10 +-- .../generic_alias_mixed_py39.txt | 10 +-- ...eneric_alias_postponed_evaluation_py37.txt | 10 +-- .../g/generic_alias/generic_alias_related.txt | 2 +- .../generic_alias_related_py39.txt | 2 +- .../generic_alias_side_effects.txt | 16 ++--- .../g/generic_alias/generic_alias_typing.txt | 24 +++---- .../i/inconsistent/inconsistent_mro.txt | 2 +- .../i/inconsistent/inconsistent_returns.txt | 34 ++++----- .../inconsistent_returns_noreturn.txt | 2 +- tests/functional/i/inherit_non_class.txt | 20 +++--- tests/functional/i/init_is_generator.txt | 2 +- tests/functional/i/init_not_called.txt | 4 +- .../i/invalid/invalid_bool_returned.txt | 6 +- .../i/invalid/invalid_bytes_returned.txt | 6 +- .../i/invalid/invalid_format_returned.txt | 6 +- .../invalid_getnewargs_ex_returned.txt | 12 ++-- .../invalid_getnewargs_returned.txt | 6 +- .../i/invalid/invalid_hash_returned.txt | 8 +-- .../i/invalid/invalid_index_returned.txt | 8 +-- .../invalid_length_hint_returned.txt | 6 +- .../invalid_length_returned.txt | 8 +-- .../i/invalid/invalid_metaclass.txt | 12 ++-- tests/functional/i/invalid/invalid_name.txt | 4 +- .../invalid_name_module_level.txt | 2 +- .../invalid_name_multinaming_style.txt | 2 +- .../invalid_name/invalid_name_property.txt | 4 +- .../i/invalid/invalid_overridden_method.txt | 12 ++-- .../i/invalid/invalid_repr_returned.txt | 6 +- .../i/invalid/invalid_str_returned.txt | 6 +- .../k/keyword_arg_before_vararg.txt | 8 +-- tests/functional/m/method_hidden.txt | 6 +- .../m/missing/missing_class_docstring.txt | 2 +- .../m/missing/missing_docstring.txt | 4 +- .../m/missing/missing_docstring_new_style.txt | 8 +-- .../m/missing/missing_function_docstring.txt | 4 +- .../missing_function_docstring_min_length.txt | 4 +- .../missing_function_docstring_rgx.txt | 2 +- .../m/missing/missing_self_argument.txt | 4 +- .../n/name/name_good_bad_names_regex.txt | 2 +- .../n/name/name_preset_snake_case.txt | 8 +-- tests/functional/n/name/name_styles.txt | 14 ++-- tests/functional/n/namePresetCamelCase.txt | 4 +- tests/functional/n/no/no_self_argument.txt | 4 +- .../functional/n/no/no_self_argument_py37.txt | 2 +- tests/functional/n/no/no_self_use.txt | 4 +- tests/functional/n/non/non_ascii_name.txt | 2 +- .../n/non/non_init_parent_called.txt | 2 +- .../n/non/non_iterator_returned.txt | 8 +-- .../non_ascii_name_function.txt | 2 +- .../non_ascii_name_staticmethod.txt | 2 +- .../non_ascii_name_class.txt | 2 +- .../non_ascii_name_class_method.txt | 2 +- tests/functional/n/nonlocal_and_global.txt | 2 +- .../o/overridden_final_method_py38.txt | 4 +- .../functional/p/property_with_parameters.txt | 2 +- tests/functional/p/protocol_classes.txt | 4 +- .../r/regression/regression_4680.txt | 2 +- .../r/regression/regression_4723.txt | 2 +- tests/functional/r/return_in_init.txt | 2 +- tests/functional/s/signature_differs.txt | 2 +- .../functional/s/singledispatch_functions.txt | 2 +- tests/functional/s/slots_checks.txt | 12 ++-- .../s/subclassed_final_class_py38.txt | 2 +- .../s/super/super_init_not_called.txt | 2 +- .../super_init_not_called_extensions.txt | 2 +- ...super_init_not_called_extensions_py310.txt | 2 +- .../t/too/too_few_public_methods.txt | 2 +- .../t/too/too_few_public_methods_excluded.txt | 2 +- tests/functional/t/too/too_many_ancestors.txt | 4 +- .../too_many_ancestors_ignored_parents.txt | 2 +- tests/functional/t/too/too_many_arguments.txt | 2 +- tests/functional/t/too/too_many_branches.txt | 2 +- .../t/too/too_many_instance_attributes.txt | 2 +- tests/functional/t/too/too_many_locals.txt | 6 +- .../t/too/too_many_public_methods.txt | 2 +- .../t/too/too_many_return_statements.txt | 2 +- .../functional/t/too/too_many_statements.txt | 6 +- tests/functional/t/typing_use.txt | 2 +- .../u/undefined/undefined_variable_py30.txt | 6 +- .../u/unexpected_special_method_signature.txt | 32 ++++----- .../u/unused/unused_private_member.txt | 20 +++--- .../u/unused/unused_variable_py38.txt | 8 +-- .../u/use/use_symbolic_message_instead.txt | 4 +- .../u/useless/useless_object_inheritance.txt | 8 +-- tests/functional/u/useless/useless_return.txt | 4 +- .../u/useless/useless_super_delegation.txt | 38 +++++----- .../useless/useless_super_delegation_py3.txt | 4 +- .../useless/useless_super_delegation_py35.txt | 2 +- .../useless/useless_super_delegation_py38.txt | 2 +- 144 files changed, 661 insertions(+), 629 deletions(-) diff --git a/ChangeLog b/ChangeLog index 825d1e15bf..709c895854 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,12 @@ Release date: TBA Closes #5840 +* Updated the position of messages for class and function defintions to no longer cover + the complete definition. Only the ``def`` or ``class`` + the name of the class/function + are covered. + + Closes #5466 + * ``using-f-string-in-unsupported-version`` and ``using-final-decorator-in-unsupported-version`` msgids were renamed from ``W1601`` and ``W1602`` to ``W2601`` and ``W2602``. Disabling using these msgids will break. This is done in order to restore consistency with the already existing msgids for ``apply-builtin`` and diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index ed804f0624..2314725da5 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -133,6 +133,12 @@ Other Changes Closes #352 +* Updated the position of messages for class and function defintions to no longer cover + the complete definition. Only the ``def`` or ``class`` + the name of the class/function + are covered. + + Closes #5466 + * Reinstated checks from the python3 checker that are still useful for python 3 (``eq-without-hash``). This is now in the ``pylint.extensions.eq_without_hash`` optional extension. diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py index 2f5389d613..9f94da292d 100644 --- a/pylint/lint/pylinter.py +++ b/pylint/lint/pylinter.py @@ -1526,14 +1526,24 @@ def _add_one_message( # Look up "location" data of node if not yet supplied if node: - if not line: - line = node.fromlineno - if not col_offset: - col_offset = node.col_offset - if not end_lineno: - end_lineno = node.end_lineno - if not end_col_offset: - end_col_offset = node.end_col_offset + if node.position: + if not line: + line = node.position.lineno + if not col_offset: + col_offset = node.position.col_offset + if not end_lineno: + end_lineno = node.position.end_lineno + if not end_col_offset: + end_col_offset = node.position.end_col_offset + else: + if not line: + line = node.fromlineno + if not col_offset: + col_offset = node.col_offset + if not end_lineno: + end_lineno = node.end_lineno + if not end_col_offset: + end_col_offset = node.end_col_offset # should this message be displayed if not self.is_message_enabled(message_definition.msgid, line, confidence): diff --git a/pylint/testutils/unittest_linter.py b/pylint/testutils/unittest_linter.py index c9945f52fb..37d430fd2b 100644 --- a/pylint/testutils/unittest_linter.py +++ b/pylint/testutils/unittest_linter.py @@ -46,14 +46,24 @@ def add_message( # Look up "location" data of node if not yet supplied if node: - if not line: - line = node.fromlineno - if not col_offset: - col_offset = node.col_offset - if not end_lineno: - end_lineno = node.end_lineno - if not end_col_offset: - end_col_offset = node.end_col_offset + if node.position: + if not line: + line = node.position.lineno + if not col_offset: + col_offset = node.position.col_offset + if not end_lineno: + end_lineno = node.position.end_lineno + if not end_col_offset: + end_col_offset = node.position.end_col_offset + else: + if not line: + line = node.fromlineno + if not col_offset: + col_offset = node.col_offset + if not end_lineno: + end_lineno = node.end_lineno + if not end_col_offset: + end_col_offset = node.end_col_offset self._messages.append( MessageTest( diff --git a/tests/functional/a/abstract/abstract_method.txt b/tests/functional/a/abstract/abstract_method.txt index 1eb47639c6..2b4ea9a2eb 100644 --- a/tests/functional/a/abstract/abstract_method.txt +++ b/tests/functional/a/abstract/abstract_method.txt @@ -1,16 +1,16 @@ -abstract-method:47:0:51:38:Concrete:Method 'bbbb' is abstract in class 'Abstract' but is not overridden:UNDEFINED -abstract-method:70:0:72:12:Container:Method '__hash__' is abstract in class 'Structure' but is not overridden:UNDEFINED -abstract-method:70:0:72:12:Container:Method '__iter__' is abstract in class 'Structure' but is not overridden:UNDEFINED -abstract-method:70:0:72:12:Container:Method '__len__' is abstract in class 'Structure' but is not overridden:UNDEFINED -abstract-method:76:0:78:17:Sizable:Method '__contains__' is abstract in class 'Structure' but is not overridden:UNDEFINED -abstract-method:76:0:78:17:Sizable:Method '__hash__' is abstract in class 'Structure' but is not overridden:UNDEFINED -abstract-method:76:0:78:17:Sizable:Method '__iter__' is abstract in class 'Structure' but is not overridden:UNDEFINED -abstract-method:82:0:83:17:Hashable:Method '__contains__' is abstract in class 'Structure' but is not overridden:UNDEFINED -abstract-method:82:0:83:17:Hashable:Method '__iter__' is abstract in class 'Structure' but is not overridden:UNDEFINED -abstract-method:82:0:83:17:Hashable:Method '__len__' is abstract in class 'Structure' but is not overridden:UNDEFINED -abstract-method:87:0:91:19:Iterator:Method '__contains__' is abstract in class 'Structure' but is not overridden:UNDEFINED -abstract-method:87:0:91:19:Iterator:Method '__hash__' is abstract in class 'Structure' but is not overridden:UNDEFINED -abstract-method:87:0:91:19:Iterator:Method '__len__' is abstract in class 'Structure' but is not overridden:UNDEFINED -abstract-method:106:0:107:8:BadComplexMro:Method '__hash__' is abstract in class 'Structure' but is not overridden:UNDEFINED -abstract-method:106:0:107:8:BadComplexMro:Method '__len__' is abstract in class 'AbstractSizable' but is not overridden:UNDEFINED -abstract-method:106:0:107:8:BadComplexMro:Method 'length' is abstract in class 'AbstractSizable' but is not overridden:UNDEFINED +abstract-method:47:0:47:14:Concrete:Method 'bbbb' is abstract in class 'Abstract' but is not overridden:UNDEFINED +abstract-method:70:0:70:15:Container:Method '__hash__' is abstract in class 'Structure' but is not overridden:UNDEFINED +abstract-method:70:0:70:15:Container:Method '__iter__' is abstract in class 'Structure' but is not overridden:UNDEFINED +abstract-method:70:0:70:15:Container:Method '__len__' is abstract in class 'Structure' but is not overridden:UNDEFINED +abstract-method:76:0:76:13:Sizable:Method '__contains__' is abstract in class 'Structure' but is not overridden:UNDEFINED +abstract-method:76:0:76:13:Sizable:Method '__hash__' is abstract in class 'Structure' but is not overridden:UNDEFINED +abstract-method:76:0:76:13:Sizable:Method '__iter__' is abstract in class 'Structure' but is not overridden:UNDEFINED +abstract-method:82:0:82:14:Hashable:Method '__contains__' is abstract in class 'Structure' but is not overridden:UNDEFINED +abstract-method:82:0:82:14:Hashable:Method '__iter__' is abstract in class 'Structure' but is not overridden:UNDEFINED +abstract-method:82:0:82:14:Hashable:Method '__len__' is abstract in class 'Structure' but is not overridden:UNDEFINED +abstract-method:87:0:87:14:Iterator:Method '__contains__' is abstract in class 'Structure' but is not overridden:UNDEFINED +abstract-method:87:0:87:14:Iterator:Method '__hash__' is abstract in class 'Structure' but is not overridden:UNDEFINED +abstract-method:87:0:87:14:Iterator:Method '__len__' is abstract in class 'Structure' but is not overridden:UNDEFINED +abstract-method:106:0:106:19:BadComplexMro:Method '__hash__' is abstract in class 'Structure' but is not overridden:UNDEFINED +abstract-method:106:0:106:19:BadComplexMro:Method '__len__' is abstract in class 'AbstractSizable' but is not overridden:UNDEFINED +abstract-method:106:0:106:19:BadComplexMro:Method 'length' is abstract in class 'AbstractSizable' but is not overridden:UNDEFINED diff --git a/tests/functional/a/arguments_differ.txt b/tests/functional/a/arguments_differ.txt index 5cce378e27..07ef79a0f9 100644 --- a/tests/functional/a/arguments_differ.txt +++ b/tests/functional/a/arguments_differ.txt @@ -1,12 +1,12 @@ -arguments-differ:12:4:13:12:Child.test:Number of parameters was 1 in 'Parent.test' and is now 2 in overridden 'Child.test' method:UNDEFINED -arguments-differ:23:4:24:12:ChildDefaults.test:Number of parameters was 3 in 'ParentDefaults.test' and is now 2 in overridden 'ChildDefaults.test' method:UNDEFINED -arguments-differ:41:4:42:12:ClassmethodChild.func:Number of parameters was 2 in 'Classmethod.func' and is now 0 in overridden 'ClassmethodChild.func' method:UNDEFINED -arguments-differ:68:4:69:64:VarargsChild.has_kwargs:Variadics removed in overridden 'VarargsChild.has_kwargs' method:UNDEFINED -arguments-renamed:71:4:72:89:VarargsChild.no_kwargs:Parameter 'args' has been renamed to 'arg' in overridden 'VarargsChild.no_kwargs' method:UNDEFINED -arguments-differ:144:4:145:26:StaticmethodChild2.func:Number of parameters was 1 in 'Staticmethod.func' and is now 2 in overridden 'StaticmethodChild2.func' method:UNDEFINED -arguments-differ:180:4:181:12:SecondChangesArgs.test:Number of parameters was 2 in 'FirstHasArgs.test' and is now 4 in overridden 'SecondChangesArgs.test' method:UNDEFINED -arguments-differ:306:4:307:60:Foo.kwonly_1:Number of parameters was 4 in 'AbstractFoo.kwonly_1' and is now 3 in overridden 'Foo.kwonly_1' method:UNDEFINED -arguments-differ:309:4:310:82:Foo.kwonly_2:Number of parameters was 3 in 'AbstractFoo.kwonly_2' and is now 2 in overridden 'Foo.kwonly_2' method:UNDEFINED -arguments-differ:312:4:313:32:Foo.kwonly_3:Number of parameters was 3 in 'AbstractFoo.kwonly_3' and is now 3 in overridden 'Foo.kwonly_3' method:UNDEFINED -arguments-differ:315:4:316:32:Foo.kwonly_4:Number of parameters was 3 in 'AbstractFoo.kwonly_4' and is now 3 in overridden 'Foo.kwonly_4' method:UNDEFINED -arguments-differ:318:4:319:41:Foo.kwonly_5:Variadics removed in overridden 'Foo.kwonly_5' method:UNDEFINED +arguments-differ:12:4:12:12:Child.test:Number of parameters was 1 in 'Parent.test' and is now 2 in overridden 'Child.test' method:UNDEFINED +arguments-differ:23:4:23:12:ChildDefaults.test:Number of parameters was 3 in 'ParentDefaults.test' and is now 2 in overridden 'ChildDefaults.test' method:UNDEFINED +arguments-differ:41:4:41:12:ClassmethodChild.func:Number of parameters was 2 in 'Classmethod.func' and is now 0 in overridden 'ClassmethodChild.func' method:UNDEFINED +arguments-differ:68:4:68:18:VarargsChild.has_kwargs:Variadics removed in overridden 'VarargsChild.has_kwargs' method:UNDEFINED +arguments-renamed:71:4:71:17:VarargsChild.no_kwargs:Parameter 'args' has been renamed to 'arg' in overridden 'VarargsChild.no_kwargs' method:UNDEFINED +arguments-differ:144:4:144:12:StaticmethodChild2.func:Number of parameters was 1 in 'Staticmethod.func' and is now 2 in overridden 'StaticmethodChild2.func' method:UNDEFINED +arguments-differ:180:4:180:12:SecondChangesArgs.test:Number of parameters was 2 in 'FirstHasArgs.test' and is now 4 in overridden 'SecondChangesArgs.test' method:UNDEFINED +arguments-differ:306:4:306:16:Foo.kwonly_1:Number of parameters was 4 in 'AbstractFoo.kwonly_1' and is now 3 in overridden 'Foo.kwonly_1' method:UNDEFINED +arguments-differ:309:4:309:16:Foo.kwonly_2:Number of parameters was 3 in 'AbstractFoo.kwonly_2' and is now 2 in overridden 'Foo.kwonly_2' method:UNDEFINED +arguments-differ:312:4:312:16:Foo.kwonly_3:Number of parameters was 3 in 'AbstractFoo.kwonly_3' and is now 3 in overridden 'Foo.kwonly_3' method:UNDEFINED +arguments-differ:315:4:315:16:Foo.kwonly_4:Number of parameters was 3 in 'AbstractFoo.kwonly_4' and is now 3 in overridden 'Foo.kwonly_4' method:UNDEFINED +arguments-differ:318:4:318:16:Foo.kwonly_5:Variadics removed in overridden 'Foo.kwonly_5' method:UNDEFINED diff --git a/tests/functional/a/arguments_renamed.txt b/tests/functional/a/arguments_renamed.txt index 366aa47300..7f6466ba8d 100644 --- a/tests/functional/a/arguments_renamed.txt +++ b/tests/functional/a/arguments_renamed.txt @@ -1,11 +1,11 @@ -arguments-renamed:17:4:18:55:Orange.brew:Parameter 'fruit_name' has been renamed to 'orange_name' in overridden 'Orange.brew' method:UNDEFINED -arguments-renamed:20:4:21:69:Orange.eat_with_condiment:Parameter 'fruit_name' has been renamed to 'orange_name' in overridden 'Orange.eat_with_condiment' method:UNDEFINED -arguments-differ:27:4:28:68:Banana.eat_with_condiment:Number of parameters was 3 in 'Fruit.eat_with_condiment' and is now 4 in overridden 'Banana.eat_with_condiment' method:UNDEFINED -arguments-renamed:40:4:41:23:Child.test:Parameter 'arg' has been renamed to 'arg1' in overridden 'Child.test' method:UNDEFINED -arguments-renamed:43:4:44:61:Child.kwargs_test:Parameter 'var1' has been renamed to 'value1' in overridden 'Child.kwargs_test' method:UNDEFINED -arguments-renamed:48:4:49:22:Child2.test:Parameter 'arg' has been renamed to 'var' in overridden 'Child2.test' method:UNDEFINED -arguments-differ:51:4:52:58:Child2.kwargs_test:Number of parameters was 4 in 'Parent.kwargs_test' and is now 3 in overridden 'Child2.kwargs_test' method:UNDEFINED -arguments-renamed:51:4:52:58:Child2.kwargs_test:Parameter 'var2' has been renamed to 'kw2' in overridden 'Child2.kwargs_test' method:UNDEFINED -arguments-renamed:67:4:68:56:ChildDefaults.test1:Parameter 'barg' has been renamed to 'param2' in overridden 'ChildDefaults.test1' method:UNDEFINED -arguments-renamed:95:8:96:59:FruitOverrideConditional.brew:Parameter 'fruit_name' has been renamed to 'orange_name' in overridden 'FruitOverrideConditional.brew' method:UNDEFINED -arguments-differ:99:12:100:76:FruitOverrideConditional.eat_with_condiment:Number of parameters was 3 in 'FruitConditional.eat_with_condiment' and is now 4 in overridden 'FruitOverrideConditional.eat_with_condiment' method:UNDEFINED +arguments-renamed:17:4:17:12:Orange.brew:Parameter 'fruit_name' has been renamed to 'orange_name' in overridden 'Orange.brew' method:UNDEFINED +arguments-renamed:20:4:20:26:Orange.eat_with_condiment:Parameter 'fruit_name' has been renamed to 'orange_name' in overridden 'Orange.eat_with_condiment' method:UNDEFINED +arguments-differ:27:4:27:26:Banana.eat_with_condiment:Number of parameters was 3 in 'Fruit.eat_with_condiment' and is now 4 in overridden 'Banana.eat_with_condiment' method:UNDEFINED +arguments-renamed:40:4:40:12:Child.test:Parameter 'arg' has been renamed to 'arg1' in overridden 'Child.test' method:UNDEFINED +arguments-renamed:43:4:43:19:Child.kwargs_test:Parameter 'var1' has been renamed to 'value1' in overridden 'Child.kwargs_test' method:UNDEFINED +arguments-renamed:48:4:48:12:Child2.test:Parameter 'arg' has been renamed to 'var' in overridden 'Child2.test' method:UNDEFINED +arguments-differ:51:4:51:19:Child2.kwargs_test:Number of parameters was 4 in 'Parent.kwargs_test' and is now 3 in overridden 'Child2.kwargs_test' method:UNDEFINED +arguments-renamed:51:4:51:19:Child2.kwargs_test:Parameter 'var2' has been renamed to 'kw2' in overridden 'Child2.kwargs_test' method:UNDEFINED +arguments-renamed:67:4:67:13:ChildDefaults.test1:Parameter 'barg' has been renamed to 'param2' in overridden 'ChildDefaults.test1' method:UNDEFINED +arguments-renamed:95:8:95:16:FruitOverrideConditional.brew:Parameter 'fruit_name' has been renamed to 'orange_name' in overridden 'FruitOverrideConditional.brew' method:UNDEFINED +arguments-differ:99:12:99:34:FruitOverrideConditional.eat_with_condiment:Number of parameters was 3 in 'FruitConditional.eat_with_condiment' and is now 4 in overridden 'FruitOverrideConditional.eat_with_condiment' method:UNDEFINED diff --git a/tests/functional/a/async_functions.txt b/tests/functional/a/async_functions.txt index 535e387097..7ab56e2d3c 100644 --- a/tests/functional/a/async_functions.txt +++ b/tests/functional/a/async_functions.txt @@ -1,11 +1,11 @@ -redefined-builtin:5:0:6:8:next:Redefining built-in 'next':UNDEFINED +redefined-builtin:5:0:5:14:next:Redefining built-in 'next':UNDEFINED unused-argument:8:30:8:34:some_function:Unused argument 'arg2':HIGH bad-super-call:22:8:22:31:Class.some_method:Bad first argument 'OtherClass' given to super():UNDEFINED -too-many-arguments:26:0:53:12:complex_function:Too many arguments (10/5):UNDEFINED -too-many-branches:26:0:53:12:complex_function:Too many branches (13/12):UNDEFINED -too-many-return-statements:26:0:53:12:complex_function:Too many return statements (10/6):UNDEFINED -dangerous-default-value:57:0:58:15:func:Dangerous default value [] as argument:UNDEFINED +too-many-arguments:26:0:26:26:complex_function:Too many arguments (10/5):UNDEFINED +too-many-branches:26:0:26:26:complex_function:Too many branches (13/12):UNDEFINED +too-many-return-statements:26:0:26:26:complex_function:Too many return statements (10/6):UNDEFINED +dangerous-default-value:57:0:57:14:func:Dangerous default value [] as argument:UNDEFINED duplicate-argument-name:57:15:57:16:func:Duplicate argument name a in function definition:UNDEFINED duplicate-argument-name:57:18:57:19:func:Duplicate argument name a in function definition:UNDEFINED -disallowed-name:62:0:63:6:foo:"Disallowed name ""foo""":UNDEFINED -empty-docstring:62:0:63:6:foo:Empty function docstring:HIGH +disallowed-name:62:0:62:13:foo:"Disallowed name ""foo""":UNDEFINED +empty-docstring:62:0:62:13:foo:Empty function docstring:HIGH diff --git a/tests/functional/b/bad_staticmethod_argument.txt b/tests/functional/b/bad_staticmethod_argument.txt index 115555c31b..1456726875 100644 --- a/tests/functional/b/bad_staticmethod_argument.txt +++ b/tests/functional/b/bad_staticmethod_argument.txt @@ -1,2 +1,2 @@ -bad-staticmethod-argument:5:4:6:12:Abcd.method1:Static method with 'self' as first argument:UNDEFINED -bad-staticmethod-argument:10:4:11:12:Abcd.method2:Static method with 'cls' as first argument:UNDEFINED +bad-staticmethod-argument:5:4:5:15:Abcd.method1:Static method with 'self' as first argument:UNDEFINED +bad-staticmethod-argument:10:4:10:15:Abcd.method2:Static method with 'cls' as first argument:UNDEFINED diff --git a/tests/functional/b/blacklisted_name.txt b/tests/functional/b/blacklisted_name.txt index 63fe309713..b6b96c5901 100644 --- a/tests/functional/b/blacklisted_name.txt +++ b/tests/functional/b/blacklisted_name.txt @@ -1 +1 @@ -disallowed-name:3:0:4:8:baz:"Disallowed name ""baz""":UNDEFINED +disallowed-name:3:0:3:7:baz:"Disallowed name ""baz""":UNDEFINED diff --git a/tests/functional/c/cached_property.txt b/tests/functional/c/cached_property.txt index a4b52237c8..3756dd9198 100644 --- a/tests/functional/c/cached_property.txt +++ b/tests/functional/c/cached_property.txt @@ -1 +1 @@ -invalid-overridden-method:22:4:23:17:Child.func:Method 'func' was expected to be 'method', found it instead as 'property':UNDEFINED +invalid-overridden-method:22:4:22:12:Child.func:Method 'func' was expected to be 'method', found it instead as 'property':UNDEFINED diff --git a/tests/functional/d/dangerous_default_value.txt b/tests/functional/d/dangerous_default_value.txt index 5d809f2359..98d55c2b62 100644 --- a/tests/functional/d/dangerous_default_value.txt +++ b/tests/functional/d/dangerous_default_value.txt @@ -1,22 +1,22 @@ -dangerous-default-value:6:0:8:16:function1:Dangerous default value [] as argument:UNDEFINED -dangerous-default-value:10:0:12:16:function2:Dangerous default value HEHE (builtins.dict) as argument:UNDEFINED -dangerous-default-value:18:0:20:16:function4:Dangerous default value set() (builtins.set) as argument:UNDEFINED -dangerous-default-value:28:0:30:16:function6:Dangerous default value GLOBAL_SET (builtins.set) as argument:UNDEFINED -dangerous-default-value:32:0:34:16:function7:Dangerous default value dict() (builtins.dict) as argument:UNDEFINED -dangerous-default-value:36:0:38:16:function8:Dangerous default value list() (builtins.list) as argument:UNDEFINED -dangerous-default-value:40:0:42:16:function9:Dangerous default value [] as argument:UNDEFINED -dangerous-default-value:44:0:46:16:function10:Dangerous default value {} as argument:UNDEFINED -dangerous-default-value:48:0:50:16:function11:Dangerous default value list() (builtins.list) as argument:UNDEFINED -dangerous-default-value:52:0:54:16:function12:Dangerous default value dict() (builtins.dict) as argument:UNDEFINED -dangerous-default-value:61:0:63:16:function13:Dangerous default value OINK (builtins.dict) as argument:UNDEFINED -dangerous-default-value:65:0:69:16:function14:Dangerous default value dict() (builtins.dict) as argument:UNDEFINED -dangerous-default-value:73:0:75:16:function15:Dangerous default value INVALID_DICT (builtins.dict) as argument:UNDEFINED -dangerous-default-value:77:0:79:16:function16:Dangerous default value set() as argument:UNDEFINED -dangerous-default-value:81:0:83:16:function17:Dangerous default value deque() (collections.deque) as argument:UNDEFINED -dangerous-default-value:85:0:87:16:function18:Dangerous default value ChainMap() (collections.ChainMap) as argument:UNDEFINED -dangerous-default-value:89:0:91:16:function19:Dangerous default value Counter() (collections.Counter) as argument:UNDEFINED -dangerous-default-value:93:0:95:16:function20:Dangerous default value OrderedDict() (collections.OrderedDict) as argument:UNDEFINED -dangerous-default-value:97:0:99:16:function21:Dangerous default value defaultdict() (collections.defaultdict) as argument:UNDEFINED -dangerous-default-value:101:0:103:16:function22:Dangerous default value UserDict() (collections.UserDict) as argument:UNDEFINED -dangerous-default-value:105:0:107:16:function23:Dangerous default value UserList() (collections.UserList) as argument:UNDEFINED -dangerous-default-value:109:0:111:16:function24:Dangerous default value [] as argument:UNDEFINED +dangerous-default-value:6:0:6:13:function1:Dangerous default value [] as argument:UNDEFINED +dangerous-default-value:10:0:10:13:function2:Dangerous default value HEHE (builtins.dict) as argument:UNDEFINED +dangerous-default-value:18:0:18:13:function4:Dangerous default value set() (builtins.set) as argument:UNDEFINED +dangerous-default-value:28:0:28:13:function6:Dangerous default value GLOBAL_SET (builtins.set) as argument:UNDEFINED +dangerous-default-value:32:0:32:13:function7:Dangerous default value dict() (builtins.dict) as argument:UNDEFINED +dangerous-default-value:36:0:36:13:function8:Dangerous default value list() (builtins.list) as argument:UNDEFINED +dangerous-default-value:40:0:40:13:function9:Dangerous default value [] as argument:UNDEFINED +dangerous-default-value:44:0:44:14:function10:Dangerous default value {} as argument:UNDEFINED +dangerous-default-value:48:0:48:14:function11:Dangerous default value list() (builtins.list) as argument:UNDEFINED +dangerous-default-value:52:0:52:14:function12:Dangerous default value dict() (builtins.dict) as argument:UNDEFINED +dangerous-default-value:61:0:61:14:function13:Dangerous default value OINK (builtins.dict) as argument:UNDEFINED +dangerous-default-value:65:0:65:14:function14:Dangerous default value dict() (builtins.dict) as argument:UNDEFINED +dangerous-default-value:73:0:73:14:function15:Dangerous default value INVALID_DICT (builtins.dict) as argument:UNDEFINED +dangerous-default-value:77:0:77:14:function16:Dangerous default value set() as argument:UNDEFINED +dangerous-default-value:81:0:81:14:function17:Dangerous default value deque() (collections.deque) as argument:UNDEFINED +dangerous-default-value:85:0:85:14:function18:Dangerous default value ChainMap() (collections.ChainMap) as argument:UNDEFINED +dangerous-default-value:89:0:89:14:function19:Dangerous default value Counter() (collections.Counter) as argument:UNDEFINED +dangerous-default-value:93:0:93:14:function20:Dangerous default value OrderedDict() (collections.OrderedDict) as argument:UNDEFINED +dangerous-default-value:97:0:97:14:function21:Dangerous default value defaultdict() (collections.defaultdict) as argument:UNDEFINED +dangerous-default-value:101:0:101:14:function22:Dangerous default value UserDict() (collections.UserDict) as argument:UNDEFINED +dangerous-default-value:105:0:105:14:function23:Dangerous default value UserList() (collections.UserList) as argument:UNDEFINED +dangerous-default-value:109:0:109:14:function24:Dangerous default value [] as argument:UNDEFINED diff --git a/tests/functional/d/dataclass_typecheck.txt b/tests/functional/d/dataclass_typecheck.txt index e898c85fad..97f5860bb6 100644 --- a/tests/functional/d/dataclass_typecheck.txt +++ b/tests/functional/d/dataclass_typecheck.txt @@ -7,6 +7,6 @@ unsubscriptable-object:56:6:56:15::Value 'obj.attr1' is unsubscriptable:UNDEFINE unsupported-assignment-operation:61:0:61:9::'obj.attr1' does not support item assignment:UNDEFINED unsupported-delete-operation:66:4:66:13::'obj.attr1' does not support item deletion:UNDEFINED not-context-manager:91:0:92:8::Context manager 'str' doesn't implement __enter__ and __exit__.:UNDEFINED -invalid-metaclass:99:0:100:8:Test2:Invalid metaclass 'Instance of builtins.int' used:UNDEFINED +invalid-metaclass:99:0:99:11:Test2:Invalid metaclass 'Instance of builtins.int' used:UNDEFINED unhashable-dict-key:105:0:105:2::Dict key is unhashable:UNDEFINED isinstance-second-argument-not-valid-type:115:6:115:30::Second argument of isinstance is not a type:UNDEFINED diff --git a/tests/functional/d/disable_msg_next_line.txt b/tests/functional/d/disable_msg_next_line.txt index 6601f74377..36ba9527d2 100644 --- a/tests/functional/d/disable_msg_next_line.txt +++ b/tests/functional/d/disable_msg_next_line.txt @@ -1,5 +1,5 @@ invalid-name:15:4:15:5:function_C:"Variable name ""x"" doesn't conform to snake_case naming style":HIGH unused-variable:15:4:15:5:function_C:Unused variable 'x':UNDEFINED f-string-without-interpolation:16:11:16:44:function_C:Using an f-string that does not have any interpolated variables:UNDEFINED -invalid-name:19:0:20:15:function_D:"Function name ""function_D"" doesn't conform to snake_case naming style":HIGH +invalid-name:19:0:19:14:function_D:"Function name ""function_D"" doesn't conform to snake_case naming style":HIGH unused-argument:19:21:19:25:function_D:Unused argument 'arg2':HIGH diff --git a/tests/functional/d/docstrings.txt b/tests/functional/d/docstrings.txt index 31e25bf368..d1e21f7af5 100644 --- a/tests/functional/d/docstrings.txt +++ b/tests/functional/d/docstrings.txt @@ -1,8 +1,8 @@ missing-module-docstring:1:0:None:None::Missing module docstring:HIGH -empty-docstring:6:0:7:10:function0:Empty function docstring:HIGH -missing-function-docstring:10:0:12:16:function1:Missing function or method docstring:HIGH -missing-class-docstring:23:0:53:12:AAAA:Missing class docstring:HIGH -missing-function-docstring:40:4:41:12:AAAA.method1:Missing function or method docstring:INFERENCE -empty-docstring:48:4:50:12:AAAA.method3:Empty method docstring:INFERENCE -empty-docstring:62:4:64:12:DDDD.method2:Empty method docstring:INFERENCE -missing-function-docstring:70:4:71:12:DDDD.method4:Missing function or method docstring:INFERENCE +empty-docstring:6:0:6:13:function0:Empty function docstring:HIGH +missing-function-docstring:10:0:10:13:function1:Missing function or method docstring:HIGH +missing-class-docstring:23:0:23:10:AAAA:Missing class docstring:HIGH +missing-function-docstring:40:4:40:15:AAAA.method1:Missing function or method docstring:INFERENCE +empty-docstring:48:4:48:15:AAAA.method3:Empty method docstring:INFERENCE +empty-docstring:62:4:62:15:DDDD.method2:Empty method docstring:INFERENCE +missing-function-docstring:70:4:70:15:DDDD.method4:Missing function or method docstring:INFERENCE diff --git a/tests/functional/d/dotted_ancestor.txt b/tests/functional/d/dotted_ancestor.txt index 9d45ae6bee..f7c6e1f251 100644 --- a/tests/functional/d/dotted_ancestor.txt +++ b/tests/functional/d/dotted_ancestor.txt @@ -1 +1 @@ -too-few-public-methods:7:0:10:50:Aaaa:Too few public methods (0/2):UNDEFINED +too-few-public-methods:7:0:7:10:Aaaa:Too few public methods (0/2):UNDEFINED diff --git a/tests/functional/d/duplicate_bases.txt b/tests/functional/d/duplicate_bases.txt index d656763207..f52bbfe44f 100644 --- a/tests/functional/d/duplicate_bases.txt +++ b/tests/functional/d/duplicate_bases.txt @@ -1 +1 @@ -duplicate-bases:5:0:6:8:Duplicates:Duplicate bases for class 'Duplicates':UNDEFINED +duplicate-bases:5:0:5:16:Duplicates:Duplicate bases for class 'Duplicates':UNDEFINED diff --git a/tests/functional/ext/docparams/docparams.txt b/tests/functional/ext/docparams/docparams.txt index 1fbad61851..c75a954414 100644 --- a/tests/functional/ext/docparams/docparams.txt +++ b/tests/functional/ext/docparams/docparams.txt @@ -1,12 +1,12 @@ -missing-return-doc:4:0:6:17:_private_func1:Missing return documentation:UNDEFINED -missing-return-type-doc:4:0:6:17:_private_func1:Missing return type documentation:UNDEFINED -missing-yield-doc:9:0:11:16:_private_func2:Missing yield documentation:UNDEFINED -missing-yield-type-doc:9:0:11:16:_private_func2:Missing yield type documentation:UNDEFINED -missing-raises-doc:14:0:16:30:_private_func3:"""Exception"" not documented as being raised":UNDEFINED -missing-any-param-doc:19:0:21:17:public_func1:"Missing any documentation in ""public_func1""":UNDEFINED -missing-return-doc:24:0:26:17:_async_private_func1:Missing return documentation:UNDEFINED -missing-return-type-doc:24:0:26:17:_async_private_func1:Missing return type documentation:UNDEFINED -missing-yield-doc:29:0:31:16:_async_private_func2:Missing yield documentation:UNDEFINED -missing-yield-type-doc:29:0:31:16:_async_private_func2:Missing yield type documentation:UNDEFINED -missing-raises-doc:34:0:36:30:_async_private_func3:"""Exception"" not documented as being raised":UNDEFINED -missing-any-param-doc:39:0:41:17:async_public_func1:"Missing any documentation in ""async_public_func1""":UNDEFINED +missing-return-doc:4:0:4:18:_private_func1:Missing return documentation:UNDEFINED +missing-return-type-doc:4:0:4:18:_private_func1:Missing return type documentation:UNDEFINED +missing-yield-doc:9:0:9:18:_private_func2:Missing yield documentation:UNDEFINED +missing-yield-type-doc:9:0:9:18:_private_func2:Missing yield type documentation:UNDEFINED +missing-raises-doc:14:0:14:18:_private_func3:"""Exception"" not documented as being raised":UNDEFINED +missing-any-param-doc:19:0:19:16:public_func1:"Missing any documentation in ""public_func1""":UNDEFINED +missing-return-doc:24:0:24:30:_async_private_func1:Missing return documentation:UNDEFINED +missing-return-type-doc:24:0:24:30:_async_private_func1:Missing return type documentation:UNDEFINED +missing-yield-doc:29:0:29:30:_async_private_func2:Missing yield documentation:UNDEFINED +missing-yield-type-doc:29:0:29:30:_async_private_func2:Missing yield type documentation:UNDEFINED +missing-raises-doc:34:0:34:30:_async_private_func3:"""Exception"" not documented as being raised":UNDEFINED +missing-any-param-doc:39:0:39:28:async_public_func1:"Missing any documentation in ""async_public_func1""":UNDEFINED diff --git a/tests/functional/ext/docparams/missing_param_doc.txt b/tests/functional/ext/docparams/missing_param_doc.txt index c528212073..c43bdbd7ec 100644 --- a/tests/functional/ext/docparams/missing_param_doc.txt +++ b/tests/functional/ext/docparams/missing_param_doc.txt @@ -1,18 +1,18 @@ -missing-any-param-doc:3:0:6:21:foobar1:"Missing any documentation in ""foobar1""":UNDEFINED -missing-any-param-doc:8:0:13:21:foobar2:"Missing any documentation in ""foobar2""":UNDEFINED -missing-param-doc:15:0:22:27:foobar3:"""arg1, arg2, arg3"" missing in parameter documentation":UNDEFINED -missing-type-doc:15:0:22:27:foobar3:"""arg2"" missing in parameter type documentation":UNDEFINED -missing-param-doc:24:0:31:21:foobar4:"""arg2"" missing in parameter documentation":UNDEFINED -missing-type-doc:24:0:31:21:foobar4:"""arg2"" missing in parameter type documentation":UNDEFINED -missing-param-doc:33:0:41:21:foobar5:"""arg2"" missing in parameter documentation":UNDEFINED -missing-type-doc:33:0:41:21:foobar5:"""arg1"" missing in parameter type documentation":UNDEFINED -missing-param-doc:43:0:51:27:foobar6:"""arg2, arg3"" missing in parameter documentation":UNDEFINED -missing-type-doc:43:0:51:27:foobar6:"""arg3"" missing in parameter type documentation":UNDEFINED -missing-any-param-doc:53:0:59:21:foobar7:"Missing any documentation in ""foobar7""":UNDEFINED -missing-any-param-doc:61:0:64:15:foobar8:"Missing any documentation in ""foobar8""":UNDEFINED -missing-param-doc:66:0:74:27:foobar9:"""arg1, arg2, arg3"" missing in parameter documentation":UNDEFINED -missing-param-doc:76:0:86:27:foobar10:"""arg2"" missing in parameter documentation":UNDEFINED -missing-type-doc:76:0:86:27:foobar10:"""arg1, arg3"" missing in parameter type documentation":UNDEFINED -missing-any-param-doc:88:0:95:21:foobar11:"Missing any documentation in ""foobar11""":UNDEFINED -missing-param-doc:97:0:106:27:foobar12:"""arg1, arg3"" missing in parameter documentation":UNDEFINED -missing-type-doc:97:0:106:27:foobar12:"""arg2, arg3"" missing in parameter type documentation":UNDEFINED +missing-any-param-doc:3:0:3:11:foobar1:"Missing any documentation in ""foobar1""":UNDEFINED +missing-any-param-doc:8:0:8:11:foobar2:"Missing any documentation in ""foobar2""":UNDEFINED +missing-param-doc:15:0:15:11:foobar3:"""arg1, arg2, arg3"" missing in parameter documentation":UNDEFINED +missing-type-doc:15:0:15:11:foobar3:"""arg2"" missing in parameter type documentation":UNDEFINED +missing-param-doc:24:0:24:11:foobar4:"""arg2"" missing in parameter documentation":UNDEFINED +missing-type-doc:24:0:24:11:foobar4:"""arg2"" missing in parameter type documentation":UNDEFINED +missing-param-doc:33:0:33:11:foobar5:"""arg2"" missing in parameter documentation":UNDEFINED +missing-type-doc:33:0:33:11:foobar5:"""arg1"" missing in parameter type documentation":UNDEFINED +missing-param-doc:43:0:43:11:foobar6:"""arg2, arg3"" missing in parameter documentation":UNDEFINED +missing-type-doc:43:0:43:11:foobar6:"""arg3"" missing in parameter type documentation":UNDEFINED +missing-any-param-doc:53:0:53:11:foobar7:"Missing any documentation in ""foobar7""":UNDEFINED +missing-any-param-doc:61:0:61:11:foobar8:"Missing any documentation in ""foobar8""":UNDEFINED +missing-param-doc:66:0:66:11:foobar9:"""arg1, arg2, arg3"" missing in parameter documentation":UNDEFINED +missing-param-doc:76:0:76:12:foobar10:"""arg2"" missing in parameter documentation":UNDEFINED +missing-type-doc:76:0:76:12:foobar10:"""arg1, arg3"" missing in parameter type documentation":UNDEFINED +missing-any-param-doc:88:0:88:12:foobar11:"Missing any documentation in ""foobar11""":UNDEFINED +missing-param-doc:97:0:97:12:foobar12:"""arg1, arg3"" missing in parameter documentation":UNDEFINED +missing-type-doc:97:0:97:12:foobar12:"""arg2, arg3"" missing in parameter type documentation":UNDEFINED diff --git a/tests/functional/ext/docparams/parameter/missing_param_doc_required.txt b/tests/functional/ext/docparams/parameter/missing_param_doc_required.txt index e1672e427c..1db477b902 100644 --- a/tests/functional/ext/docparams/parameter/missing_param_doc_required.txt +++ b/tests/functional/ext/docparams/parameter/missing_param_doc_required.txt @@ -1,3 +1,3 @@ -missing-any-param-doc:7:0:12:38:test_don_t_tolerate_no_param_documentation_at_all:"Missing any documentation in ""test_don_t_tolerate_no_param_documentation_at_all""":UNDEFINED -missing-param-doc:44:0:51:7:test_kwonlyargs_are_taken_in_account:"""missing_kwonly"" missing in parameter documentation":UNDEFINED -missing-type-doc:44:0:51:7:test_kwonlyargs_are_taken_in_account:"""missing_kwonly"" missing in parameter type documentation":UNDEFINED +missing-any-param-doc:7:0:7:53:test_don_t_tolerate_no_param_documentation_at_all:"Missing any documentation in ""test_don_t_tolerate_no_param_documentation_at_all""":UNDEFINED +missing-param-doc:44:0:44:40:test_kwonlyargs_are_taken_in_account:"""missing_kwonly"" missing in parameter documentation":UNDEFINED +missing-type-doc:44:0:44:40:test_kwonlyargs_are_taken_in_account:"""missing_kwonly"" missing in parameter type documentation":UNDEFINED diff --git a/tests/functional/ext/docparams/parameter/missing_param_doc_required_Google.txt b/tests/functional/ext/docparams/parameter/missing_param_doc_required_Google.txt index 6efbd6b1c5..c0daa6ee21 100644 --- a/tests/functional/ext/docparams/parameter/missing_param_doc_required_Google.txt +++ b/tests/functional/ext/docparams/parameter/missing_param_doc_required_Google.txt @@ -1,26 +1,26 @@ -missing-param-doc:24:0:35:7:test_missing_func_params_in_google_docstring:"""y"" missing in parameter documentation":UNDEFINED -missing-type-doc:24:0:35:7:test_missing_func_params_in_google_docstring:"""x, y"" missing in parameter type documentation":UNDEFINED -missing-type-doc:80:0:92:7:test_missing_func_params_with_partial_annotations_in_google_docstring:"""x"" missing in parameter type documentation":UNDEFINED -differing-param-doc:129:0:142:28:test_func_params_and_wrong_keyword_params_in_google_docstring:"""these"" differing in parameter documentation":UNDEFINED -differing-type-doc:129:0:142:28:test_func_params_and_wrong_keyword_params_in_google_docstring:"""these"" differing in parameter type documentation":UNDEFINED -missing-param-doc:129:0:142:28:test_func_params_and_wrong_keyword_params_in_google_docstring:"""that"" missing in parameter documentation":UNDEFINED -missing-type-doc:129:0:142:28:test_func_params_and_wrong_keyword_params_in_google_docstring:"""that"" missing in parameter type documentation":UNDEFINED -missing-param-doc:146:4:156:11:Foo.test_missing_method_params_in_google_docstring:"""y"" missing in parameter documentation":UNDEFINED -missing-type-doc:146:4:156:11:Foo.test_missing_method_params_in_google_docstring:"""x, y"" missing in parameter type documentation":UNDEFINED -differing-param-doc:177:0:189:22:test_wrong_name_of_func_params_in_google_docstring_one:"""xarg1, zarg1"" differing in parameter documentation":UNDEFINED -differing-type-doc:177:0:189:22:test_wrong_name_of_func_params_in_google_docstring_one:"""xarg1, zarg1"" differing in parameter type documentation":UNDEFINED -missing-param-doc:177:0:189:22:test_wrong_name_of_func_params_in_google_docstring_one:"""xarg, zarg"" missing in parameter documentation":UNDEFINED -missing-type-doc:177:0:189:22:test_wrong_name_of_func_params_in_google_docstring_one:"""xarg, zarg"" missing in parameter type documentation":UNDEFINED -differing-param-doc:192:0:203:22:test_wrong_name_of_func_params_in_google_docstring_two:"""yarg1"" differing in parameter documentation":UNDEFINED -differing-type-doc:192:0:203:22:test_wrong_name_of_func_params_in_google_docstring_two:"""yarg1"" differing in parameter type documentation":UNDEFINED -missing-param-doc:219:0:233:12:ClassFoo:"""x"" missing in parameter documentation":UNDEFINED -missing-type-doc:219:0:233:12:ClassFoo:"""x, y"" missing in parameter type documentation":UNDEFINED -missing-param-doc:237:4:246:11:ClassFoo.__init__:"""x"" missing in parameter documentation":UNDEFINED -missing-type-doc:237:4:246:11:ClassFoo.__init__:"""x, y"" missing in parameter type documentation":UNDEFINED -missing-param-doc:249:0:270:11:ClassFoo:"""x"" missing in parameter documentation":UNDEFINED -missing-type-doc:249:0:270:11:ClassFoo:"""x, y"" missing in parameter type documentation":UNDEFINED -multiple-constructor-doc:249:0:270:11:ClassFoo:"""ClassFoo"" has constructor parameters documented in class and __init__":UNDEFINED -missing-param-doc:263:4:270:11:ClassFoo.__init__:"""x"" missing in parameter documentation":UNDEFINED -missing-type-doc:263:4:270:11:ClassFoo.__init__:"""x, y"" missing in parameter type documentation":UNDEFINED -missing-param-doc:273:0:283:24:test_warns_missing_args_google:"""*args"" missing in parameter documentation":UNDEFINED -missing-param-doc:286:0:296:24:test_warns_missing_kwargs_google:"""**kwargs"" missing in parameter documentation":UNDEFINED +missing-param-doc:24:0:24:48:test_missing_func_params_in_google_docstring:"""y"" missing in parameter documentation":UNDEFINED +missing-type-doc:24:0:24:48:test_missing_func_params_in_google_docstring:"""x, y"" missing in parameter type documentation":UNDEFINED +missing-type-doc:80:0:80:73:test_missing_func_params_with_partial_annotations_in_google_docstring:"""x"" missing in parameter type documentation":UNDEFINED +differing-param-doc:129:0:129:65:test_func_params_and_wrong_keyword_params_in_google_docstring:"""these"" differing in parameter documentation":UNDEFINED +differing-type-doc:129:0:129:65:test_func_params_and_wrong_keyword_params_in_google_docstring:"""these"" differing in parameter type documentation":UNDEFINED +missing-param-doc:129:0:129:65:test_func_params_and_wrong_keyword_params_in_google_docstring:"""that"" missing in parameter documentation":UNDEFINED +missing-type-doc:129:0:129:65:test_func_params_and_wrong_keyword_params_in_google_docstring:"""that"" missing in parameter type documentation":UNDEFINED +missing-param-doc:146:4:146:54:Foo.test_missing_method_params_in_google_docstring:"""y"" missing in parameter documentation":UNDEFINED +missing-type-doc:146:4:146:54:Foo.test_missing_method_params_in_google_docstring:"""x, y"" missing in parameter type documentation":UNDEFINED +differing-param-doc:177:0:177:58:test_wrong_name_of_func_params_in_google_docstring_one:"""xarg1, zarg1"" differing in parameter documentation":UNDEFINED +differing-type-doc:177:0:177:58:test_wrong_name_of_func_params_in_google_docstring_one:"""xarg1, zarg1"" differing in parameter type documentation":UNDEFINED +missing-param-doc:177:0:177:58:test_wrong_name_of_func_params_in_google_docstring_one:"""xarg, zarg"" missing in parameter documentation":UNDEFINED +missing-type-doc:177:0:177:58:test_wrong_name_of_func_params_in_google_docstring_one:"""xarg, zarg"" missing in parameter type documentation":UNDEFINED +differing-param-doc:192:0:192:58:test_wrong_name_of_func_params_in_google_docstring_two:"""yarg1"" differing in parameter documentation":UNDEFINED +differing-type-doc:192:0:192:58:test_wrong_name_of_func_params_in_google_docstring_two:"""yarg1"" differing in parameter type documentation":UNDEFINED +missing-param-doc:219:0:219:14:ClassFoo:"""x"" missing in parameter documentation":UNDEFINED +missing-type-doc:219:0:219:14:ClassFoo:"""x, y"" missing in parameter type documentation":UNDEFINED +missing-param-doc:237:4:237:16:ClassFoo.__init__:"""x"" missing in parameter documentation":UNDEFINED +missing-type-doc:237:4:237:16:ClassFoo.__init__:"""x, y"" missing in parameter type documentation":UNDEFINED +missing-param-doc:249:0:249:14:ClassFoo:"""x"" missing in parameter documentation":UNDEFINED +missing-type-doc:249:0:249:14:ClassFoo:"""x, y"" missing in parameter type documentation":UNDEFINED +multiple-constructor-doc:249:0:249:14:ClassFoo:"""ClassFoo"" has constructor parameters documented in class and __init__":UNDEFINED +missing-param-doc:263:4:263:16:ClassFoo.__init__:"""x"" missing in parameter documentation":UNDEFINED +missing-type-doc:263:4:263:16:ClassFoo.__init__:"""x, y"" missing in parameter type documentation":UNDEFINED +missing-param-doc:273:0:273:34:test_warns_missing_args_google:"""*args"" missing in parameter documentation":UNDEFINED +missing-param-doc:286:0:286:36:test_warns_missing_kwargs_google:"""**kwargs"" missing in parameter documentation":UNDEFINED diff --git a/tests/functional/ext/docparams/parameter/missing_param_doc_required_Numpy.txt b/tests/functional/ext/docparams/parameter/missing_param_doc_required_Numpy.txt index d4f8be211d..bd73de9cce 100644 --- a/tests/functional/ext/docparams/parameter/missing_param_doc_required_Numpy.txt +++ b/tests/functional/ext/docparams/parameter/missing_param_doc_required_Numpy.txt @@ -1,22 +1,22 @@ -missing-param-doc:9:0:23:7:test_missing_func_params_in_numpy_docstring:"""y"" missing in parameter documentation":UNDEFINED -missing-type-doc:9:0:23:7:test_missing_func_params_in_numpy_docstring:"""x, y"" missing in parameter type documentation":UNDEFINED -missing-param-doc:27:4:39:11:Foo.test_missing_method_params_in_numpy_docstring:"""y"" missing in parameter documentation":UNDEFINED -missing-type-doc:27:4:39:11:Foo.test_missing_method_params_in_numpy_docstring:"""x, y"" missing in parameter type documentation":UNDEFINED -differing-param-doc:66:0:82:22:test_wrong_name_of_func_params_in_numpy_docstring:"""xarg1, zarg1"" differing in parameter documentation":UNDEFINED -differing-type-doc:66:0:82:22:test_wrong_name_of_func_params_in_numpy_docstring:"""xarg1, zarg1"" differing in parameter type documentation":UNDEFINED -missing-param-doc:66:0:82:22:test_wrong_name_of_func_params_in_numpy_docstring:"""xarg, zarg"" missing in parameter documentation":UNDEFINED -missing-type-doc:66:0:82:22:test_wrong_name_of_func_params_in_numpy_docstring:"""xarg, zarg"" missing in parameter type documentation":UNDEFINED -differing-param-doc:85:0:98:22:test_wrong_name_of_func_params_in_numpy_docstring_two:"""yarg1"" differing in parameter documentation":UNDEFINED -differing-type-doc:85:0:98:22:test_wrong_name_of_func_params_in_numpy_docstring_two:"""yarg1"" differing in parameter type documentation":UNDEFINED -missing-param-doc:116:0:132:12:ClassFoo:"""x"" missing in parameter documentation":UNDEFINED -missing-type-doc:116:0:132:12:ClassFoo:"""x, y"" missing in parameter type documentation":UNDEFINED -missing-param-doc:156:4:169:11:ClassFoo.__init__:"""x"" missing in parameter documentation":UNDEFINED -missing-type-doc:156:4:169:11:ClassFoo.__init__:"""x, y"" missing in parameter type documentation":UNDEFINED -missing-param-doc:172:0:197:11:ClassFoo:"""x"" missing in parameter documentation":UNDEFINED -missing-type-doc:172:0:197:11:ClassFoo:"""x, y"" missing in parameter type documentation":UNDEFINED -multiple-constructor-doc:172:0:197:11:ClassFoo:"""ClassFoo"" has constructor parameters documented in class and __init__":UNDEFINED -missing-param-doc:188:4:197:11:ClassFoo.__init__:"""x"" missing in parameter documentation":UNDEFINED -missing-type-doc:188:4:197:11:ClassFoo.__init__:"""x, y"" missing in parameter type documentation":UNDEFINED -missing-param-doc:200:0:214:24:test_warns_missing_args_numpy:"""*args"" missing in parameter documentation":UNDEFINED -missing-param-doc:217:0:231:24:test_warns_missing_kwargs_numpy:"""**kwargs"" missing in parameter documentation":UNDEFINED -missing-type-doc:234:0:256:24:test_finds_args_without_type_numpy:"""untyped_arg"" missing in parameter type documentation":UNDEFINED +missing-param-doc:9:0:9:47:test_missing_func_params_in_numpy_docstring:"""y"" missing in parameter documentation":UNDEFINED +missing-type-doc:9:0:9:47:test_missing_func_params_in_numpy_docstring:"""x, y"" missing in parameter type documentation":UNDEFINED +missing-param-doc:27:4:27:53:Foo.test_missing_method_params_in_numpy_docstring:"""y"" missing in parameter documentation":UNDEFINED +missing-type-doc:27:4:27:53:Foo.test_missing_method_params_in_numpy_docstring:"""x, y"" missing in parameter type documentation":UNDEFINED +differing-param-doc:66:0:66:53:test_wrong_name_of_func_params_in_numpy_docstring:"""xarg1, zarg1"" differing in parameter documentation":UNDEFINED +differing-type-doc:66:0:66:53:test_wrong_name_of_func_params_in_numpy_docstring:"""xarg1, zarg1"" differing in parameter type documentation":UNDEFINED +missing-param-doc:66:0:66:53:test_wrong_name_of_func_params_in_numpy_docstring:"""xarg, zarg"" missing in parameter documentation":UNDEFINED +missing-type-doc:66:0:66:53:test_wrong_name_of_func_params_in_numpy_docstring:"""xarg, zarg"" missing in parameter type documentation":UNDEFINED +differing-param-doc:85:0:85:57:test_wrong_name_of_func_params_in_numpy_docstring_two:"""yarg1"" differing in parameter documentation":UNDEFINED +differing-type-doc:85:0:85:57:test_wrong_name_of_func_params_in_numpy_docstring_two:"""yarg1"" differing in parameter type documentation":UNDEFINED +missing-param-doc:116:0:116:14:ClassFoo:"""x"" missing in parameter documentation":UNDEFINED +missing-type-doc:116:0:116:14:ClassFoo:"""x, y"" missing in parameter type documentation":UNDEFINED +missing-param-doc:156:4:156:16:ClassFoo.__init__:"""x"" missing in parameter documentation":UNDEFINED +missing-type-doc:156:4:156:16:ClassFoo.__init__:"""x, y"" missing in parameter type documentation":UNDEFINED +missing-param-doc:172:0:172:14:ClassFoo:"""x"" missing in parameter documentation":UNDEFINED +missing-type-doc:172:0:172:14:ClassFoo:"""x, y"" missing in parameter type documentation":UNDEFINED +multiple-constructor-doc:172:0:172:14:ClassFoo:"""ClassFoo"" has constructor parameters documented in class and __init__":UNDEFINED +missing-param-doc:188:4:188:16:ClassFoo.__init__:"""x"" missing in parameter documentation":UNDEFINED +missing-type-doc:188:4:188:16:ClassFoo.__init__:"""x, y"" missing in parameter type documentation":UNDEFINED +missing-param-doc:200:0:200:33:test_warns_missing_args_numpy:"""*args"" missing in parameter documentation":UNDEFINED +missing-param-doc:217:0:217:35:test_warns_missing_kwargs_numpy:"""**kwargs"" missing in parameter documentation":UNDEFINED +missing-type-doc:234:0:234:38:test_finds_args_without_type_numpy:"""untyped_arg"" missing in parameter type documentation":UNDEFINED diff --git a/tests/functional/ext/docparams/parameter/missing_param_doc_required_Sphinx.txt b/tests/functional/ext/docparams/parameter/missing_param_doc_required_Sphinx.txt index 7745f76199..dcc77f48ed 100644 --- a/tests/functional/ext/docparams/parameter/missing_param_doc_required_Sphinx.txt +++ b/tests/functional/ext/docparams/parameter/missing_param_doc_required_Sphinx.txt @@ -1,37 +1,37 @@ -missing-param-doc:8:0:18:8:test_missing_func_params_in_sphinx_docstring:"""y"" missing in parameter documentation":UNDEFINED -missing-type-doc:8:0:18:8:test_missing_func_params_in_sphinx_docstring:"""x, y"" missing in parameter type documentation":UNDEFINED -missing-param-doc:22:4:32:12:Foo.test_missing_method_params_in_sphinx_docstring:"""y"" missing in parameter documentation":UNDEFINED -missing-type-doc:22:4:32:12:Foo.test_missing_method_params_in_sphinx_docstring:"""x, y"" missing in parameter type documentation":UNDEFINED -differing-param-doc:55:0:69:22:test_wrong_name_of_func_params_in_sphinx_docstring:"""xarg1, zarg1"" differing in parameter documentation":UNDEFINED -differing-type-doc:55:0:69:22:test_wrong_name_of_func_params_in_sphinx_docstring:"""yarg1, zarg1"" differing in parameter type documentation":UNDEFINED -missing-param-doc:55:0:69:22:test_wrong_name_of_func_params_in_sphinx_docstring:"""xarg, zarg"" missing in parameter documentation":UNDEFINED -missing-type-doc:55:0:69:22:test_wrong_name_of_func_params_in_sphinx_docstring:"""yarg, zarg"" missing in parameter type documentation":UNDEFINED -differing-param-doc:72:0:83:22:test_wrong_name_of_func_params_in_sphinx_docstring_two:"""yarg1"" differing in parameter documentation":UNDEFINED -differing-type-doc:72:0:83:22:test_wrong_name_of_func_params_in_sphinx_docstring_two:"""yarg1"" differing in parameter type documentation":UNDEFINED -missing-param-doc:99:0:112:12:ClassFoo:"""x"" missing in parameter documentation":UNDEFINED -missing-type-doc:99:0:112:12:ClassFoo:"""x, y"" missing in parameter type documentation":UNDEFINED -missing-param-doc:116:4:128:12:ClassFoo.__init__:"""x"" missing in parameter documentation":UNDEFINED -missing-type-doc:116:4:128:12:ClassFoo.__init__:"""x, y"" missing in parameter type documentation":UNDEFINED -missing-param-doc:131:0:151:12:ClassFoo:"""x"" missing in parameter documentation":UNDEFINED -missing-type-doc:131:0:151:12:ClassFoo:"""x, y"" missing in parameter type documentation":UNDEFINED -multiple-constructor-doc:131:0:151:12:ClassFoo:"""ClassFoo"" has constructor parameters documented in class and __init__":UNDEFINED -missing-param-doc:144:4:151:12:ClassFoo.__init__:"""x"" missing in parameter documentation":UNDEFINED -missing-type-doc:144:4:151:12:ClassFoo.__init__:"""x, y"" missing in parameter type documentation":UNDEFINED -inconsistent-return-statements:154:0:166:24:test_warns_missing_args_sphinx:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -missing-param-doc:154:0:166:24:test_warns_missing_args_sphinx:"""*args"" missing in parameter documentation":UNDEFINED -inconsistent-return-statements:169:0:181:24:test_warns_missing_kwargs_sphinx:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -missing-param-doc:169:0:181:24:test_warns_missing_kwargs_sphinx:"""**kwargs"" missing in parameter documentation":UNDEFINED -inconsistent-return-statements:184:0:198:24:test_finds_args_without_type_sphinx:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -missing-param-doc:184:0:198:24:test_finds_args_without_type_sphinx:"""*args"" missing in parameter documentation":UNDEFINED -inconsistent-return-statements:201:0:215:24:test_finds_kwargs_without_type_sphinx:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -missing-param-doc:201:0:215:24:test_finds_kwargs_without_type_sphinx:"""**kwargs"" missing in parameter documentation":UNDEFINED -inconsistent-return-statements:218:0:234:24:test_finds_args_without_type_sphinx:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -inconsistent-return-statements:237:0:253:24:test_finds_kwargs_without_type_sphinx:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -missing-raises-doc:263:4:268:17:Foo.foo:"""AttributeError"" not documented as being raised":UNDEFINED +missing-param-doc:8:0:8:48:test_missing_func_params_in_sphinx_docstring:"""y"" missing in parameter documentation":UNDEFINED +missing-type-doc:8:0:8:48:test_missing_func_params_in_sphinx_docstring:"""x, y"" missing in parameter type documentation":UNDEFINED +missing-param-doc:22:4:22:54:Foo.test_missing_method_params_in_sphinx_docstring:"""y"" missing in parameter documentation":UNDEFINED +missing-type-doc:22:4:22:54:Foo.test_missing_method_params_in_sphinx_docstring:"""x, y"" missing in parameter type documentation":UNDEFINED +differing-param-doc:55:0:55:54:test_wrong_name_of_func_params_in_sphinx_docstring:"""xarg1, zarg1"" differing in parameter documentation":UNDEFINED +differing-type-doc:55:0:55:54:test_wrong_name_of_func_params_in_sphinx_docstring:"""yarg1, zarg1"" differing in parameter type documentation":UNDEFINED +missing-param-doc:55:0:55:54:test_wrong_name_of_func_params_in_sphinx_docstring:"""xarg, zarg"" missing in parameter documentation":UNDEFINED +missing-type-doc:55:0:55:54:test_wrong_name_of_func_params_in_sphinx_docstring:"""yarg, zarg"" missing in parameter type documentation":UNDEFINED +differing-param-doc:72:0:72:58:test_wrong_name_of_func_params_in_sphinx_docstring_two:"""yarg1"" differing in parameter documentation":UNDEFINED +differing-type-doc:72:0:72:58:test_wrong_name_of_func_params_in_sphinx_docstring_two:"""yarg1"" differing in parameter type documentation":UNDEFINED +missing-param-doc:99:0:99:14:ClassFoo:"""x"" missing in parameter documentation":UNDEFINED +missing-type-doc:99:0:99:14:ClassFoo:"""x, y"" missing in parameter type documentation":UNDEFINED +missing-param-doc:116:4:116:16:ClassFoo.__init__:"""x"" missing in parameter documentation":UNDEFINED +missing-type-doc:116:4:116:16:ClassFoo.__init__:"""x, y"" missing in parameter type documentation":UNDEFINED +missing-param-doc:131:0:131:14:ClassFoo:"""x"" missing in parameter documentation":UNDEFINED +missing-type-doc:131:0:131:14:ClassFoo:"""x, y"" missing in parameter type documentation":UNDEFINED +multiple-constructor-doc:131:0:131:14:ClassFoo:"""ClassFoo"" has constructor parameters documented in class and __init__":UNDEFINED +missing-param-doc:144:4:144:16:ClassFoo.__init__:"""x"" missing in parameter documentation":UNDEFINED +missing-type-doc:144:4:144:16:ClassFoo.__init__:"""x, y"" missing in parameter type documentation":UNDEFINED +inconsistent-return-statements:154:0:154:34:test_warns_missing_args_sphinx:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +missing-param-doc:154:0:154:34:test_warns_missing_args_sphinx:"""*args"" missing in parameter documentation":UNDEFINED +inconsistent-return-statements:169:0:169:36:test_warns_missing_kwargs_sphinx:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +missing-param-doc:169:0:169:36:test_warns_missing_kwargs_sphinx:"""**kwargs"" missing in parameter documentation":UNDEFINED +inconsistent-return-statements:184:0:184:39:test_finds_args_without_type_sphinx:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +missing-param-doc:184:0:184:39:test_finds_args_without_type_sphinx:"""*args"" missing in parameter documentation":UNDEFINED +inconsistent-return-statements:201:0:201:41:test_finds_kwargs_without_type_sphinx:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +missing-param-doc:201:0:201:41:test_finds_kwargs_without_type_sphinx:"""**kwargs"" missing in parameter documentation":UNDEFINED +inconsistent-return-statements:218:0:218:39:test_finds_args_without_type_sphinx:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:237:0:237:41:test_finds_kwargs_without_type_sphinx:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +missing-raises-doc:263:4:263:11:Foo.foo:"""AttributeError"" not documented as being raised":UNDEFINED unreachable:289:8:289:17:Foo.foo:Unreachable code:UNDEFINED -missing-param-doc:292:4:297:30:Foo.foo:"""value"" missing in parameter documentation":UNDEFINED -missing-raises-doc:292:4:297:30:Foo.foo:"""AttributeError"" not documented as being raised":UNDEFINED -missing-type-doc:292:4:297:30:Foo.foo:"""value"" missing in parameter type documentation":UNDEFINED +missing-param-doc:292:4:292:11:Foo.foo:"""value"" missing in parameter documentation":UNDEFINED +missing-raises-doc:292:4:292:11:Foo.foo:"""AttributeError"" not documented as being raised":UNDEFINED +missing-type-doc:292:4:292:11:Foo.foo:"""value"" missing in parameter type documentation":UNDEFINED unreachable:328:8:328:17:Foo.foo:Unreachable code:UNDEFINED -useless-param-doc:332:4:346:12:Foo.test_useless_docs_ignored_argument_names_sphinx:"""_, _ignored"" useless ignored parameter documentation":UNDEFINED -useless-type-doc:332:4:346:12:Foo.test_useless_docs_ignored_argument_names_sphinx:"""_"" useless ignored parameter type documentation":UNDEFINED +useless-param-doc:332:4:332:55:Foo.test_useless_docs_ignored_argument_names_sphinx:"""_, _ignored"" useless ignored parameter documentation":UNDEFINED +useless-type-doc:332:4:332:55:Foo.test_useless_docs_ignored_argument_names_sphinx:"""_"" useless ignored parameter type documentation":UNDEFINED diff --git a/tests/functional/ext/docparams/parameter/missing_param_doc_required_no_doc_rgx_check_init.txt b/tests/functional/ext/docparams/parameter/missing_param_doc_required_no_doc_rgx_check_init.txt index 7cebb0a3cd..7b30afcb55 100644 --- a/tests/functional/ext/docparams/parameter/missing_param_doc_required_no_doc_rgx_check_init.txt +++ b/tests/functional/ext/docparams/parameter/missing_param_doc_required_no_doc_rgx_check_init.txt @@ -1 +1 @@ -missing-param-doc:10:4:13:11:MyClass.__init__:"""my_param"" missing in parameter documentation":UNDEFINED +missing-param-doc:10:4:10:16:MyClass.__init__:"""my_param"" missing in parameter documentation":UNDEFINED diff --git a/tests/functional/ext/docparams/parameter/missing_param_doc_required_no_doc_rgx_test_all.txt b/tests/functional/ext/docparams/parameter/missing_param_doc_required_no_doc_rgx_test_all.txt index d79aa94dd5..d42bc96251 100644 --- a/tests/functional/ext/docparams/parameter/missing_param_doc_required_no_doc_rgx_test_all.txt +++ b/tests/functional/ext/docparams/parameter/missing_param_doc_required_no_doc_rgx_test_all.txt @@ -1 +1 @@ -missing-param-doc:25:4:28:11:MyClass.__init__:"""my_param"" missing in parameter documentation":UNDEFINED +missing-param-doc:25:4:25:16:MyClass.__init__:"""my_param"" missing in parameter documentation":UNDEFINED diff --git a/tests/functional/ext/docparams/raise/missing_raises_doc.txt b/tests/functional/ext/docparams/raise/missing_raises_doc.txt index 6da4d57be8..7a93e4b1cd 100644 --- a/tests/functional/ext/docparams/raise/missing_raises_doc.txt +++ b/tests/functional/ext/docparams/raise/missing_raises_doc.txt @@ -1,4 +1,4 @@ unreachable:25:4:25:25:test_ignores_raise_uninferable:Unreachable code:UNDEFINED -missing-raises-doc:28:0:42:25:test_ignores_returns_from_inner_functions:"""RuntimeError"" not documented as being raised":UNDEFINED +missing-raises-doc:28:0:28:45:test_ignores_returns_from_inner_functions:"""RuntimeError"" not documented as being raised":UNDEFINED unreachable:42:4:42:25:test_ignores_returns_from_inner_functions:Unreachable code:UNDEFINED raising-bad-type:54:4:54:22:test_ignores_returns_use_only_names:Raising int while only classes or instances are allowed:UNDEFINED diff --git a/tests/functional/ext/docparams/raise/missing_raises_doc_Google.txt b/tests/functional/ext/docparams/raise/missing_raises_doc_Google.txt index 0ac9505593..6e98f05d9c 100644 --- a/tests/functional/ext/docparams/raise/missing_raises_doc_Google.txt +++ b/tests/functional/ext/docparams/raise/missing_raises_doc_Google.txt @@ -1,14 +1,14 @@ -missing-raises-doc:6:0:13:25:test_find_missing_google_raises:"""RuntimeError"" not documented as being raised":UNDEFINED +missing-raises-doc:6:0:6:35:test_find_missing_google_raises:"""RuntimeError"" not documented as being raised":UNDEFINED unreachable:13:4:13:25:test_find_missing_google_raises:Unreachable code:UNDEFINED -missing-raises-doc:38:0:46:21:test_find_valid_missing_google_attr_raises:"""error"" not documented as being raised":UNDEFINED +missing-raises-doc:38:0:38:46:test_find_valid_missing_google_attr_raises:"""error"" not documented as being raised":UNDEFINED unreachable:83:4:83:25:test_find_all_google_raises:Unreachable code:UNDEFINED unreachable:94:4:94:25:test_find_multiple_google_raises:Unreachable code:UNDEFINED unreachable:95:4:95:30:test_find_multiple_google_raises:Unreachable code:UNDEFINED unreachable:96:4:96:27:test_find_multiple_google_raises:Unreachable code:UNDEFINED -missing-raises-doc:99:0:110:25:test_find_rethrown_google_raises:"""RuntimeError"" not documented as being raised":UNDEFINED -missing-raises-doc:113:0:124:25:test_find_rethrown_google_multiple_raises:"""RuntimeError, ValueError"" not documented as being raised":UNDEFINED -missing-raises-doc:148:4:158:17:Foo.foo_method:"""AttributeError"" not documented as being raised":UNDEFINED +missing-raises-doc:99:0:99:36:test_find_rethrown_google_raises:"""RuntimeError"" not documented as being raised":UNDEFINED +missing-raises-doc:113:0:113:45:test_find_rethrown_google_multiple_raises:"""RuntimeError, ValueError"" not documented as being raised":UNDEFINED +missing-raises-doc:148:4:148:18:Foo.foo_method:"""AttributeError"" not documented as being raised":UNDEFINED unreachable:158:8:158:17:Foo.foo_method:Unreachable code:UNDEFINED unreachable:180:8:180:17:Foo.foo_method:Unreachable code:UNDEFINED -missing-raises-doc:183:4:192:28:Foo.foo_method:"""AttributeError"" not documented as being raised":UNDEFINED +missing-raises-doc:183:4:183:18:Foo.foo_method:"""AttributeError"" not documented as being raised":UNDEFINED using-constant-test:190:8:191:34:Foo.foo_method:Using a conditional statement with a constant value:UNDEFINED diff --git a/tests/functional/ext/docparams/raise/missing_raises_doc_Numpy.txt b/tests/functional/ext/docparams/raise/missing_raises_doc_Numpy.txt index 8e63c4d9be..91002c02df 100644 --- a/tests/functional/ext/docparams/raise/missing_raises_doc_Numpy.txt +++ b/tests/functional/ext/docparams/raise/missing_raises_doc_Numpy.txt @@ -1,11 +1,11 @@ -missing-raises-doc:11:0:20:25:test_find_missing_numpy_raises:"""RuntimeError"" not documented as being raised":UNDEFINED +missing-raises-doc:11:0:11:34:test_find_missing_numpy_raises:"""RuntimeError"" not documented as being raised":UNDEFINED unreachable:20:4:20:25:test_find_missing_numpy_raises:Unreachable code:UNDEFINED unreachable:34:4:34:25:test_find_all_numpy_raises:Unreachable code:UNDEFINED -missing-raises-doc:37:0:50:25:test_find_rethrown_numpy_raises:"""RuntimeError"" not documented as being raised":UNDEFINED -missing-raises-doc:53:0:66:25:test_find_rethrown_numpy_multiple_raises:"""RuntimeError, ValueError"" not documented as being raised":UNDEFINED -missing-raises-doc:111:0:121:21:test_find_valid_missing_numpy_attr_raises:"""error"" not documented as being raised":UNDEFINED -missing-raises-doc:146:4:158:17:Foo.foo:"""AttributeError"" not documented as being raised":UNDEFINED +missing-raises-doc:37:0:37:35:test_find_rethrown_numpy_raises:"""RuntimeError"" not documented as being raised":UNDEFINED +missing-raises-doc:53:0:53:44:test_find_rethrown_numpy_multiple_raises:"""RuntimeError, ValueError"" not documented as being raised":UNDEFINED +missing-raises-doc:111:0:111:45:test_find_valid_missing_numpy_attr_raises:"""error"" not documented as being raised":UNDEFINED +missing-raises-doc:146:4:146:11:Foo.foo:"""AttributeError"" not documented as being raised":UNDEFINED unreachable:158:8:158:17:Foo.foo:Unreachable code:UNDEFINED unreachable:182:8:182:17:Foo.foo:Unreachable code:UNDEFINED -missing-raises-doc:185:4:196:28:Foo.foo:"""AttributeError"" not documented as being raised":UNDEFINED +missing-raises-doc:185:4:185:11:Foo.foo:"""AttributeError"" not documented as being raised":UNDEFINED unreachable:215:8:215:17:Foo.foo:Unreachable code:UNDEFINED diff --git a/tests/functional/ext/docparams/raise/missing_raises_doc_Sphinx.txt b/tests/functional/ext/docparams/raise/missing_raises_doc_Sphinx.txt index 77dbea7080..20c2b4d380 100644 --- a/tests/functional/ext/docparams/raise/missing_raises_doc_Sphinx.txt +++ b/tests/functional/ext/docparams/raise/missing_raises_doc_Sphinx.txt @@ -1,13 +1,13 @@ -missing-raises-doc:7:0:13:25:test_find_missing_sphinx_raises:"""RuntimeError"" not documented as being raised":UNDEFINED +missing-raises-doc:7:0:7:35:test_find_missing_sphinx_raises:"""RuntimeError"" not documented as being raised":UNDEFINED unreachable:13:4:13:25:test_find_missing_sphinx_raises:Unreachable code:UNDEFINED unreachable:36:4:36:25:test_find_all_sphinx_raises:Unreachable code:UNDEFINED unreachable:37:4:37:30:test_find_all_sphinx_raises:Unreachable code:UNDEFINED unreachable:38:4:38:27:test_find_all_sphinx_raises:Unreachable code:UNDEFINED unreachable:48:4:48:25:test_find_multiple_sphinx_raises:Unreachable code:UNDEFINED -missing-raises-doc:51:0:61:25:test_finds_rethrown_sphinx_raises:"""RuntimeError"" not documented as being raised":UNDEFINED -missing-raises-doc:64:0:74:25:test_finds_rethrown_sphinx_multiple_raises:"""RuntimeError, ValueError"" not documented as being raised":UNDEFINED -missing-raises-doc:90:0:97:25:test_find_missing_sphinx_raises_infer_from_instance:"""RuntimeError"" not documented as being raised":UNDEFINED +missing-raises-doc:51:0:51:37:test_finds_rethrown_sphinx_raises:"""RuntimeError"" not documented as being raised":UNDEFINED +missing-raises-doc:64:0:64:46:test_finds_rethrown_sphinx_multiple_raises:"""RuntimeError, ValueError"" not documented as being raised":UNDEFINED +missing-raises-doc:90:0:90:55:test_find_missing_sphinx_raises_infer_from_instance:"""RuntimeError"" not documented as being raised":UNDEFINED unreachable:97:4:97:25:test_find_missing_sphinx_raises_infer_from_instance:Unreachable code:UNDEFINED -missing-raises-doc:100:0:110:25:test_find_missing_sphinx_raises_infer_from_function:"""RuntimeError"" not documented as being raised":UNDEFINED +missing-raises-doc:100:0:100:55:test_find_missing_sphinx_raises_infer_from_function:"""RuntimeError"" not documented as being raised":UNDEFINED unreachable:110:4:110:25:test_find_missing_sphinx_raises_infer_from_function:Unreachable code:UNDEFINED -missing-raises-doc:133:0:140:21:test_find_valid_missing_sphinx_attr_raises:"""error"" not documented as being raised":UNDEFINED +missing-raises-doc:133:0:133:46:test_find_valid_missing_sphinx_attr_raises:"""error"" not documented as being raised":UNDEFINED diff --git a/tests/functional/ext/docparams/raise/missing_raises_doc_required.txt b/tests/functional/ext/docparams/raise/missing_raises_doc_required.txt index 3c9f68e163..f04a2b9fdf 100644 --- a/tests/functional/ext/docparams/raise/missing_raises_doc_required.txt +++ b/tests/functional/ext/docparams/raise/missing_raises_doc_required.txt @@ -1 +1 @@ -missing-raises-doc:6:0:8:28:test_warns_unknown_style:"""RuntimeError"" not documented as being raised":UNDEFINED +missing-raises-doc:6:0:6:28:test_warns_unknown_style:"""RuntimeError"" not documented as being raised":UNDEFINED diff --git a/tests/functional/ext/docparams/raise/missing_raises_doc_required_exc_inheritance.txt b/tests/functional/ext/docparams/raise/missing_raises_doc_required_exc_inheritance.txt index e566c8a856..e955a4aec5 100644 --- a/tests/functional/ext/docparams/raise/missing_raises_doc_required_exc_inheritance.txt +++ b/tests/functional/ext/docparams/raise/missing_raises_doc_required_exc_inheritance.txt @@ -1 +1 @@ -missing-raises-doc:12:0:18:25:test_find_missing_raise_for_parent:"""NameError"" not documented as being raised":UNDEFINED +missing-raises-doc:12:0:12:38:test_find_missing_raise_for_parent:"""NameError"" not documented as being raised":UNDEFINED diff --git a/tests/functional/ext/docparams/return/missing_return_doc_Google.txt b/tests/functional/ext/docparams/return/missing_return_doc_Google.txt index ea8e81200b..836114036a 100644 --- a/tests/functional/ext/docparams/return/missing_return_doc_Google.txt +++ b/tests/functional/ext/docparams/return/missing_return_doc_Google.txt @@ -1,7 +1,7 @@ -redundant-returns-doc:43:0:49:15:my_func:Redundant returns documentation:UNDEFINED -redundant-returns-doc:52:0:58:15:my_func:Redundant returns documentation:UNDEFINED -redundant-returns-doc:61:0:67:11:my_func:Redundant returns documentation:UNDEFINED +redundant-returns-doc:43:0:43:11:my_func:Redundant returns documentation:UNDEFINED +redundant-returns-doc:52:0:52:11:my_func:Redundant returns documentation:UNDEFINED +redundant-returns-doc:61:0:61:11:my_func:Redundant returns documentation:UNDEFINED unreachable:95:8:95:17:Foo.foo_method:Unreachable code:UNDEFINED unreachable:112:8:112:17:Foo.foo_method:Unreachable code:UNDEFINED -useless-param-doc:167:4:175:12:Foo.foo_method:"""_, _ignored"" useless ignored parameter documentation":UNDEFINED -useless-type-doc:167:4:175:12:Foo.foo_method:"""_"" useless ignored parameter type documentation":UNDEFINED +useless-param-doc:167:4:167:18:Foo.foo_method:"""_, _ignored"" useless ignored parameter documentation":UNDEFINED +useless-type-doc:167:4:167:18:Foo.foo_method:"""_"" useless ignored parameter type documentation":UNDEFINED diff --git a/tests/functional/ext/docparams/return/missing_return_doc_Numpy.txt b/tests/functional/ext/docparams/return/missing_return_doc_Numpy.txt index d137612e6e..fbcfd1287c 100644 --- a/tests/functional/ext/docparams/return/missing_return_doc_Numpy.txt +++ b/tests/functional/ext/docparams/return/missing_return_doc_Numpy.txt @@ -1,5 +1,5 @@ -redundant-returns-doc:62:0:70:15:my_func:Redundant returns documentation:UNDEFINED -redundant-returns-doc:73:0:80:15:my_func:Redundant returns documentation:UNDEFINED -redundant-returns-doc:98:0:106:11:my_func:Redundant returns documentation:UNDEFINED -useless-param-doc:164:4:177:11:Foo.foo:"""_, _ignored"" useless ignored parameter documentation":UNDEFINED -useless-type-doc:164:4:177:11:Foo.foo:"""_"" useless ignored parameter type documentation":UNDEFINED +redundant-returns-doc:62:0:62:11:my_func:Redundant returns documentation:UNDEFINED +redundant-returns-doc:73:0:73:11:my_func:Redundant returns documentation:UNDEFINED +redundant-returns-doc:98:0:98:11:my_func:Redundant returns documentation:UNDEFINED +useless-param-doc:164:4:164:11:Foo.foo:"""_, _ignored"" useless ignored parameter documentation":UNDEFINED +useless-type-doc:164:4:164:11:Foo.foo:"""_"" useless ignored parameter type documentation":UNDEFINED diff --git a/tests/functional/ext/docparams/return/missing_return_doc_Sphinx.txt b/tests/functional/ext/docparams/return/missing_return_doc_Sphinx.txt index 604b5d0955..51d324ba7b 100644 --- a/tests/functional/ext/docparams/return/missing_return_doc_Sphinx.txt +++ b/tests/functional/ext/docparams/return/missing_return_doc_Sphinx.txt @@ -1,2 +1,2 @@ -redundant-returns-doc:44:0:49:15:my_func:Redundant returns documentation:UNDEFINED -redundant-returns-doc:52:0:57:15:my_func:Redundant returns documentation:UNDEFINED +redundant-returns-doc:44:0:44:11:my_func:Redundant returns documentation:UNDEFINED +redundant-returns-doc:52:0:52:11:my_func:Redundant returns documentation:UNDEFINED diff --git a/tests/functional/ext/docparams/return/missing_return_doc_required.txt b/tests/functional/ext/docparams/return/missing_return_doc_required.txt index 29042dbaa3..8e15b91a20 100644 --- a/tests/functional/ext/docparams/return/missing_return_doc_required.txt +++ b/tests/functional/ext/docparams/return/missing_return_doc_required.txt @@ -1,2 +1,2 @@ -missing-return-doc:6:0:7:16:warns_no_docstring:Missing return documentation:UNDEFINED -missing-return-type-doc:6:0:7:16:warns_no_docstring:Missing return type documentation:UNDEFINED +missing-return-doc:6:0:6:22:warns_no_docstring:Missing return documentation:UNDEFINED +missing-return-type-doc:6:0:6:22:warns_no_docstring:Missing return type documentation:UNDEFINED diff --git a/tests/functional/ext/docparams/return/missing_return_doc_required_Google.txt b/tests/functional/ext/docparams/return/missing_return_doc_required_Google.txt index aa6775f5f0..dac5ad2808 100644 --- a/tests/functional/ext/docparams/return/missing_return_doc_required_Google.txt +++ b/tests/functional/ext/docparams/return/missing_return_doc_required_Google.txt @@ -1,10 +1,10 @@ -missing-return-type-doc:7:0:13:16:my_func:Missing return type documentation:UNDEFINED -missing-return-doc:16:0:22:16:my_func:Missing return documentation:UNDEFINED -missing-return-doc:25:0:31:16:my_func:Missing return documentation:UNDEFINED -missing-return-type-doc:25:0:31:16:my_func:Missing return type documentation:UNDEFINED -missing-return-doc:34:0:40:29:my_func:Missing return documentation:UNDEFINED -missing-return-type-doc:50:4:57:17:Foo.foo_method:Missing return type documentation:UNDEFINED +missing-return-type-doc:7:0:7:11:my_func:Missing return type documentation:UNDEFINED +missing-return-doc:16:0:16:11:my_func:Missing return documentation:UNDEFINED +missing-return-doc:25:0:25:11:my_func:Missing return documentation:UNDEFINED +missing-return-type-doc:25:0:25:11:my_func:Missing return type documentation:UNDEFINED +missing-return-doc:34:0:34:11:my_func:Missing return documentation:UNDEFINED +missing-return-type-doc:50:4:50:18:Foo.foo_method:Missing return type documentation:UNDEFINED unreachable:57:8:57:17:Foo.foo_method:Unreachable code:UNDEFINED -missing-return-doc:66:4:74:17:Foo.foo_method:Missing return documentation:UNDEFINED -missing-return-type-doc:66:4:74:17:Foo.foo_method:Missing return type documentation:UNDEFINED +missing-return-doc:66:4:66:18:Foo.foo_method:Missing return documentation:UNDEFINED +missing-return-type-doc:66:4:66:18:Foo.foo_method:Missing return type documentation:UNDEFINED unreachable:74:8:74:17:Foo.foo_method:Unreachable code:UNDEFINED diff --git a/tests/functional/ext/docparams/return/missing_return_doc_required_Numpy.txt b/tests/functional/ext/docparams/return/missing_return_doc_required_Numpy.txt index f3dc18f8bb..61aac4ebb6 100644 --- a/tests/functional/ext/docparams/return/missing_return_doc_required_Numpy.txt +++ b/tests/functional/ext/docparams/return/missing_return_doc_required_Numpy.txt @@ -1,11 +1,11 @@ -missing-return-doc:7:0:19:16:my_func:Missing return documentation:UNDEFINED -missing-return-doc:22:0:30:16:my_func:Missing return documentation:UNDEFINED -missing-return-type-doc:22:0:30:16:my_func:Missing return type documentation:UNDEFINED -missing-return-doc:33:0:40:29:my_func:Missing return documentation:UNDEFINED -missing-return-type-doc:50:4:59:17:Foo.foo_prop:Missing return type documentation:UNDEFINED +missing-return-doc:7:0:7:11:my_func:Missing return documentation:UNDEFINED +missing-return-doc:22:0:22:11:my_func:Missing return documentation:UNDEFINED +missing-return-type-doc:22:0:22:11:my_func:Missing return type documentation:UNDEFINED +missing-return-doc:33:0:33:11:my_func:Missing return documentation:UNDEFINED +missing-return-type-doc:50:4:50:16:Foo.foo_prop:Missing return type documentation:UNDEFINED unreachable:59:8:59:17:Foo.foo_prop:Unreachable code:UNDEFINED -missing-return-doc:68:4:78:17:Foo.foo_method:Missing return documentation:UNDEFINED -missing-return-type-doc:68:4:78:17:Foo.foo_method:Missing return type documentation:UNDEFINED +missing-return-doc:68:4:68:18:Foo.foo_method:Missing return documentation:UNDEFINED +missing-return-type-doc:68:4:68:18:Foo.foo_method:Missing return type documentation:UNDEFINED unreachable:78:8:78:17:Foo.foo_method:Unreachable code:UNDEFINED -missing-return-doc:87:4:97:17:Foo.foo_method:Missing return documentation:UNDEFINED +missing-return-doc:87:4:87:18:Foo.foo_method:Missing return documentation:UNDEFINED unreachable:97:8:97:17:Foo.foo_method:Unreachable code:UNDEFINED diff --git a/tests/functional/ext/docparams/return/missing_return_doc_required_Sphinx.txt b/tests/functional/ext/docparams/return/missing_return_doc_required_Sphinx.txt index 0d35b88edd..f9c156e0aa 100644 --- a/tests/functional/ext/docparams/return/missing_return_doc_required_Sphinx.txt +++ b/tests/functional/ext/docparams/return/missing_return_doc_required_Sphinx.txt @@ -1,9 +1,9 @@ -missing-return-type-doc:8:0:13:16:my_func:Missing return type documentation:UNDEFINED -missing-return-doc:24:0:29:16:my_func:Missing return documentation:UNDEFINED -missing-return-doc:32:0:40:16:warn_missing_sphinx_returns:Missing return documentation:UNDEFINED -missing-return-type-doc:32:0:40:16:warn_missing_sphinx_returns:Missing return type documentation:UNDEFINED -missing-return-doc:43:0:48:29:my_func:Missing return documentation:UNDEFINED -missing-return-type-doc:58:4:64:17:Foo.foo:Missing return type documentation:UNDEFINED +missing-return-type-doc:8:0:8:11:my_func:Missing return type documentation:UNDEFINED +missing-return-doc:24:0:24:11:my_func:Missing return documentation:UNDEFINED +missing-return-doc:32:0:32:31:warn_missing_sphinx_returns:Missing return documentation:UNDEFINED +missing-return-type-doc:32:0:32:31:warn_missing_sphinx_returns:Missing return type documentation:UNDEFINED +missing-return-doc:43:0:43:11:my_func:Missing return documentation:UNDEFINED +missing-return-type-doc:58:4:58:11:Foo.foo:Missing return type documentation:UNDEFINED unreachable:64:8:64:17:Foo.foo:Unreachable code:UNDEFINED -missing-return-doc:72:4:79:17:Foo.test_ignores_non_property_return_type_sphinx:Missing return documentation:UNDEFINED -missing-return-type-doc:72:4:79:17:Foo.test_ignores_non_property_return_type_sphinx:Missing return type documentation:UNDEFINED +missing-return-doc:72:4:72:52:Foo.test_ignores_non_property_return_type_sphinx:Missing return documentation:UNDEFINED +missing-return-type-doc:72:4:72:52:Foo.test_ignores_non_property_return_type_sphinx:Missing return type documentation:UNDEFINED diff --git a/tests/functional/ext/docparams/useless_type_doc.txt b/tests/functional/ext/docparams/useless_type_doc.txt index ae879d7f18..3408f18036 100644 --- a/tests/functional/ext/docparams/useless_type_doc.txt +++ b/tests/functional/ext/docparams/useless_type_doc.txt @@ -1,4 +1,4 @@ -useless-param-doc:34:0:47:11:function_useless_doc:"""_some_private_param"" useless ignored parameter documentation":UNDEFINED -useless-type-doc:34:0:47:11:function_useless_doc:"""_some_private_param"" useless ignored parameter type documentation":UNDEFINED -useless-param-doc:67:0:73:13:test_two:"""_new"" useless ignored parameter documentation":UNDEFINED -useless-type-doc:67:0:73:13:test_two:"""_new"" useless ignored parameter type documentation":UNDEFINED +useless-param-doc:34:0:34:24:function_useless_doc:"""_some_private_param"" useless ignored parameter documentation":UNDEFINED +useless-type-doc:34:0:34:24:function_useless_doc:"""_some_private_param"" useless ignored parameter type documentation":UNDEFINED +useless-param-doc:67:0:67:12:test_two:"""_new"" useless ignored parameter documentation":UNDEFINED +useless-type-doc:67:0:67:12:test_two:"""_new"" useless ignored parameter type documentation":UNDEFINED diff --git a/tests/functional/ext/docparams/yield/missing_yield_doc_Google.txt b/tests/functional/ext/docparams/yield/missing_yield_doc_Google.txt index febb5f9ba2..8315f89bbc 100644 --- a/tests/functional/ext/docparams/yield/missing_yield_doc_Google.txt +++ b/tests/functional/ext/docparams/yield/missing_yield_doc_Google.txt @@ -1 +1 @@ -redundant-yields-doc:19:0:25:12:my_func:Redundant yields documentation:UNDEFINED +redundant-yields-doc:19:0:19:11:my_func:Redundant yields documentation:UNDEFINED diff --git a/tests/functional/ext/docparams/yield/missing_yield_doc_Numpy.txt b/tests/functional/ext/docparams/yield/missing_yield_doc_Numpy.txt index b855ed84df..1324cb5dc7 100644 --- a/tests/functional/ext/docparams/yield/missing_yield_doc_Numpy.txt +++ b/tests/functional/ext/docparams/yield/missing_yield_doc_Numpy.txt @@ -1 +1 @@ -redundant-yields-doc:22:0:30:12:my_func:Redundant yields documentation:UNDEFINED +redundant-yields-doc:22:0:22:11:my_func:Redundant yields documentation:UNDEFINED diff --git a/tests/functional/ext/docparams/yield/missing_yield_doc_required.txt b/tests/functional/ext/docparams/yield/missing_yield_doc_required.txt index 16a4f535c1..d9162494e4 100644 --- a/tests/functional/ext/docparams/yield/missing_yield_doc_required.txt +++ b/tests/functional/ext/docparams/yield/missing_yield_doc_required.txt @@ -1,2 +1,2 @@ -missing-yield-doc:6:0:7:15:my_func:Missing yield documentation:UNDEFINED -missing-yield-type-doc:6:0:7:15:my_func:Missing yield type documentation:UNDEFINED +missing-yield-doc:6:0:6:11:my_func:Missing yield documentation:UNDEFINED +missing-yield-type-doc:6:0:6:11:my_func:Missing yield type documentation:UNDEFINED diff --git a/tests/functional/ext/docparams/yield/missing_yield_doc_required_Google.txt b/tests/functional/ext/docparams/yield/missing_yield_doc_required_Google.txt index e1d8087187..0a655a744d 100644 --- a/tests/functional/ext/docparams/yield/missing_yield_doc_required_Google.txt +++ b/tests/functional/ext/docparams/yield/missing_yield_doc_required_Google.txt @@ -1,5 +1,5 @@ -missing-yield-doc:34:0:40:28:my_func:Missing yield documentation:UNDEFINED -missing-yield-type-doc:43:0:49:15:my_func:Missing yield type documentation:UNDEFINED -missing-yield-doc:52:0:58:15:my_func:Missing yield documentation:UNDEFINED -missing-yield-doc:61:0:67:15:my_func:Missing yield documentation:UNDEFINED -missing-yield-type-doc:61:0:67:15:my_func:Missing yield type documentation:UNDEFINED +missing-yield-doc:34:0:34:11:my_func:Missing yield documentation:UNDEFINED +missing-yield-type-doc:43:0:43:11:my_func:Missing yield type documentation:UNDEFINED +missing-yield-doc:52:0:52:11:my_func:Missing yield documentation:UNDEFINED +missing-yield-doc:61:0:61:11:my_func:Missing yield documentation:UNDEFINED +missing-yield-type-doc:61:0:61:11:my_func:Missing yield type documentation:UNDEFINED diff --git a/tests/functional/ext/docparams/yield/missing_yield_doc_required_Numpy.txt b/tests/functional/ext/docparams/yield/missing_yield_doc_required_Numpy.txt index 26e5989f46..7ca1f80b0a 100644 --- a/tests/functional/ext/docparams/yield/missing_yield_doc_required_Numpy.txt +++ b/tests/functional/ext/docparams/yield/missing_yield_doc_required_Numpy.txt @@ -1,3 +1,3 @@ -missing-yield-doc:40:0:47:28:my_func:Missing yield documentation:UNDEFINED -missing-yield-doc:50:0:58:15:my_func:Missing yield documentation:UNDEFINED -missing-yield-type-doc:50:0:58:15:my_func:Missing yield type documentation:UNDEFINED +missing-yield-doc:40:0:40:11:my_func:Missing yield documentation:UNDEFINED +missing-yield-doc:50:0:50:11:my_func:Missing yield documentation:UNDEFINED +missing-yield-type-doc:50:0:50:11:my_func:Missing yield type documentation:UNDEFINED diff --git a/tests/functional/ext/docparams/yield/missing_yield_doc_required_Sphinx.txt b/tests/functional/ext/docparams/yield/missing_yield_doc_required_Sphinx.txt index ca4744af2a..3b1931e017 100644 --- a/tests/functional/ext/docparams/yield/missing_yield_doc_required_Sphinx.txt +++ b/tests/functional/ext/docparams/yield/missing_yield_doc_required_Sphinx.txt @@ -1,5 +1,5 @@ -missing-yield-doc:35:0:40:28:my_func:Missing yield documentation:UNDEFINED -missing-yield-type-doc:43:0:48:15:my_func:Missing yield type documentation:UNDEFINED -missing-yield-doc:51:0:56:15:my_func:Missing yield documentation:UNDEFINED -missing-yield-doc:59:0:65:15:my_func:Missing yield documentation:UNDEFINED -missing-yield-type-doc:59:0:65:15:my_func:Missing yield type documentation:UNDEFINED +missing-yield-doc:35:0:35:11:my_func:Missing yield documentation:UNDEFINED +missing-yield-type-doc:43:0:43:11:my_func:Missing yield type documentation:UNDEFINED +missing-yield-doc:51:0:51:11:my_func:Missing yield documentation:UNDEFINED +missing-yield-doc:59:0:59:11:my_func:Missing yield documentation:UNDEFINED +missing-yield-type-doc:59:0:59:11:my_func:Missing yield type documentation:UNDEFINED diff --git a/tests/functional/ext/docstyle/docstyle_first_line_empty.txt b/tests/functional/ext/docstyle/docstyle_first_line_empty.txt index 3d1e7aa6a6..6113fffaa7 100644 --- a/tests/functional/ext/docstyle/docstyle_first_line_empty.txt +++ b/tests/functional/ext/docstyle/docstyle_first_line_empty.txt @@ -1,3 +1,3 @@ -docstring-first-line-empty:4:0:7:19:check_messages:First line empty in function docstring:HIGH -docstring-first-line-empty:14:0:22:11:FFFF:First line empty in class docstring:HIGH -docstring-first-line-empty:19:4:22:11:FFFF.method1:First line empty in method docstring:HIGH +docstring-first-line-empty:4:0:4:18:check_messages:First line empty in function docstring:HIGH +docstring-first-line-empty:14:0:14:10:FFFF:First line empty in class docstring:HIGH +docstring-first-line-empty:19:4:19:15:FFFF.method1:First line empty in method docstring:HIGH diff --git a/tests/functional/ext/docstyle/docstyle_quotes_py38.txt b/tests/functional/ext/docstyle/docstyle_quotes_py38.txt index a158059989..a83c3ab282 100644 --- a/tests/functional/ext/docstyle/docstyle_quotes_py38.txt +++ b/tests/functional/ext/docstyle/docstyle_quotes_py38.txt @@ -1,4 +1,4 @@ -bad-docstring-quotes:6:4:9:11:FFFF.method1:"Bad docstring quotes in method, expected """""", given '''":HIGH -bad-docstring-quotes:11:4:12:25:FFFF.method2:"Bad docstring quotes in method, expected """""", given """:HIGH -bad-docstring-quotes:14:4:15:25:FFFF.method3:"Bad docstring quotes in method, expected """""", given '":HIGH -bad-docstring-quotes:17:4:18:30:FFFF.method4:"Bad docstring quotes in method, expected """""", given '":HIGH +bad-docstring-quotes:6:4:6:15:FFFF.method1:"Bad docstring quotes in method, expected """""", given '''":HIGH +bad-docstring-quotes:11:4:11:15:FFFF.method2:"Bad docstring quotes in method, expected """""", given """:HIGH +bad-docstring-quotes:14:4:14:15:FFFF.method3:"Bad docstring quotes in method, expected """""", given '":HIGH +bad-docstring-quotes:17:4:17:15:FFFF.method4:"Bad docstring quotes in method, expected """""", given '":HIGH diff --git a/tests/functional/ext/eq_without_hash/eq_without_hash.txt b/tests/functional/ext/eq_without_hash/eq_without_hash.txt index b7e2dc46da..e867a5ab38 100644 --- a/tests/functional/ext/eq_without_hash/eq_without_hash.txt +++ b/tests/functional/ext/eq_without_hash/eq_without_hash.txt @@ -1 +1 @@ -eq-without-hash:6:0:11:62:AClass:Implementing __eq__ without also implementing __hash__:HIGH +eq-without-hash:6:0:6:12:AClass:Implementing __eq__ without also implementing __hash__:HIGH diff --git a/tests/functional/ext/mccabe/mccabe.txt b/tests/functional/ext/mccabe/mccabe.txt index 9f7663e696..d031943bbd 100644 --- a/tests/functional/ext/mccabe/mccabe.txt +++ b/tests/functional/ext/mccabe/mccabe.txt @@ -1,15 +1,15 @@ -too-complex:9:0:11:8:f1:'f1' is too complex. The McCabe rating is 1:HIGH -too-complex:14:0:18:12:f2:'f2' is too complex. The McCabe rating is 1:HIGH -too-complex:21:0:28:47:f3:'f3' is too complex. The McCabe rating is 3:HIGH -too-complex:31:0:34:16:f4:'f4' is too complex. The McCabe rating is 2:HIGH -too-complex:37:0:42:19:f5:'f5' is too complex. The McCabe rating is 2:HIGH -too-complex:45:0:50:16:f6:'f6' is too complex. The McCabe rating is 2:HIGH -too-complex:53:0:65:7:f7:'f7' is too complex. The McCabe rating is 3:HIGH -too-complex:68:0:77:16:f8:'f8' is too complex. The McCabe rating is 4:HIGH -too-complex:80:0:103:25:f9:'f9' is too complex. The McCabe rating is 9:HIGH -too-complex:106:0:130:16:f10:'f10' is too complex. The McCabe rating is 11:HIGH -too-complex:138:4:140:12:MyClass1.method1:'method1' is too complex. The McCabe rating is 1:HIGH -too-complex:142:4:195:21:MyClass1.method2:'method2' is too complex. The McCabe rating is 18:HIGH -too-many-branches:142:4:195:21:MyClass1.method2:Too many branches (20/12):UNDEFINED +too-complex:9:0:9:6:f1:'f1' is too complex. The McCabe rating is 1:HIGH +too-complex:14:0:14:6:f2:'f2' is too complex. The McCabe rating is 1:HIGH +too-complex:21:0:21:6:f3:'f3' is too complex. The McCabe rating is 3:HIGH +too-complex:31:0:31:6:f4:'f4' is too complex. The McCabe rating is 2:HIGH +too-complex:37:0:37:6:f5:'f5' is too complex. The McCabe rating is 2:HIGH +too-complex:45:0:45:6:f6:'f6' is too complex. The McCabe rating is 2:HIGH +too-complex:53:0:53:6:f7:'f7' is too complex. The McCabe rating is 3:HIGH +too-complex:68:0:68:6:f8:'f8' is too complex. The McCabe rating is 4:HIGH +too-complex:80:0:80:6:f9:'f9' is too complex. The McCabe rating is 9:HIGH +too-complex:106:0:106:7:f10:'f10' is too complex. The McCabe rating is 11:HIGH +too-complex:138:4:138:15:MyClass1.method1:'method1' is too complex. The McCabe rating is 1:HIGH +too-complex:142:4:142:15:MyClass1.method2:'method2' is too complex. The McCabe rating is 18:HIGH +too-many-branches:142:4:142:15:MyClass1.method2:Too many branches (20/12):UNDEFINED too-complex:198:0:204:15::This 'for' is too complex. The McCabe rating is 4:HIGH -too-complex:207:0:216:15:method3:'method3' is too complex. The McCabe rating is 2:HIGH +too-complex:207:0:207:11:method3:'method3' is too complex. The McCabe rating is 2:HIGH diff --git a/tests/functional/f/first_arg.txt b/tests/functional/f/first_arg.txt index 8517a8ad8a..e75743b33e 100644 --- a/tests/functional/f/first_arg.txt +++ b/tests/functional/f/first_arg.txt @@ -1,9 +1,9 @@ -bad-classmethod-argument:10:4:11:12:Obj.__new__:Class method __new__ should have 'cls' as first argument:UNDEFINED +bad-classmethod-argument:10:4:10:15:Obj.__new__:Class method __new__ should have 'cls' as first argument:UNDEFINED no-classmethod-decorator:16:4:16:10:Obj:Consider using a decorator instead of calling classmethod:UNDEFINED -bad-classmethod-argument:18:4:19:12:Obj.class2:Class method class2 should have 'cls' as first argument:UNDEFINED +bad-classmethod-argument:18:4:18:14:Obj.class2:Class method class2 should have 'cls' as first argument:UNDEFINED no-classmethod-decorator:20:4:20:10:Obj:Consider using a decorator instead of calling classmethod:UNDEFINED -bad-mcs-classmethod-argument:25:4:26:12:Meta.__new__:Metaclass class method __new__ should have 'cls' as first argument:UNDEFINED -bad-mcs-method-argument:32:4:33:12:Meta.method2:Metaclass method method2 should have 'cls' as first argument:UNDEFINED +bad-mcs-classmethod-argument:25:4:25:15:Meta.__new__:Metaclass class method __new__ should have 'cls' as first argument:UNDEFINED +bad-mcs-method-argument:32:4:32:15:Meta.method2:Metaclass method method2 should have 'cls' as first argument:UNDEFINED no-classmethod-decorator:38:4:38:10:Meta:Consider using a decorator instead of calling classmethod:UNDEFINED -bad-mcs-classmethod-argument:40:4:41:12:Meta.class2:Metaclass class method class2 should have 'cls' as first argument:UNDEFINED +bad-mcs-classmethod-argument:40:4:40:14:Meta.class2:Metaclass class method class2 should have 'cls' as first argument:UNDEFINED no-classmethod-decorator:42:4:42:10:Meta:Consider using a decorator instead of calling classmethod:UNDEFINED diff --git a/tests/functional/f/function_redefined.txt b/tests/functional/f/function_redefined.txt index 2a538f66aa..724fe13ca1 100644 --- a/tests/functional/f/function_redefined.txt +++ b/tests/functional/f/function_redefined.txt @@ -1,7 +1,7 @@ -function-redefined:18:4:19:23:AAAA.method2:method already defined line 15:UNDEFINED -function-redefined:21:0:28:17:AAAA:class already defined line 8:UNDEFINED -function-redefined:35:0:38:23:func2:function already defined line 32:UNDEFINED +function-redefined:18:4:18:15:AAAA.method2:method already defined line 15:UNDEFINED +function-redefined:21:0:21:10:AAAA:class already defined line 8:UNDEFINED +function-redefined:35:0:35:9:func2:function already defined line 32:UNDEFINED redefined-outer-name:37:4:37:16:func2:Redefining name '__revision__' from outer scope (line 7):UNDEFINED -function-redefined:54:4:55:51:exclusive_func2:function already defined line 48:UNDEFINED -function-redefined:89:0:90:8:ceil:function already defined line 88:UNDEFINED -function-redefined:93:0:94:8:math:function already defined line 92:UNDEFINED +function-redefined:54:4:54:23:exclusive_func2:function already defined line 48:UNDEFINED +function-redefined:89:0:89:8:ceil:function already defined line 88:UNDEFINED +function-redefined:93:0:93:8:math:function already defined line 92:UNDEFINED diff --git a/tests/functional/g/generic_alias/generic_alias_collections.txt b/tests/functional/g/generic_alias/generic_alias_collections.txt index 6d3914a78b..663b81abb2 100644 --- a/tests/functional/g/generic_alias/generic_alias_collections.txt +++ b/tests/functional/g/generic_alias/generic_alias_collections.txt @@ -1,16 +1,16 @@ unsubscriptable-object:66:0:66:24::Value 'collections.abc.Hashable' is unsubscriptable:UNDEFINED unsubscriptable-object:67:0:67:21::Value 'collections.abc.Sized' is unsubscriptable:UNDEFINED -abstract-method:74:0:75:8:DerivedHashable:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED -abstract-method:77:0:78:8:DerivedIterable:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED -abstract-method:80:0:81:8:DerivedCollection:Method '__contains__' is abstract in class 'Container' but is not overridden:UNDEFINED -abstract-method:80:0:81:8:DerivedCollection:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED -abstract-method:80:0:81:8:DerivedCollection:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED -abstract-method:99:0:100:8:DerivedMultiple:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED -abstract-method:99:0:100:8:DerivedMultiple:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED -abstract-method:104:0:105:8:CustomAbstractCls2:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED -abstract-method:104:0:105:8:CustomAbstractCls2:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED -abstract-method:106:0:107:8:CustomImplementation:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED -abstract-method:106:0:107:8:CustomImplementation:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:74:0:74:21:DerivedHashable:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED +abstract-method:77:0:77:21:DerivedIterable:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED +abstract-method:80:0:80:23:DerivedCollection:Method '__contains__' is abstract in class 'Container' but is not overridden:UNDEFINED +abstract-method:80:0:80:23:DerivedCollection:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED +abstract-method:80:0:80:23:DerivedCollection:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:99:0:99:21:DerivedMultiple:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED +abstract-method:99:0:99:21:DerivedMultiple:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:104:0:104:24:CustomAbstractCls2:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED +abstract-method:104:0:104:24:CustomAbstractCls2:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:106:0:106:26:CustomImplementation:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED +abstract-method:106:0:106:26:CustomImplementation:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED unsubscriptable-object:125:9:125:12::Value 'int' is unsubscriptable:UNDEFINED unsubscriptable-object:126:15:126:39::Value 'collections.abc.Hashable' is unsubscriptable:UNDEFINED unsubscriptable-object:127:12:127:33::Value 'collections.abc.Sized' is unsubscriptable:UNDEFINED diff --git a/tests/functional/g/generic_alias/generic_alias_collections_py37.txt b/tests/functional/g/generic_alias/generic_alias_collections_py37.txt index cd4b30b6f6..84a217d2fc 100644 --- a/tests/functional/g/generic_alias/generic_alias_collections_py37.txt +++ b/tests/functional/g/generic_alias/generic_alias_collections_py37.txt @@ -39,7 +39,7 @@ unsubscriptable-object:63:0:63:8::Value 're.Match' is unsubscriptable:UNDEFINED unsubscriptable-object:69:0:69:24::Value 'collections.abc.Hashable' is unsubscriptable:UNDEFINED unsubscriptable-object:70:0:70:21::Value 'collections.abc.Sized' is unsubscriptable:UNDEFINED unsubscriptable-object:73:0:73:26::Value 'collections.abc.ByteString' is unsubscriptable:UNDEFINED -abstract-method:77:0:78:8:DerivedHashable:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED +abstract-method:77:0:77:21:DerivedHashable:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED unsubscriptable-object:80:22:80:46:DerivedIterable:Value 'collections.abc.Iterable' is unsubscriptable:UNDEFINED unsubscriptable-object:83:24:83:50:DerivedCollection:Value 'collections.abc.Collection' is unsubscriptable:UNDEFINED unsubscriptable-object:88:18:88:22:DerivedList:Value 'list' is unsubscriptable:UNDEFINED @@ -47,11 +47,11 @@ unsubscriptable-object:91:17:91:20:DerivedSet:Value 'set' is unsubscriptable:UND unsubscriptable-object:94:25:94:48:DerivedOrderedDict:Value 'collections.OrderedDict' is unsubscriptable:UNDEFINED unsubscriptable-object:97:31:97:55:DerivedListIterable:Value 'collections.abc.Iterable' is unsubscriptable:UNDEFINED unsubscriptable-object:97:26:97:30:DerivedListIterable:Value 'list' is unsubscriptable:UNDEFINED -abstract-method:102:0:103:8:DerivedMultiple:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED -abstract-method:102:0:103:8:DerivedMultiple:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED -abstract-method:107:0:108:8:CustomAbstractCls2:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:102:0:102:21:DerivedMultiple:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED +abstract-method:102:0:102:21:DerivedMultiple:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:107:0:107:24:CustomAbstractCls2:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED unsubscriptable-object:107:48:107:72:CustomAbstractCls2:Value 'collections.abc.Iterable' is unsubscriptable:UNDEFINED -abstract-method:109:0:110:8:CustomImplementation:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:109:0:109:26:CustomImplementation:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED unsubscriptable-object:114:11:114:16::Value 'tuple' is unsubscriptable:UNDEFINED unsubscriptable-object:115:10:115:14::Value 'dict' is unsubscriptable:UNDEFINED unsubscriptable-object:116:17:116:40::Value 'collections.OrderedDict' is unsubscriptable:UNDEFINED diff --git a/tests/functional/g/generic_alias/generic_alias_collections_py37_with_typing.txt b/tests/functional/g/generic_alias/generic_alias_collections_py37_with_typing.txt index 2d52319ada..ee1407bdb6 100644 --- a/tests/functional/g/generic_alias/generic_alias_collections_py37_with_typing.txt +++ b/tests/functional/g/generic_alias/generic_alias_collections_py37_with_typing.txt @@ -39,7 +39,7 @@ unsubscriptable-object:65:0:65:8::Value 're.Match' is unsubscriptable:UNDEFINED unsubscriptable-object:71:0:71:24::Value 'collections.abc.Hashable' is unsubscriptable:UNDEFINED unsubscriptable-object:72:0:72:21::Value 'collections.abc.Sized' is unsubscriptable:UNDEFINED unsubscriptable-object:75:0:75:26::Value 'collections.abc.ByteString' is unsubscriptable:UNDEFINED -abstract-method:79:0:80:8:DerivedHashable:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED +abstract-method:79:0:79:21:DerivedHashable:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED unsubscriptable-object:82:22:82:46:DerivedIterable:Value 'collections.abc.Iterable' is unsubscriptable:UNDEFINED unsubscriptable-object:85:24:85:50:DerivedCollection:Value 'collections.abc.Collection' is unsubscriptable:UNDEFINED unsubscriptable-object:90:18:90:22:DerivedList:Value 'list' is unsubscriptable:UNDEFINED @@ -47,11 +47,11 @@ unsubscriptable-object:93:17:93:20:DerivedSet:Value 'set' is unsubscriptable:UND unsubscriptable-object:96:25:96:48:DerivedOrderedDict:Value 'collections.OrderedDict' is unsubscriptable:UNDEFINED unsubscriptable-object:99:31:99:55:DerivedListIterable:Value 'collections.abc.Iterable' is unsubscriptable:UNDEFINED unsubscriptable-object:99:26:99:30:DerivedListIterable:Value 'list' is unsubscriptable:UNDEFINED -abstract-method:104:0:105:8:DerivedMultiple:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED -abstract-method:104:0:105:8:DerivedMultiple:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED -abstract-method:109:0:110:8:CustomAbstractCls2:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:104:0:104:21:DerivedMultiple:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED +abstract-method:104:0:104:21:DerivedMultiple:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:109:0:109:24:CustomAbstractCls2:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED unsubscriptable-object:109:48:109:72:CustomAbstractCls2:Value 'collections.abc.Iterable' is unsubscriptable:UNDEFINED -abstract-method:111:0:112:8:CustomImplementation:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:111:0:111:26:CustomImplementation:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED unsubscriptable-object:116:11:116:16::Value 'tuple' is unsubscriptable:UNDEFINED unsubscriptable-object:117:10:117:14::Value 'dict' is unsubscriptable:UNDEFINED unsubscriptable-object:118:17:118:40::Value 'collections.OrderedDict' is unsubscriptable:UNDEFINED diff --git a/tests/functional/g/generic_alias/generic_alias_mixed_py37.txt b/tests/functional/g/generic_alias/generic_alias_mixed_py37.txt index c42ad40062..2bafe20ed8 100644 --- a/tests/functional/g/generic_alias/generic_alias_mixed_py37.txt +++ b/tests/functional/g/generic_alias/generic_alias_mixed_py37.txt @@ -1,5 +1,5 @@ -abstract-method:34:0:35:8:DerivedHashable:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED -abstract-method:37:0:38:8:DerivedIterable:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED -abstract-method:40:0:41:8:DerivedCollection:Method '__contains__' is abstract in class 'Container' but is not overridden:UNDEFINED -abstract-method:40:0:41:8:DerivedCollection:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED -abstract-method:40:0:41:8:DerivedCollection:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:34:0:34:21:DerivedHashable:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED +abstract-method:37:0:37:21:DerivedIterable:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED +abstract-method:40:0:40:23:DerivedCollection:Method '__contains__' is abstract in class 'Container' but is not overridden:UNDEFINED +abstract-method:40:0:40:23:DerivedCollection:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED +abstract-method:40:0:40:23:DerivedCollection:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED diff --git a/tests/functional/g/generic_alias/generic_alias_mixed_py39.txt b/tests/functional/g/generic_alias/generic_alias_mixed_py39.txt index fd5746a70c..06dbdc1976 100644 --- a/tests/functional/g/generic_alias/generic_alias_mixed_py39.txt +++ b/tests/functional/g/generic_alias/generic_alias_mixed_py39.txt @@ -1,5 +1,5 @@ -abstract-method:29:0:30:8:DerivedHashable:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED -abstract-method:32:0:33:8:DerivedIterable:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED -abstract-method:35:0:36:8:DerivedCollection:Method '__contains__' is abstract in class 'Container' but is not overridden:UNDEFINED -abstract-method:35:0:36:8:DerivedCollection:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED -abstract-method:35:0:36:8:DerivedCollection:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:29:0:29:21:DerivedHashable:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED +abstract-method:32:0:32:21:DerivedIterable:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED +abstract-method:35:0:35:23:DerivedCollection:Method '__contains__' is abstract in class 'Container' but is not overridden:UNDEFINED +abstract-method:35:0:35:23:DerivedCollection:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED +abstract-method:35:0:35:23:DerivedCollection:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED diff --git a/tests/functional/g/generic_alias/generic_alias_postponed_evaluation_py37.txt b/tests/functional/g/generic_alias/generic_alias_postponed_evaluation_py37.txt index 266644535c..56eca5192b 100644 --- a/tests/functional/g/generic_alias/generic_alias_postponed_evaluation_py37.txt +++ b/tests/functional/g/generic_alias/generic_alias_postponed_evaluation_py37.txt @@ -39,7 +39,7 @@ unsubscriptable-object:68:0:68:8::Value 're.Match' is unsubscriptable:UNDEFINED unsubscriptable-object:74:0:74:24::Value 'collections.abc.Hashable' is unsubscriptable:UNDEFINED unsubscriptable-object:75:0:75:21::Value 'collections.abc.Sized' is unsubscriptable:UNDEFINED unsubscriptable-object:78:0:78:26::Value 'collections.abc.ByteString' is unsubscriptable:UNDEFINED -abstract-method:82:0:83:8:DerivedHashable:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED +abstract-method:82:0:82:21:DerivedHashable:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED unsubscriptable-object:85:22:85:46:DerivedIterable:Value 'collections.abc.Iterable' is unsubscriptable:UNDEFINED unsubscriptable-object:88:24:88:50:DerivedCollection:Value 'collections.abc.Collection' is unsubscriptable:UNDEFINED unsubscriptable-object:93:18:93:22:DerivedList:Value 'list' is unsubscriptable:UNDEFINED @@ -47,10 +47,10 @@ unsubscriptable-object:96:17:96:20:DerivedSet:Value 'set' is unsubscriptable:UND unsubscriptable-object:99:25:99:48:DerivedOrderedDict:Value 'collections.OrderedDict' is unsubscriptable:UNDEFINED unsubscriptable-object:102:31:102:55:DerivedListIterable:Value 'collections.abc.Iterable' is unsubscriptable:UNDEFINED unsubscriptable-object:102:26:102:30:DerivedListIterable:Value 'list' is unsubscriptable:UNDEFINED -abstract-method:107:0:108:8:DerivedMultiple:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED -abstract-method:107:0:108:8:DerivedMultiple:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED -abstract-method:112:0:113:8:CustomAbstractCls2:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:107:0:107:21:DerivedMultiple:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED +abstract-method:107:0:107:21:DerivedMultiple:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:112:0:112:24:CustomAbstractCls2:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED unsubscriptable-object:112:48:112:72:CustomAbstractCls2:Value 'collections.abc.Iterable' is unsubscriptable:UNDEFINED -abstract-method:114:0:115:8:CustomImplementation:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:114:0:114:26:CustomImplementation:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED unsubscriptable-object:175:19:175:43::Value 'collections.abc.Hashable' is unsubscriptable:UNDEFINED unsubscriptable-object:176:16:176:37::Value 'collections.abc.Sized' is unsubscriptable:UNDEFINED diff --git a/tests/functional/g/generic_alias/generic_alias_related.txt b/tests/functional/g/generic_alias/generic_alias_related.txt index 2d65b62137..d13f75fa76 100644 --- a/tests/functional/g/generic_alias/generic_alias_related.txt +++ b/tests/functional/g/generic_alias/generic_alias_related.txt @@ -2,4 +2,4 @@ unsubscriptable-object:34:0:34:20::Value 'ClsUnsubscriptable()' is unsubscriptab unsubscriptable-object:35:0:35:18::Value 'ClsUnsubscriptable' is unsubscriptable:UNDEFINED unsubscriptable-object:38:0:38:10::Value 'ClsGetItem' is unsubscriptable:UNDEFINED unsubscriptable-object:40:0:40:17::Value 'ClsClassGetItem()' is unsubscriptable:UNDEFINED -abstract-method:53:0:54:8:Derived:Method 'abstract_method' is abstract in class 'ClsAbstract' but is not overridden:UNDEFINED +abstract-method:53:0:53:13:Derived:Method 'abstract_method' is abstract in class 'ClsAbstract' but is not overridden:UNDEFINED diff --git a/tests/functional/g/generic_alias/generic_alias_related_py39.txt b/tests/functional/g/generic_alias/generic_alias_related_py39.txt index 295288f04d..114376f5ef 100644 --- a/tests/functional/g/generic_alias/generic_alias_related_py39.txt +++ b/tests/functional/g/generic_alias/generic_alias_related_py39.txt @@ -2,4 +2,4 @@ unsubscriptable-object:36:0:36:20::Value 'ClsUnsubscriptable()' is unsubscriptab unsubscriptable-object:37:0:37:18::Value 'ClsUnsubscriptable' is unsubscriptable:UNDEFINED unsubscriptable-object:40:0:40:10::Value 'ClsGetItem' is unsubscriptable:UNDEFINED unsubscriptable-object:42:0:42:17::Value 'ClsClassGetItem()' is unsubscriptable:UNDEFINED -abstract-method:55:0:56:8:Derived:Method 'abstract_method' is abstract in class 'ClsAbstract' but is not overridden:UNDEFINED +abstract-method:55:0:55:13:Derived:Method 'abstract_method' is abstract in class 'ClsAbstract' but is not overridden:UNDEFINED diff --git a/tests/functional/g/generic_alias/generic_alias_side_effects.txt b/tests/functional/g/generic_alias/generic_alias_side_effects.txt index 3e7548da61..b22f185ea8 100644 --- a/tests/functional/g/generic_alias/generic_alias_side_effects.txt +++ b/tests/functional/g/generic_alias/generic_alias_side_effects.txt @@ -1,8 +1,8 @@ -dangerous-default-value:19:0:21:16:function4:Dangerous default value set() (builtins.set) as argument:UNDEFINED -dangerous-default-value:27:0:29:16:function7:Dangerous default value dict() (builtins.dict) as argument:UNDEFINED -dangerous-default-value:31:0:33:16:function8:Dangerous default value list() (builtins.list) as argument:UNDEFINED -dangerous-default-value:35:0:37:16:function17:Dangerous default value deque() (collections.deque) as argument:UNDEFINED -dangerous-default-value:39:0:41:16:function18:Dangerous default value ChainMap() (collections.ChainMap) as argument:UNDEFINED -dangerous-default-value:43:0:45:16:function19:Dangerous default value Counter() (collections.Counter) as argument:UNDEFINED -dangerous-default-value:47:0:49:16:function20:Dangerous default value OrderedDict() (collections.OrderedDict) as argument:UNDEFINED -dangerous-default-value:51:0:53:16:function21:Dangerous default value defaultdict() (collections.defaultdict) as argument:UNDEFINED +dangerous-default-value:19:0:19:13:function4:Dangerous default value set() (builtins.set) as argument:UNDEFINED +dangerous-default-value:27:0:27:13:function7:Dangerous default value dict() (builtins.dict) as argument:UNDEFINED +dangerous-default-value:31:0:31:13:function8:Dangerous default value list() (builtins.list) as argument:UNDEFINED +dangerous-default-value:35:0:35:14:function17:Dangerous default value deque() (collections.deque) as argument:UNDEFINED +dangerous-default-value:39:0:39:14:function18:Dangerous default value ChainMap() (collections.ChainMap) as argument:UNDEFINED +dangerous-default-value:43:0:43:14:function19:Dangerous default value Counter() (collections.Counter) as argument:UNDEFINED +dangerous-default-value:47:0:47:14:function20:Dangerous default value OrderedDict() (collections.OrderedDict) as argument:UNDEFINED +dangerous-default-value:51:0:51:14:function21:Dangerous default value defaultdict() (collections.defaultdict) as argument:UNDEFINED diff --git a/tests/functional/g/generic_alias/generic_alias_typing.txt b/tests/functional/g/generic_alias/generic_alias_typing.txt index b5cb449b88..8ed10fe10b 100644 --- a/tests/functional/g/generic_alias/generic_alias_typing.txt +++ b/tests/functional/g/generic_alias/generic_alias_typing.txt @@ -1,18 +1,18 @@ unsubscriptable-object:66:0:66:17::Value 'typing.ByteString' is unsubscriptable:UNDEFINED unsubscriptable-object:67:0:67:15::Value 'typing.Hashable' is unsubscriptable:UNDEFINED unsubscriptable-object:68:0:68:12::Value 'typing.Sized' is unsubscriptable:UNDEFINED -abstract-method:72:0:73:8:DerivedHashable:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED -abstract-method:75:0:76:8:DerivedIterable:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED -abstract-method:78:0:79:8:DerivedCollection:Method '__contains__' is abstract in class 'Container' but is not overridden:UNDEFINED -abstract-method:78:0:79:8:DerivedCollection:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED -abstract-method:78:0:79:8:DerivedCollection:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED -abstract-method:100:0:101:8:DerivedMultiple:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED -abstract-method:100:0:101:8:DerivedMultiple:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED -abstract-method:105:0:106:8:CustomAbstractCls2:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED -abstract-method:105:0:106:8:CustomAbstractCls2:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED -abstract-method:107:0:108:8:CustomImplementation:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED -abstract-method:107:0:108:8:CustomImplementation:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED -abstract-method:118:0:119:8:DerivedIterable2:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED +abstract-method:72:0:72:21:DerivedHashable:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED +abstract-method:75:0:75:21:DerivedIterable:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED +abstract-method:78:0:78:23:DerivedCollection:Method '__contains__' is abstract in class 'Container' but is not overridden:UNDEFINED +abstract-method:78:0:78:23:DerivedCollection:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED +abstract-method:78:0:78:23:DerivedCollection:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:100:0:100:21:DerivedMultiple:Method '__hash__' is abstract in class 'Hashable' but is not overridden:UNDEFINED +abstract-method:100:0:100:21:DerivedMultiple:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:105:0:105:24:CustomAbstractCls2:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED +abstract-method:105:0:105:24:CustomAbstractCls2:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:107:0:107:26:CustomImplementation:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED +abstract-method:107:0:107:26:CustomImplementation:Method '__len__' is abstract in class 'Sized' but is not overridden:UNDEFINED +abstract-method:118:0:118:22:DerivedIterable2:Method '__iter__' is abstract in class 'Iterable' but is not overridden:UNDEFINED unsubscriptable-object:138:9:138:12::Value 'int' is unsubscriptable:UNDEFINED unsubscriptable-object:139:17:139:34::Value 'typing.ByteString' is unsubscriptable:UNDEFINED unsubscriptable-object:140:15:140:30::Value 'typing.Hashable' is unsubscriptable:UNDEFINED diff --git a/tests/functional/i/inconsistent/inconsistent_mro.txt b/tests/functional/i/inconsistent/inconsistent_mro.txt index 8760dfae6f..ea5ca14233 100644 --- a/tests/functional/i/inconsistent/inconsistent_mro.txt +++ b/tests/functional/i/inconsistent/inconsistent_mro.txt @@ -1 +1 @@ -inconsistent-mro:8:0:9:8:Inconsistent:Inconsistent method resolution order for class 'Inconsistent':UNDEFINED +inconsistent-mro:8:0:8:18:Inconsistent:Inconsistent method resolution order for class 'Inconsistent':UNDEFINED diff --git a/tests/functional/i/inconsistent/inconsistent_returns.txt b/tests/functional/i/inconsistent/inconsistent_returns.txt index cf67b13ea2..8e67a83f8f 100644 --- a/tests/functional/i/inconsistent/inconsistent_returns.txt +++ b/tests/functional/i/inconsistent/inconsistent_returns.txt @@ -1,17 +1,17 @@ -inconsistent-return-statements:160:0:162:29:explicit_implicit_returns:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -inconsistent-return-statements:164:0:167:25:empty_explicit_returns:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -inconsistent-return-statements:169:0:175:19:explicit_implicit_returns2:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -inconsistent-return-statements:177:0:183:23:explicit_implicit_returns3:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -inconsistent-return-statements:185:0:193:16:returns_missing_in_catched_exceptions:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -inconsistent-return-statements:195:0:200:22:complex_func:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -inconsistent-return-statements:203:4:208:26:inconsistent_returns_in_nested_function.not_consistent_returns_inner:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -inconsistent-return-statements:211:0:215:22:bug_1771_counter_example:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -inconsistent-return-statements:229:0:235:24:bug_1772_counter_example:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -inconsistent-return-statements:237:0:244:14:bug_1794_inner_func_in_if_counter_example_1:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -inconsistent-return-statements:246:0:253:14:bug_1794_inner_func_in_if_counter_example_2:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -inconsistent-return-statements:255:0:265:18:bug_1794_inner_func_in_if_counter_example_3:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -inconsistent-return-statements:262:8:265:18:bug_1794_inner_func_in_if_counter_example_3._inner2:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -inconsistent-return-statements:267:0:275:12:bug_3468:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -inconsistent-return-statements:277:0:289:13:bug_3468_variant:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -inconsistent-return-statements:322:0:329:20:bug_pylint_3873_1:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED -inconsistent-return-statements:349:0:355:15:bug_pylint_4019_wrong:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:160:0:160:29:explicit_implicit_returns:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:164:0:164:26:empty_explicit_returns:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:169:0:169:30:explicit_implicit_returns2:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:177:0:177:30:explicit_implicit_returns3:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:185:0:185:41:returns_missing_in_catched_exceptions:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:195:0:195:16:complex_func:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:203:4:203:36:inconsistent_returns_in_nested_function.not_consistent_returns_inner:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:211:0:211:28:bug_1771_counter_example:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:229:0:229:28:bug_1772_counter_example:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:237:0:237:47:bug_1794_inner_func_in_if_counter_example_1:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:246:0:246:47:bug_1794_inner_func_in_if_counter_example_2:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:255:0:255:47:bug_1794_inner_func_in_if_counter_example_3:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:262:8:262:19:bug_1794_inner_func_in_if_counter_example_3._inner2:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:267:0:267:12:bug_3468:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:277:0:277:20:bug_3468_variant:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:322:0:322:21:bug_pylint_3873_1:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:349:0:349:25:bug_pylint_4019_wrong:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED diff --git a/tests/functional/i/inconsistent/inconsistent_returns_noreturn.txt b/tests/functional/i/inconsistent/inconsistent_returns_noreturn.txt index 8e36f5b59d..0e3ca50745 100644 --- a/tests/functional/i/inconsistent/inconsistent_returns_noreturn.txt +++ b/tests/functional/i/inconsistent/inconsistent_returns_noreturn.txt @@ -1 +1 @@ -inconsistent-return-statements:32:0:42:44:bug_pylint_4122_wrong:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED +inconsistent-return-statements:32:0:32:25:bug_pylint_4122_wrong:Either all return statements in a function should return an expression, or none of them should.:UNDEFINED diff --git a/tests/functional/i/inherit_non_class.txt b/tests/functional/i/inherit_non_class.txt index da0f55df72..4f90838329 100644 --- a/tests/functional/i/inherit_non_class.txt +++ b/tests/functional/i/inherit_non_class.txt @@ -1,11 +1,11 @@ -inherit-non-class:21:0:22:40:Bad:Inheriting '1', which is not a class.:UNDEFINED -inherit-non-class:24:0:25:38:Bad1:"Inheriting 'lambda abc: 42', which is not a class.":UNDEFINED -inherit-non-class:27:0:28:53:Bad2:Inheriting 'object()', which is not a class.:UNDEFINED -inherit-non-class:30:0:31:40:Bad3:Inheriting 'return_class', which is not a class.:UNDEFINED -inherit-non-class:33:0:34:40:Bad4:Inheriting 'Empty()', which is not a class.:UNDEFINED -inherit-non-class:68:0:69:8:NotInheritableBool:Inheriting 'bool', which is not a class.:UNDEFINED -inherit-non-class:72:0:73:8:NotInheritableRange:Inheriting 'range', which is not a class.:UNDEFINED -inherit-non-class:76:0:77:8:NotInheritableSlice:Inheriting 'slice', which is not a class.:UNDEFINED -inherit-non-class:80:0:81:8:NotInheritableMemoryView:Inheriting 'memoryview', which is not a class.:UNDEFINED -inherit-non-class:99:0:100:8:Child2:Inheriting 'ParentBad[int]', which is not a class.:UNDEFINED +inherit-non-class:21:0:21:9:Bad:Inheriting '1', which is not a class.:UNDEFINED +inherit-non-class:24:0:24:10:Bad1:"Inheriting 'lambda abc: 42', which is not a class.":UNDEFINED +inherit-non-class:27:0:27:10:Bad2:Inheriting 'object()', which is not a class.:UNDEFINED +inherit-non-class:30:0:30:10:Bad3:Inheriting 'return_class', which is not a class.:UNDEFINED +inherit-non-class:33:0:33:10:Bad4:Inheriting 'Empty()', which is not a class.:UNDEFINED +inherit-non-class:68:0:68:24:NotInheritableBool:Inheriting 'bool', which is not a class.:UNDEFINED +inherit-non-class:72:0:72:25:NotInheritableRange:Inheriting 'range', which is not a class.:UNDEFINED +inherit-non-class:76:0:76:25:NotInheritableSlice:Inheriting 'slice', which is not a class.:UNDEFINED +inherit-non-class:80:0:80:30:NotInheritableMemoryView:Inheriting 'memoryview', which is not a class.:UNDEFINED +inherit-non-class:99:0:99:12:Child2:Inheriting 'ParentBad[int]', which is not a class.:UNDEFINED unsubscriptable-object:103:13:103:18:Child3:Value 'Empty' is unsubscriptable:UNDEFINED diff --git a/tests/functional/i/init_is_generator.txt b/tests/functional/i/init_is_generator.txt index 3566e6f585..789e322e87 100644 --- a/tests/functional/i/init_is_generator.txt +++ b/tests/functional/i/init_is_generator.txt @@ -1 +1 @@ -init-is-generator:4:4:5:18:SomeClass.__init__:__init__ method is a generator:UNDEFINED +init-is-generator:4:4:4:16:SomeClass.__init__:__init__ method is a generator:UNDEFINED diff --git a/tests/functional/i/init_not_called.txt b/tests/functional/i/init_not_called.txt index f1779a26a0..ae5e8f91fa 100644 --- a/tests/functional/i/init_not_called.txt +++ b/tests/functional/i/init_not_called.txt @@ -1,2 +1,2 @@ -super-init-not-called:25:4:26:27:ZZZZ.__init__:__init__ method from base class 'BBBB' is not called:INFERENCE -super-init-not-called:58:4:59:20:AssignedInit.__init__:__init__ method from base class 'NewStyleC' is not called:INFERENCE +super-init-not-called:25:4:25:16:ZZZZ.__init__:__init__ method from base class 'BBBB' is not called:INFERENCE +super-init-not-called:58:4:58:16:AssignedInit.__init__:__init__ method from base class 'NewStyleC' is not called:INFERENCE diff --git a/tests/functional/i/invalid/invalid_bool_returned.txt b/tests/functional/i/invalid/invalid_bool_returned.txt index 616209139a..f8c6fc125f 100644 --- a/tests/functional/i/invalid/invalid_bool_returned.txt +++ b/tests/functional/i/invalid/invalid_bool_returned.txt @@ -1,3 +1,3 @@ -invalid-bool-returned:36:4:37:16:FirstBadBool.__bool__:__bool__ does not return bool:UNDEFINED -invalid-bool-returned:43:4:44:21:SecondBadBool.__bool__:__bool__ does not return bool:UNDEFINED -invalid-bool-returned:50:4:51:24:ThirdBadBool.__bool__:__bool__ does not return bool:UNDEFINED +invalid-bool-returned:36:4:36:16:FirstBadBool.__bool__:__bool__ does not return bool:UNDEFINED +invalid-bool-returned:43:4:43:16:SecondBadBool.__bool__:__bool__ does not return bool:UNDEFINED +invalid-bool-returned:50:4:50:16:ThirdBadBool.__bool__:__bool__ does not return bool:UNDEFINED diff --git a/tests/functional/i/invalid/invalid_bytes_returned.txt b/tests/functional/i/invalid/invalid_bytes_returned.txt index 9d8f0ece69..c05ea92939 100644 --- a/tests/functional/i/invalid/invalid_bytes_returned.txt +++ b/tests/functional/i/invalid/invalid_bytes_returned.txt @@ -1,3 +1,3 @@ -invalid-bytes-returned:36:4:37:20:FirstBadBytes.__bytes__:__bytes__ does not return bytes:UNDEFINED -invalid-bytes-returned:43:4:44:16:SecondBadBytes.__bytes__:__bytes__ does not return bytes:UNDEFINED -invalid-bytes-returned:50:4:51:36:ThirdBadBytes.__bytes__:__bytes__ does not return bytes:UNDEFINED +invalid-bytes-returned:36:4:36:17:FirstBadBytes.__bytes__:__bytes__ does not return bytes:UNDEFINED +invalid-bytes-returned:43:4:43:17:SecondBadBytes.__bytes__:__bytes__ does not return bytes:UNDEFINED +invalid-bytes-returned:50:4:50:17:ThirdBadBytes.__bytes__:__bytes__ does not return bytes:UNDEFINED diff --git a/tests/functional/i/invalid/invalid_format_returned.txt b/tests/functional/i/invalid/invalid_format_returned.txt index fc753eab3c..17ebefc960 100644 --- a/tests/functional/i/invalid/invalid_format_returned.txt +++ b/tests/functional/i/invalid/invalid_format_returned.txt @@ -1,3 +1,3 @@ -invalid-format-returned:36:4:37:21:FirstBadFormat.__format__:__format__ does not return str:UNDEFINED -invalid-format-returned:43:4:44:16:SecondBadFormat.__format__:__format__ does not return str:UNDEFINED -invalid-format-returned:50:4:51:36:ThirdBadFormat.__format__:__format__ does not return str:UNDEFINED +invalid-format-returned:36:4:36:18:FirstBadFormat.__format__:__format__ does not return str:UNDEFINED +invalid-format-returned:43:4:43:18:SecondBadFormat.__format__:__format__ does not return str:UNDEFINED +invalid-format-returned:50:4:50:18:ThirdBadFormat.__format__:__format__ does not return str:UNDEFINED diff --git a/tests/functional/i/invalid/invalid_getnewargs/invalid_getnewargs_ex_returned.txt b/tests/functional/i/invalid/invalid_getnewargs/invalid_getnewargs_ex_returned.txt index 198808e79e..b657c5f40b 100644 --- a/tests/functional/i/invalid/invalid_getnewargs/invalid_getnewargs_ex_returned.txt +++ b/tests/functional/i/invalid/invalid_getnewargs/invalid_getnewargs_ex_returned.txt @@ -1,6 +1,6 @@ -invalid-getnewargs-ex-returned:36:4:37:16:FirstBadGetNewArgsEx.__getnewargs_ex__:__getnewargs_ex__ does not return a tuple containing (tuple, dict):UNDEFINED -invalid-getnewargs-ex-returned:43:4:44:41:SecondBadGetNewArgsEx.__getnewargs_ex__:__getnewargs_ex__ does not return a tuple containing (tuple, dict):UNDEFINED -invalid-getnewargs-ex-returned:50:4:51:41:ThirdBadGetNewArgsEx.__getnewargs_ex__:__getnewargs_ex__ does not return a tuple containing (tuple, dict):UNDEFINED -invalid-getnewargs-ex-returned:57:4:58:29:FourthBadGetNewArgsEx.__getnewargs_ex__:__getnewargs_ex__ does not return a tuple containing (tuple, dict):UNDEFINED -invalid-getnewargs-ex-returned:64:4:65:33:FifthBadGetNewArgsEx.__getnewargs_ex__:__getnewargs_ex__ does not return a tuple containing (tuple, dict):UNDEFINED -invalid-getnewargs-ex-returned:71:4:72:29:SixthBadGetNewArgsEx.__getnewargs_ex__:__getnewargs_ex__ does not return a tuple containing (tuple, dict):UNDEFINED +invalid-getnewargs-ex-returned:36:4:36:25:FirstBadGetNewArgsEx.__getnewargs_ex__:__getnewargs_ex__ does not return a tuple containing (tuple, dict):UNDEFINED +invalid-getnewargs-ex-returned:43:4:43:25:SecondBadGetNewArgsEx.__getnewargs_ex__:__getnewargs_ex__ does not return a tuple containing (tuple, dict):UNDEFINED +invalid-getnewargs-ex-returned:50:4:50:25:ThirdBadGetNewArgsEx.__getnewargs_ex__:__getnewargs_ex__ does not return a tuple containing (tuple, dict):UNDEFINED +invalid-getnewargs-ex-returned:57:4:57:25:FourthBadGetNewArgsEx.__getnewargs_ex__:__getnewargs_ex__ does not return a tuple containing (tuple, dict):UNDEFINED +invalid-getnewargs-ex-returned:64:4:64:25:FifthBadGetNewArgsEx.__getnewargs_ex__:__getnewargs_ex__ does not return a tuple containing (tuple, dict):UNDEFINED +invalid-getnewargs-ex-returned:71:4:71:25:SixthBadGetNewArgsEx.__getnewargs_ex__:__getnewargs_ex__ does not return a tuple containing (tuple, dict):UNDEFINED diff --git a/tests/functional/i/invalid/invalid_getnewargs/invalid_getnewargs_returned.txt b/tests/functional/i/invalid/invalid_getnewargs/invalid_getnewargs_returned.txt index 1c719317d8..83c577bfac 100644 --- a/tests/functional/i/invalid/invalid_getnewargs/invalid_getnewargs_returned.txt +++ b/tests/functional/i/invalid/invalid_getnewargs/invalid_getnewargs_returned.txt @@ -1,3 +1,3 @@ -invalid-getnewargs-returned:36:4:37:16:FirstBadGetNewArgs.__getnewargs__:__getnewargs__ does not return a tuple:UNDEFINED -invalid-getnewargs-returned:43:4:44:26:SecondBadGetNewArgs.__getnewargs__:__getnewargs__ does not return a tuple:UNDEFINED -invalid-getnewargs-returned:50:4:51:34:ThirdBadGetNewArgs.__getnewargs__:__getnewargs__ does not return a tuple:UNDEFINED +invalid-getnewargs-returned:36:4:36:22:FirstBadGetNewArgs.__getnewargs__:__getnewargs__ does not return a tuple:UNDEFINED +invalid-getnewargs-returned:43:4:43:22:SecondBadGetNewArgs.__getnewargs__:__getnewargs__ does not return a tuple:UNDEFINED +invalid-getnewargs-returned:50:4:50:22:ThirdBadGetNewArgs.__getnewargs__:__getnewargs__ does not return a tuple:UNDEFINED diff --git a/tests/functional/i/invalid/invalid_hash_returned.txt b/tests/functional/i/invalid/invalid_hash_returned.txt index 3b5f2d6810..0184f5db5c 100644 --- a/tests/functional/i/invalid/invalid_hash_returned.txt +++ b/tests/functional/i/invalid/invalid_hash_returned.txt @@ -1,4 +1,4 @@ -invalid-hash-returned:36:4:37:17:FirstBadHash.__hash__:__hash__ does not return int:UNDEFINED -invalid-hash-returned:43:4:44:21:SecondBadHash.__hash__:__hash__ does not return int:UNDEFINED -invalid-hash-returned:50:4:51:19:ThirdBadHash.__hash__:__hash__ does not return int:UNDEFINED -invalid-hash-returned:57:4:58:24:FourthBadHash.__hash__:__hash__ does not return int:UNDEFINED +invalid-hash-returned:36:4:36:16:FirstBadHash.__hash__:__hash__ does not return int:UNDEFINED +invalid-hash-returned:43:4:43:16:SecondBadHash.__hash__:__hash__ does not return int:UNDEFINED +invalid-hash-returned:50:4:50:16:ThirdBadHash.__hash__:__hash__ does not return int:UNDEFINED +invalid-hash-returned:57:4:57:16:FourthBadHash.__hash__:__hash__ does not return int:UNDEFINED diff --git a/tests/functional/i/invalid/invalid_index_returned.txt b/tests/functional/i/invalid/invalid_index_returned.txt index 4479b28cf1..5be63e6591 100644 --- a/tests/functional/i/invalid/invalid_index_returned.txt +++ b/tests/functional/i/invalid/invalid_index_returned.txt @@ -1,4 +1,4 @@ -invalid-index-returned:36:4:37:25:FirstBadIndex.__index__:__index__ does not return int:UNDEFINED -invalid-index-returned:43:4:44:19:SecondBadIndex.__index__:__index__ does not return int:UNDEFINED -invalid-index-returned:50:4:51:19:ThirdBadIndex.__index__:__index__ does not return int:UNDEFINED -invalid-index-returned:57:4:58:24:FourthBadIndex.__index__:__index__ does not return int:UNDEFINED +invalid-index-returned:36:4:36:17:FirstBadIndex.__index__:__index__ does not return int:UNDEFINED +invalid-index-returned:43:4:43:17:SecondBadIndex.__index__:__index__ does not return int:UNDEFINED +invalid-index-returned:50:4:50:17:ThirdBadIndex.__index__:__index__ does not return int:UNDEFINED +invalid-index-returned:57:4:57:17:FourthBadIndex.__index__:__index__ does not return int:UNDEFINED diff --git a/tests/functional/i/invalid/invalid_length/invalid_length_hint_returned.txt b/tests/functional/i/invalid/invalid_length/invalid_length_hint_returned.txt index 2447d07438..8856bc95e9 100644 --- a/tests/functional/i/invalid/invalid_length/invalid_length_hint_returned.txt +++ b/tests/functional/i/invalid/invalid_length/invalid_length_hint_returned.txt @@ -1,3 +1,3 @@ -invalid-length-hint-returned:38:4:39:17:FirstBadLengthHint.__length_hint__:__length_hint__ does not return non-negative integer:UNDEFINED -invalid-length-hint-returned:45:4:46:18:SecondBadLengthHint.__length_hint__:__length_hint__ does not return non-negative integer:UNDEFINED -invalid-length-hint-returned:52:4:53:24:ThirdBadLengthHint.__length_hint__:__length_hint__ does not return non-negative integer:UNDEFINED +invalid-length-hint-returned:38:4:38:23:FirstBadLengthHint.__length_hint__:__length_hint__ does not return non-negative integer:UNDEFINED +invalid-length-hint-returned:45:4:45:23:SecondBadLengthHint.__length_hint__:__length_hint__ does not return non-negative integer:UNDEFINED +invalid-length-hint-returned:52:4:52:23:ThirdBadLengthHint.__length_hint__:__length_hint__ does not return non-negative integer:UNDEFINED diff --git a/tests/functional/i/invalid/invalid_length/invalid_length_returned.txt b/tests/functional/i/invalid/invalid_length/invalid_length_returned.txt index 776945e343..f9ed7ac0e3 100644 --- a/tests/functional/i/invalid/invalid_length/invalid_length_returned.txt +++ b/tests/functional/i/invalid/invalid_length/invalid_length_returned.txt @@ -1,4 +1,4 @@ -invalid-length-returned:38:4:39:17:FirstBadLen.__len__:__len__ does not return non-negative integer:UNDEFINED -invalid-length-returned:45:4:46:18:SecondBadLen.__len__:__len__ does not return non-negative integer:UNDEFINED -invalid-length-returned:52:4:53:24:ThirdBadLen.__len__:__len__ does not return non-negative integer:UNDEFINED -invalid-length-returned:59:4:60:18:NonRegression.__len__:__len__ does not return non-negative integer:UNDEFINED +invalid-length-returned:38:4:38:15:FirstBadLen.__len__:__len__ does not return non-negative integer:UNDEFINED +invalid-length-returned:45:4:45:15:SecondBadLen.__len__:__len__ does not return non-negative integer:UNDEFINED +invalid-length-returned:52:4:52:15:ThirdBadLen.__len__:__len__ does not return non-negative integer:UNDEFINED +invalid-length-returned:59:4:59:15:NonRegression.__len__:__len__ does not return non-negative integer:UNDEFINED diff --git a/tests/functional/i/invalid/invalid_metaclass.txt b/tests/functional/i/invalid/invalid_metaclass.txt index c5ca48d760..006065705e 100644 --- a/tests/functional/i/invalid/invalid_metaclass.txt +++ b/tests/functional/i/invalid/invalid_metaclass.txt @@ -1,6 +1,6 @@ -invalid-metaclass:37:0:38:8:FirstInvalid:Invalid metaclass 'int' used:UNDEFINED -invalid-metaclass:41:0:42:8:SecondInvalid:Invalid metaclass 'InvalidAsMetaclass' used:UNDEFINED -invalid-metaclass:45:0:46:8:ThirdInvalid:Invalid metaclass '2' used:UNDEFINED -invalid-metaclass:49:0:50:8:FourthInvalid:Invalid metaclass 'Instance of invalid_metaclass.InvalidAsMetaclass' used:UNDEFINED -invalid-metaclass:61:0:62:8:Invalid:Invalid metaclass 'int' used:UNDEFINED -invalid-metaclass:65:0:66:8:InvalidSecond:Invalid metaclass '1' used:UNDEFINED +invalid-metaclass:37:0:37:18:FirstInvalid:Invalid metaclass 'int' used:UNDEFINED +invalid-metaclass:41:0:41:19:SecondInvalid:Invalid metaclass 'InvalidAsMetaclass' used:UNDEFINED +invalid-metaclass:45:0:45:18:ThirdInvalid:Invalid metaclass '2' used:UNDEFINED +invalid-metaclass:49:0:49:19:FourthInvalid:Invalid metaclass 'Instance of invalid_metaclass.InvalidAsMetaclass' used:UNDEFINED +invalid-metaclass:61:0:61:13:Invalid:Invalid metaclass 'int' used:UNDEFINED +invalid-metaclass:65:0:65:19:InvalidSecond:Invalid metaclass '1' used:UNDEFINED diff --git a/tests/functional/i/invalid/invalid_name.txt b/tests/functional/i/invalid/invalid_name.txt index bec705f981..12199a97e4 100644 --- a/tests/functional/i/invalid/invalid_name.txt +++ b/tests/functional/i/invalid/invalid_name.txt @@ -1,8 +1,8 @@ invalid-name:12:0:12:3::"Constant name ""aaa"" doesn't conform to UPPER_CASE naming style":HIGH invalid-name:16:4:16:8::"Constant name ""time"" doesn't conform to UPPER_CASE naming style":HIGH -invalid-name:32:0:33:12:a:"Function name ""a"" doesn't conform to snake_case naming style":HIGH +invalid-name:32:0:32:5:a:"Function name ""a"" doesn't conform to snake_case naming style":HIGH invalid-name:46:4:46:13::"Constant name ""Foocapfor"" doesn't conform to UPPER_CASE naming style":HIGH -invalid-name:62:0:64:16:a_very_very_very_long_function_name_WithCamelCase_to_make_it_sad:"Function name ""a_very_very_very_long_function_name_WithCamelCase_to_make_it_sad"" doesn't conform to snake_case naming style":HIGH +invalid-name:62:0:62:68:a_very_very_very_long_function_name_WithCamelCase_to_make_it_sad:"Function name ""a_very_very_very_long_function_name_WithCamelCase_to_make_it_sad"" doesn't conform to snake_case naming style":HIGH invalid-name:70:23:70:29:FooBar.__init__:"Argument name ""fooBar"" doesn't conform to snake_case naming style":HIGH invalid-name:76:8:76:14:FooBar.func1:"Argument name ""fooBar"" doesn't conform to snake_case naming style":HIGH invalid-name:96:8:96:15:FooBar.test_disable_mixed:"Argument name ""fooBar2"" doesn't conform to snake_case naming style":HIGH diff --git a/tests/functional/i/invalid/invalid_name/invalid_name_module_level.txt b/tests/functional/i/invalid/invalid_name/invalid_name_module_level.txt index 1d51c6b679..eb095f2606 100644 --- a/tests/functional/i/invalid/invalid_name/invalid_name_module_level.txt +++ b/tests/functional/i/invalid/invalid_name/invalid_name_module_level.txt @@ -1 +1 @@ -invalid-name:16:0:17:18:A:"Function name ""A"" doesn't conform to snake_case naming style":HIGH +invalid-name:16:0:16:5:A:"Function name ""A"" doesn't conform to snake_case naming style":HIGH diff --git a/tests/functional/i/invalid/invalid_name/invalid_name_multinaming_style.txt b/tests/functional/i/invalid/invalid_name/invalid_name_multinaming_style.txt index f948f48156..2c7e14ccc7 100644 --- a/tests/functional/i/invalid/invalid_name/invalid_name_multinaming_style.txt +++ b/tests/functional/i/invalid/invalid_name/invalid_name_multinaming_style.txt @@ -1 +1 @@ -invalid-name:4:0:5:59:UPPER:"Function name ""UPPER"" doesn't conform to the `down` group in the '^(?:(?P[A-Z]+)|(?P[a-z]+))$' pattern":HIGH +invalid-name:4:0:4:9:UPPER:"Function name ""UPPER"" doesn't conform to the `down` group in the '^(?:(?P[A-Z]+)|(?P[a-z]+))$' pattern":HIGH diff --git a/tests/functional/i/invalid/invalid_name/invalid_name_property.txt b/tests/functional/i/invalid/invalid_name/invalid_name_property.txt index dfbc2f4651..84d804ce04 100644 --- a/tests/functional/i/invalid/invalid_name/invalid_name_property.txt +++ b/tests/functional/i/invalid/invalid_name/invalid_name_property.txt @@ -1,3 +1,3 @@ invalid-name:9:16:9:17:custom_prop:"Argument name ""f"" doesn't conform to snake_case naming style":HIGH -invalid-name:21:4:22:12:FooClass.bar:"Attribute name ""bar"" doesn't conform to '[A-Z]+' pattern":INFERENCE -invalid-name:37:4:38:12:AnotherFooClass.foo:"Attribute name ""foo"" doesn't conform to '[A-Z]+' pattern":INFERENCE +invalid-name:21:4:21:11:FooClass.bar:"Attribute name ""bar"" doesn't conform to '[A-Z]+' pattern":INFERENCE +invalid-name:37:4:37:11:AnotherFooClass.foo:"Attribute name ""foo"" doesn't conform to '[A-Z]+' pattern":INFERENCE diff --git a/tests/functional/i/invalid/invalid_overridden_method.txt b/tests/functional/i/invalid/invalid_overridden_method.txt index 65a2d76ab2..5506109df0 100644 --- a/tests/functional/i/invalid/invalid_overridden_method.txt +++ b/tests/functional/i/invalid/invalid_overridden_method.txt @@ -1,6 +1,6 @@ -invalid-overridden-method:38:4:39:19:InvalidDerived.prop:Method 'prop' was expected to be 'property', found it instead as 'method':UNDEFINED -invalid-overridden-method:41:4:42:19:InvalidDerived.async_method:Method 'async_method' was expected to be 'async', found it instead as 'non-async':UNDEFINED -invalid-overridden-method:45:4:46:19:InvalidDerived.method_a:Method 'method_a' was expected to be 'method', found it instead as 'property':UNDEFINED -invalid-overridden-method:48:4:49:19:InvalidDerived.method_b:Method 'method_b' was expected to be 'non-async', found it instead as 'async':UNDEFINED -invalid-overridden-method:122:4:123:20:B.bar:Method 'bar' was expected to be 'property', found it instead as 'method':UNDEFINED -invalid-overridden-method:126:4:127:20:B.bar2:Method 'bar2' was expected to be 'property', found it instead as 'method':UNDEFINED +invalid-overridden-method:38:4:38:12:InvalidDerived.prop:Method 'prop' was expected to be 'property', found it instead as 'method':UNDEFINED +invalid-overridden-method:41:4:41:20:InvalidDerived.async_method:Method 'async_method' was expected to be 'async', found it instead as 'non-async':UNDEFINED +invalid-overridden-method:45:4:45:16:InvalidDerived.method_a:Method 'method_a' was expected to be 'method', found it instead as 'property':UNDEFINED +invalid-overridden-method:48:4:48:22:InvalidDerived.method_b:Method 'method_b' was expected to be 'non-async', found it instead as 'async':UNDEFINED +invalid-overridden-method:122:4:122:11:B.bar:Method 'bar' was expected to be 'property', found it instead as 'method':UNDEFINED +invalid-overridden-method:126:4:126:12:B.bar2:Method 'bar2' was expected to be 'property', found it instead as 'method':UNDEFINED diff --git a/tests/functional/i/invalid/invalid_repr_returned.txt b/tests/functional/i/invalid/invalid_repr_returned.txt index 0f557701ab..53d00abe05 100644 --- a/tests/functional/i/invalid/invalid_repr_returned.txt +++ b/tests/functional/i/invalid/invalid_repr_returned.txt @@ -1,3 +1,3 @@ -invalid-repr-returned:36:4:37:21:FirstBadRepr.__repr__:__repr__ does not return str:UNDEFINED -invalid-repr-returned:43:4:44:16:SecondBadRepr.__repr__:__repr__ does not return str:UNDEFINED -invalid-repr-returned:50:4:51:34:ThirdBadRepr.__repr__:__repr__ does not return str:UNDEFINED +invalid-repr-returned:36:4:36:16:FirstBadRepr.__repr__:__repr__ does not return str:UNDEFINED +invalid-repr-returned:43:4:43:16:SecondBadRepr.__repr__:__repr__ does not return str:UNDEFINED +invalid-repr-returned:50:4:50:16:ThirdBadRepr.__repr__:__repr__ does not return str:UNDEFINED diff --git a/tests/functional/i/invalid/invalid_str_returned.txt b/tests/functional/i/invalid/invalid_str_returned.txt index 522fdb9bff..4e7d96d555 100644 --- a/tests/functional/i/invalid/invalid_str_returned.txt +++ b/tests/functional/i/invalid/invalid_str_returned.txt @@ -1,3 +1,3 @@ -invalid-str-returned:36:4:37:21:FirstBadStr.__str__:__str__ does not return str:UNDEFINED -invalid-str-returned:43:4:44:16:SecondBadStr.__str__:__str__ does not return str:UNDEFINED -invalid-str-returned:50:4:51:33:ThirdBadStr.__str__:__str__ does not return str:UNDEFINED +invalid-str-returned:36:4:36:15:FirstBadStr.__str__:__str__ does not return str:UNDEFINED +invalid-str-returned:43:4:43:15:SecondBadStr.__str__:__str__ does not return str:UNDEFINED +invalid-str-returned:50:4:50:15:ThirdBadStr.__str__:__str__ does not return str:UNDEFINED diff --git a/tests/functional/k/keyword_arg_before_vararg.txt b/tests/functional/k/keyword_arg_before_vararg.txt index f20a319a71..87a88f1a4e 100644 --- a/tests/functional/k/keyword_arg_before_vararg.txt +++ b/tests/functional/k/keyword_arg_before_vararg.txt @@ -1,4 +1,4 @@ -keyword-arg-before-vararg:5:0:7:8:check_kwargs_before_args:Keyword argument before variable positional arguments list in the definition of check_kwargs_before_args function:UNDEFINED -keyword-arg-before-vararg:14:4:16:12:AAAA.func_in_class:Keyword argument before variable positional arguments list in the definition of func_in_class function:UNDEFINED -keyword-arg-before-vararg:19:4:21:12:AAAA.static_method_in_class:Keyword argument before variable positional arguments list in the definition of static_method_in_class function:UNDEFINED -keyword-arg-before-vararg:24:4:26:12:AAAA.class_method_in_class:Keyword argument before variable positional arguments list in the definition of class_method_in_class function:UNDEFINED +keyword-arg-before-vararg:5:0:5:28:check_kwargs_before_args:Keyword argument before variable positional arguments list in the definition of check_kwargs_before_args function:UNDEFINED +keyword-arg-before-vararg:14:4:14:21:AAAA.func_in_class:Keyword argument before variable positional arguments list in the definition of func_in_class function:UNDEFINED +keyword-arg-before-vararg:19:4:19:30:AAAA.static_method_in_class:Keyword argument before variable positional arguments list in the definition of static_method_in_class function:UNDEFINED +keyword-arg-before-vararg:24:4:24:29:AAAA.class_method_in_class:Keyword argument before variable positional arguments list in the definition of class_method_in_class function:UNDEFINED diff --git a/tests/functional/m/method_hidden.txt b/tests/functional/m/method_hidden.txt index c15486dce6..23651bd4a0 100644 --- a/tests/functional/m/method_hidden.txt +++ b/tests/functional/m/method_hidden.txt @@ -1,3 +1,3 @@ -method-hidden:18:4:20:19:Cdef.abcd:An attribute defined in functional.m.method_hidden line 12 hides this method:UNDEFINED -method-hidden:86:4:87:12:One.one:An attribute defined in functional.m.method_hidden line 84 hides this method:UNDEFINED -method-hidden:113:4:114:12:Child._protected:An attribute defined in functional.m.method_hidden line 109 hides this method:UNDEFINED +method-hidden:18:4:18:12:Cdef.abcd:An attribute defined in functional.m.method_hidden line 12 hides this method:UNDEFINED +method-hidden:86:4:86:11:One.one:An attribute defined in functional.m.method_hidden line 84 hides this method:UNDEFINED +method-hidden:113:4:113:18:Child._protected:An attribute defined in functional.m.method_hidden line 109 hides this method:UNDEFINED diff --git a/tests/functional/m/missing/missing_class_docstring.txt b/tests/functional/m/missing/missing_class_docstring.txt index 2acd9bc197..4aaa0a8216 100644 --- a/tests/functional/m/missing/missing_class_docstring.txt +++ b/tests/functional/m/missing/missing_class_docstring.txt @@ -1 +1 @@ -missing-class-docstring:5:0:6:8:Klass:Missing class docstring:HIGH +missing-class-docstring:5:0:5:11:Klass:Missing class docstring:HIGH diff --git a/tests/functional/m/missing/missing_docstring.txt b/tests/functional/m/missing/missing_docstring.txt index af030e11c4..4ed84ed06c 100644 --- a/tests/functional/m/missing/missing_docstring.txt +++ b/tests/functional/m/missing/missing_docstring.txt @@ -1,3 +1,3 @@ missing-module-docstring:1:0:None:None::Missing module docstring:HIGH -missing-class-docstring:21:0:22:8:ClassUndocumented:Missing class docstring:HIGH -missing-function-docstring:25:0:26:8:public_undocumented:Missing function or method docstring:HIGH +missing-class-docstring:21:0:21:23:ClassUndocumented:Missing class docstring:HIGH +missing-function-docstring:25:0:25:23:public_undocumented:Missing function or method docstring:HIGH diff --git a/tests/functional/m/missing/missing_docstring_new_style.txt b/tests/functional/m/missing/missing_docstring_new_style.txt index f0a456c24a..645791a65f 100644 --- a/tests/functional/m/missing/missing_docstring_new_style.txt +++ b/tests/functional/m/missing/missing_docstring_new_style.txt @@ -1,5 +1,5 @@ missing-module-docstring:1:0:None:None::Missing module docstring:HIGH -missing-class-docstring:9:0:10:8:UndocumentedClass:Missing class docstring:HIGH -missing-class-docstring:19:0:20:8:OtherClassUndocumented:Missing class docstring:HIGH -missing-function-docstring:36:0:37:8:public_undocumented:Missing function or method docstring:HIGH -missing-function-docstring:46:0:47:8:undocumented_other_function:Missing function or method docstring:HIGH +missing-class-docstring:9:0:9:23:UndocumentedClass:Missing class docstring:HIGH +missing-class-docstring:19:0:19:28:OtherClassUndocumented:Missing class docstring:HIGH +missing-function-docstring:36:0:36:23:public_undocumented:Missing function or method docstring:HIGH +missing-function-docstring:46:0:46:31:undocumented_other_function:Missing function or method docstring:HIGH diff --git a/tests/functional/m/missing/missing_function_docstring.txt b/tests/functional/m/missing/missing_function_docstring.txt index 9eea693c09..2f75b8e123 100644 --- a/tests/functional/m/missing/missing_function_docstring.txt +++ b/tests/functional/m/missing/missing_function_docstring.txt @@ -1,2 +1,2 @@ -missing-function-docstring:5:0:6:8:func:Missing function or method docstring:HIGH -missing-function-docstring:18:4:19:12:MyClass.__init__:Missing function or method docstring:INFERENCE +missing-function-docstring:5:0:5:8:func:Missing function or method docstring:HIGH +missing-function-docstring:18:4:18:16:MyClass.__init__:Missing function or method docstring:INFERENCE diff --git a/tests/functional/m/missing/missing_function_docstring_min_length.txt b/tests/functional/m/missing/missing_function_docstring_min_length.txt index cf38aceee1..477c8ee8cc 100644 --- a/tests/functional/m/missing/missing_function_docstring_min_length.txt +++ b/tests/functional/m/missing/missing_function_docstring_min_length.txt @@ -1,2 +1,2 @@ -missing-function-docstring:9:0:11:8:func_two:Missing function or method docstring:HIGH -missing-function-docstring:14:0:18:12:func_three:Missing function or method docstring:HIGH +missing-function-docstring:9:0:9:12:func_two:Missing function or method docstring:HIGH +missing-function-docstring:14:0:14:14:func_three:Missing function or method docstring:HIGH diff --git a/tests/functional/m/missing/missing_function_docstring_rgx.txt b/tests/functional/m/missing/missing_function_docstring_rgx.txt index ee085ec067..b3d5227a7e 100644 --- a/tests/functional/m/missing/missing_function_docstring_rgx.txt +++ b/tests/functional/m/missing/missing_function_docstring_rgx.txt @@ -1 +1 @@ -missing-function-docstring:10:4:11:19:Child.__eq__:Missing function or method docstring:INFERENCE +missing-function-docstring:10:4:10:14:Child.__eq__:Missing function or method docstring:INFERENCE diff --git a/tests/functional/m/missing/missing_self_argument.txt b/tests/functional/m/missing/missing_self_argument.txt index 855f83f584..14a9a98633 100644 --- a/tests/functional/m/missing/missing_self_argument.txt +++ b/tests/functional/m/missing/missing_self_argument.txt @@ -1,3 +1,3 @@ -no-method-argument:12:4:13:47:MyClass.method:Method has no argument:UNDEFINED -no-method-argument:15:4:17:20:MyClass.setup:Method has no argument:UNDEFINED +no-method-argument:12:4:12:14:MyClass.method:Method has no argument:UNDEFINED +no-method-argument:15:4:15:13:MyClass.setup:Method has no argument:UNDEFINED undefined-variable:17:8:17:12:MyClass.setup:Undefined variable 'self':UNDEFINED diff --git a/tests/functional/n/name/name_good_bad_names_regex.txt b/tests/functional/n/name/name_good_bad_names_regex.txt index 78d57990d6..66c1c99f15 100644 --- a/tests/functional/n/name/name_good_bad_names_regex.txt +++ b/tests/functional/n/name/name_good_bad_names_regex.txt @@ -1,3 +1,3 @@ disallowed-name:5:0:5:26::"Disallowed name ""explicit_bad_some_constant""":UNDEFINED invalid-name:7:0:7:28::"Constant name ""snake_case_bad_SOME_CONSTANT"" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]*|__.*__)$' pattern)":HIGH -disallowed-name:19:0:20:8:disallowed_2_snake_case:"Disallowed name ""disallowed_2_snake_case""":UNDEFINED +disallowed-name:19:0:19:27:disallowed_2_snake_case:"Disallowed name ""disallowed_2_snake_case""":UNDEFINED diff --git a/tests/functional/n/name/name_preset_snake_case.txt b/tests/functional/n/name/name_preset_snake_case.txt index 664b2db90e..339f27bd8a 100644 --- a/tests/functional/n/name/name_preset_snake_case.txt +++ b/tests/functional/n/name/name_preset_snake_case.txt @@ -1,5 +1,5 @@ invalid-name:6:0:6:13::"Constant name ""SOME_CONSTANT"" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]*|__.*__)$' pattern)":HIGH -invalid-name:13:0:22:83:MyClass:"Class name ""MyClass"" doesn't conform to snake_case naming style ('[^\\W\\dA-Z][^\\WA-Z]+$' pattern)":HIGH -invalid-name:25:0:26:8:sayHello:"Function name ""sayHello"" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]{2,}|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)":HIGH -invalid-name:29:0:31:22:FooEnum:"Class name ""FooEnum"" doesn't conform to snake_case naming style ('[^\\W\\dA-Z][^\\WA-Z]+$' pattern)":HIGH -invalid-name:34:0:35:45:Bar:"Class name ""Bar"" doesn't conform to snake_case naming style ('[^\\W\\dA-Z][^\\WA-Z]+$' pattern)":HIGH +invalid-name:13:0:13:13:MyClass:"Class name ""MyClass"" doesn't conform to snake_case naming style ('[^\\W\\dA-Z][^\\WA-Z]+$' pattern)":HIGH +invalid-name:25:0:25:12:sayHello:"Function name ""sayHello"" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]{2,}|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)":HIGH +invalid-name:29:0:29:13:FooEnum:"Class name ""FooEnum"" doesn't conform to snake_case naming style ('[^\\W\\dA-Z][^\\WA-Z]+$' pattern)":HIGH +invalid-name:34:0:34:9:Bar:"Class name ""Bar"" doesn't conform to snake_case naming style ('[^\\W\\dA-Z][^\\WA-Z]+$' pattern)":HIGH diff --git a/tests/functional/n/name/name_styles.txt b/tests/functional/n/name/name_styles.txt index a6d18a1667..ad7dad05fb 100644 --- a/tests/functional/n/name/name_styles.txt +++ b/tests/functional/n/name/name_styles.txt @@ -1,17 +1,17 @@ invalid-name:11:0:11:14::"Constant name ""bad_const_name"" doesn't conform to UPPER_CASE naming style":HIGH -invalid-name:14:0:17:24:BADFUNCTION_name:"Function name ""BADFUNCTION_name"" doesn't conform to snake_case naming style":HIGH +invalid-name:14:0:14:20:BADFUNCTION_name:"Function name ""BADFUNCTION_name"" doesn't conform to snake_case naming style":HIGH invalid-name:16:4:16:17:BADFUNCTION_name:"Variable name ""BAD_LOCAL_VAR"" doesn't conform to snake_case naming style":HIGH invalid-name:20:21:20:29:func_bad_argname:"Argument name ""NOT_GOOD"" doesn't conform to snake_case naming style":HIGH -invalid-name:30:0:31:32:bad_class_name:"Class name ""bad_class_name"" doesn't conform to PascalCase naming style":HIGH +invalid-name:30:0:30:20:bad_class_name:"Class name ""bad_class_name"" doesn't conform to PascalCase naming style":HIGH invalid-name:41:8:41:27:CorrectClassName.__init__:"Attribute name ""_Bad_AtTR_name"" doesn't conform to snake_case naming style":HIGH invalid-name:42:8:42:28:CorrectClassName.__init__:"Attribute name ""Bad_PUBLIC_name"" doesn't conform to snake_case naming style":HIGH -invalid-name:47:4:48:39:CorrectClassName.BadMethodName:"Method name ""BadMethodName"" doesn't conform to snake_case naming style":INFERENCE -invalid-name:53:4:54:41:CorrectClassName.__DunDER_IS_not_free_for_all__:"Method name ""__DunDER_IS_not_free_for_all__"" doesn't conform to snake_case naming style":INFERENCE +invalid-name:47:4:47:21:CorrectClassName.BadMethodName:"Method name ""BadMethodName"" doesn't conform to snake_case naming style":INFERENCE +invalid-name:53:4:53:38:CorrectClassName.__DunDER_IS_not_free_for_all__:"Method name ""__DunDER_IS_not_free_for_all__"" doesn't conform to snake_case naming style":INFERENCE invalid-name:83:0:83:18::"Class name ""BAD_NAME_FOR_CLASS"" doesn't conform to PascalCase naming style":HIGH invalid-name:84:0:84:23::"Class name ""NEXT_BAD_NAME_FOR_CLASS"" doesn't conform to PascalCase naming style":HIGH invalid-name:91:0:91:11::"Class name ""NOT_CORRECT"" doesn't conform to PascalCase naming style":HIGH invalid-name:97:4:97:22:test_globals:"Constant name ""AlsoCorrect"" doesn't conform to UPPER_CASE naming style":HIGH -invalid-name:110:4:112:12:FooClass.PROPERTY_NAME:"Attribute name ""PROPERTY_NAME"" doesn't conform to snake_case naming style":INFERENCE -invalid-name:116:4:118:12:FooClass.ABSTRACT_PROPERTY_NAME:"Attribute name ""ABSTRACT_PROPERTY_NAME"" doesn't conform to snake_case naming style":INFERENCE -invalid-name:121:4:123:12:FooClass.PROPERTY_NAME_SETTER:"Attribute name ""PROPERTY_NAME_SETTER"" doesn't conform to snake_case naming style":INFERENCE +invalid-name:110:4:110:21:FooClass.PROPERTY_NAME:"Attribute name ""PROPERTY_NAME"" doesn't conform to snake_case naming style":INFERENCE +invalid-name:116:4:116:30:FooClass.ABSTRACT_PROPERTY_NAME:"Attribute name ""ABSTRACT_PROPERTY_NAME"" doesn't conform to snake_case naming style":INFERENCE +invalid-name:121:4:121:28:FooClass.PROPERTY_NAME_SETTER:"Attribute name ""PROPERTY_NAME_SETTER"" doesn't conform to snake_case naming style":INFERENCE invalid-name:152:4:152:17:FooEnum:"Class constant name ""bad_enum_name"" doesn't conform to UPPER_CASE naming style":HIGH diff --git a/tests/functional/n/namePresetCamelCase.txt b/tests/functional/n/namePresetCamelCase.txt index 7b9ec86231..9461c6a536 100644 --- a/tests/functional/n/namePresetCamelCase.txt +++ b/tests/functional/n/namePresetCamelCase.txt @@ -1,3 +1,3 @@ invalid-name:3:0:3:13::"Constant name ""SOME_CONSTANT"" doesn't conform to camelCase naming style ('([^\\W\\dA-Z][^\\W_]*|__.*__)$' pattern)":HIGH -invalid-name:10:0:19:79:MyClass:"Class name ""MyClass"" doesn't conform to camelCase naming style ('[^\\W\\dA-Z][^\\W_]+$' pattern)":HIGH -invalid-name:22:0:23:8:say_hello:"Function name ""say_hello"" doesn't conform to camelCase naming style ('([^\\W\\dA-Z][^\\W_]{2,}|__[^\\W\\dA-Z_]\\w+__)$' pattern)":HIGH +invalid-name:10:0:10:13:MyClass:"Class name ""MyClass"" doesn't conform to camelCase naming style ('[^\\W\\dA-Z][^\\W_]+$' pattern)":HIGH +invalid-name:22:0:22:13:say_hello:"Function name ""say_hello"" doesn't conform to camelCase naming style ('([^\\W\\dA-Z][^\\W_]{2,}|__[^\\W\\dA-Z_]\\w+__)$' pattern)":HIGH diff --git a/tests/functional/n/no/no_self_argument.txt b/tests/functional/n/no/no_self_argument.txt index 74f6ac7b1a..45d12cc321 100644 --- a/tests/functional/n/no/no_self_argument.txt +++ b/tests/functional/n/no/no_self_argument.txt @@ -1,2 +1,2 @@ -no-self-argument:8:4:10:16:NoSelfArgument.__init__:"Method should have ""self"" as first argument":UNDEFINED -no-self-argument:12:4:14:18:NoSelfArgument.abdc:"Method should have ""self"" as first argument":UNDEFINED +no-self-argument:8:4:8:16:NoSelfArgument.__init__:"Method should have ""self"" as first argument":UNDEFINED +no-self-argument:12:4:12:12:NoSelfArgument.abdc:"Method should have ""self"" as first argument":UNDEFINED diff --git a/tests/functional/n/no/no_self_argument_py37.txt b/tests/functional/n/no/no_self_argument_py37.txt index 05cd3143d4..9f5779ab69 100644 --- a/tests/functional/n/no/no_self_argument_py37.txt +++ b/tests/functional/n/no/no_self_argument_py37.txt @@ -1 +1 @@ -no-self-argument:13:4:15:12:Toto.__class_other__:"Method should have ""self"" as first argument":UNDEFINED +no-self-argument:13:4:13:23:Toto.__class_other__:"Method should have ""self"" as first argument":UNDEFINED diff --git a/tests/functional/n/no/no_self_use.txt b/tests/functional/n/no/no_self_use.txt index a349f0bc76..4cc4774ff2 100644 --- a/tests/functional/n/no/no_self_use.txt +++ b/tests/functional/n/no/no_self_use.txt @@ -1,2 +1,2 @@ -no-self-use:16:4:18:22:Toto.function_method:Method could be a function:UNDEFINED -no-self-use:24:4:26:22:Toto.async_function_method:Method could be a function:UNDEFINED +no-self-use:16:4:16:23:Toto.function_method:Method could be a function:UNDEFINED +no-self-use:24:4:24:35:Toto.async_function_method:Method could be a function:UNDEFINED diff --git a/tests/functional/n/non/non_ascii_name.txt b/tests/functional/n/non/non_ascii_name.txt index 2cda6962ef..41f1730612 100644 --- a/tests/functional/n/non/non_ascii_name.txt +++ b/tests/functional/n/non/non_ascii_name.txt @@ -1,2 +1,2 @@ non-ascii-name:3:0:3:10::"Variable name ""áéíóú"" contains a non-ASCII character, consider renaming it.":HIGH -non-ascii-name:5:0:6:12:úóíéá:"Function name ""úóíéá"" contains a non-ASCII character, consider renaming it.":HIGH +non-ascii-name:5:0:5:9:úóíéá:"Function name ""úóíéá"" contains a non-ASCII character, consider renaming it.":HIGH diff --git a/tests/functional/n/non/non_init_parent_called.txt b/tests/functional/n/non/non_init_parent_called.txt index 97f6eb4edc..06de9a2443 100644 --- a/tests/functional/n/non/non_init_parent_called.txt +++ b/tests/functional/n/non/non_init_parent_called.txt @@ -2,5 +2,5 @@ import-error:7:0:7:18::Unable to import 'nonexistant':UNDEFINED non-parent-init-called:15:8:15:26:AAAA.__init__:__init__ method from a non direct base class 'BBBBMixin' is called:UNDEFINED no-member:23:50:23:77:CCC:Module 'functional.n.non.non_init_parent_called' has no 'BBBB' member:INFERENCE no-member:28:8:28:35:CCC.__init__:Module 'functional.n.non.non_init_parent_called' has no 'BBBB' member:INFERENCE -super-init-not-called:49:4:51:25:Super2.__init__:__init__ method from base class 'dict' is not called:INFERENCE +super-init-not-called:49:4:49:16:Super2.__init__:__init__ method from base class 'dict' is not called:INFERENCE no-member:51:8:51:23:Super2.__init__:Super of 'Super2' has no '__woohoo__' member:INFERENCE diff --git a/tests/functional/n/non/non_iterator_returned.txt b/tests/functional/n/non/non_iterator_returned.txt index a5d3337dfe..a0d3d665f6 100644 --- a/tests/functional/n/non/non_iterator_returned.txt +++ b/tests/functional/n/non/non_iterator_returned.txt @@ -1,4 +1,4 @@ -non-iterator-returned:79:4:80:17:FirstBadIterator.__iter__:__iter__ returns non-iterator:UNDEFINED -non-iterator-returned:86:4:87:19:SecondBadIterator.__iter__:__iter__ returns non-iterator:UNDEFINED -non-iterator-returned:93:4:94:34:ThirdBadIterator.__iter__:__iter__ returns non-iterator:UNDEFINED -non-iterator-returned:100:4:101:31:FourthBadIterator.__iter__:__iter__ returns non-iterator:UNDEFINED +non-iterator-returned:79:4:79:16:FirstBadIterator.__iter__:__iter__ returns non-iterator:UNDEFINED +non-iterator-returned:86:4:86:16:SecondBadIterator.__iter__:__iter__ returns non-iterator:UNDEFINED +non-iterator-returned:93:4:93:16:ThirdBadIterator.__iter__:__iter__ returns non-iterator:UNDEFINED +non-iterator-returned:100:4:100:16:FourthBadIterator.__iter__:__iter__ returns non-iterator:UNDEFINED diff --git a/tests/functional/n/non_ascii_name/non_ascii_name_function.txt b/tests/functional/n/non_ascii_name/non_ascii_name_function.txt index 949059da9e..c985a91ac2 100644 --- a/tests/functional/n/non_ascii_name/non_ascii_name_function.txt +++ b/tests/functional/n/non_ascii_name/non_ascii_name_function.txt @@ -1 +1 @@ -non-ascii-name:13:0:15:28:sayНello:"Function name ""sayНello"" contains a non-ASCII character, consider renaming it.":HIGH +non-ascii-name:13:0:13:12:sayНello:"Function name ""sayНello"" contains a non-ASCII character, consider renaming it.":HIGH diff --git a/tests/functional/n/non_ascii_name/non_ascii_name_staticmethod.txt b/tests/functional/n/non_ascii_name/non_ascii_name_staticmethod.txt index 8bc3e8ce69..5aa2dc7e96 100644 --- a/tests/functional/n/non_ascii_name/non_ascii_name_staticmethod.txt +++ b/tests/functional/n/non_ascii_name/non_ascii_name_staticmethod.txt @@ -1 +1 @@ -non-ascii-name:11:4:13:19:OkayClass.umlaut_ä:"Function name ""umlaut_ä"" contains a non-ASCII character, consider renaming it.":HIGH +non-ascii-name:11:4:11:16:OkayClass.umlaut_ä:"Function name ""umlaut_ä"" contains a non-ASCII character, consider renaming it.":HIGH diff --git a/tests/functional/n/non_ascii_name_class/non_ascii_name_class.txt b/tests/functional/n/non_ascii_name_class/non_ascii_name_class.txt index 92c4430b31..eda2ba0986 100644 --- a/tests/functional/n/non_ascii_name_class/non_ascii_name_class.txt +++ b/tests/functional/n/non_ascii_name_class/non_ascii_name_class.txt @@ -1 +1 @@ -non-ascii-name:11:0:16:19:НoldIt:"Class name ""НoldIt"" contains a non-ASCII character, consider renaming it.":HIGH +non-ascii-name:11:0:11:12:НoldIt:"Class name ""НoldIt"" contains a non-ASCII character, consider renaming it.":HIGH diff --git a/tests/functional/n/non_ascii_name_class/non_ascii_name_class_method.txt b/tests/functional/n/non_ascii_name_class/non_ascii_name_class_method.txt index 8d7606e679..43249c212f 100644 --- a/tests/functional/n/non_ascii_name_class/non_ascii_name_class_method.txt +++ b/tests/functional/n/non_ascii_name_class/non_ascii_name_class_method.txt @@ -1 +1 @@ -non-ascii-name:12:4:14:19:OkayClass.umlaut_ä:"Function name ""umlaut_ä"" contains a non-ASCII character, consider renaming it.":HIGH +non-ascii-name:12:4:12:16:OkayClass.umlaut_ä:"Function name ""umlaut_ä"" contains a non-ASCII character, consider renaming it.":HIGH diff --git a/tests/functional/n/nonlocal_and_global.txt b/tests/functional/n/nonlocal_and_global.txt index 2bc929cdb6..8cf0948f71 100644 --- a/tests/functional/n/nonlocal_and_global.txt +++ b/tests/functional/n/nonlocal_and_global.txt @@ -1 +1 @@ -nonlocal-and-global:4:0:6:18:bad:Name 'missing' is nonlocal and global:UNDEFINED +nonlocal-and-global:4:0:4:7:bad:Name 'missing' is nonlocal and global:UNDEFINED diff --git a/tests/functional/o/overridden_final_method_py38.txt b/tests/functional/o/overridden_final_method_py38.txt index 8f7af49e2a..d5c4374db9 100644 --- a/tests/functional/o/overridden_final_method_py38.txt +++ b/tests/functional/o/overridden_final_method_py38.txt @@ -1,2 +1,2 @@ -overridden-final-method:15:4:16:12:Subclass.my_method:Method 'my_method' overrides a method decorated with typing.final which is defined in class 'Base':UNDEFINED -overridden-final-method:30:4:31:12:Subclass2.my_method:Method 'my_method' overrides a method decorated with typing.final which is defined in class 'BaseConditional':UNDEFINED +overridden-final-method:15:4:15:17:Subclass.my_method:Method 'my_method' overrides a method decorated with typing.final which is defined in class 'Base':UNDEFINED +overridden-final-method:30:4:30:17:Subclass2.my_method:Method 'my_method' overrides a method decorated with typing.final which is defined in class 'BaseConditional':UNDEFINED diff --git a/tests/functional/p/property_with_parameters.txt b/tests/functional/p/property_with_parameters.txt index 326f195436..bc07bc6d19 100644 --- a/tests/functional/p/property_with_parameters.txt +++ b/tests/functional/p/property_with_parameters.txt @@ -1 +1 @@ -property-with-parameters:7:4:8:29:Cls.attribute:Cannot have defined parameters for properties:UNDEFINED +property-with-parameters:7:4:7:17:Cls.attribute:Cannot have defined parameters for properties:UNDEFINED diff --git a/tests/functional/p/protocol_classes.txt b/tests/functional/p/protocol_classes.txt index f08492c277..c9d3861467 100644 --- a/tests/functional/p/protocol_classes.txt +++ b/tests/functional/p/protocol_classes.txt @@ -1,3 +1,3 @@ -no-self-use:31:4:32:11:HasherFake.update:Method could be a function:UNDEFINED +no-self-use:31:4:31:14:HasherFake.update:Method could be a function:UNDEFINED unused-argument:31:21:31:32:HasherFake.update:Unused argument 'blob':INFERENCE -no-self-use:33:4:34:11:HasherFake.digest:Method could be a function:UNDEFINED +no-self-use:33:4:33:14:HasherFake.digest:Method could be a function:UNDEFINED diff --git a/tests/functional/r/regression/regression_4680.txt b/tests/functional/r/regression/regression_4680.txt index 19732c5d1e..072e54f394 100644 --- a/tests/functional/r/regression/regression_4680.txt +++ b/tests/functional/r/regression/regression_4680.txt @@ -1,2 +1,2 @@ import-error:3:0:3:14::Unable to import 'pkg.sub':UNDEFINED -undefined-variable:10:0:11:8:FailedTwo:Undefined variable 'ab':UNDEFINED +undefined-variable:10:0:10:15:FailedTwo:Undefined variable 'ab':UNDEFINED diff --git a/tests/functional/r/regression/regression_4723.txt b/tests/functional/r/regression/regression_4723.txt index a187311baa..74d3df5a22 100644 --- a/tests/functional/r/regression/regression_4723.txt +++ b/tests/functional/r/regression/regression_4723.txt @@ -1 +1 @@ -no-method-argument:15:4:16:12:B.play:Method has no argument:UNDEFINED +no-method-argument:15:4:15:12:B.play:Method has no argument:UNDEFINED diff --git a/tests/functional/r/return_in_init.txt b/tests/functional/r/return_in_init.txt index 3accd68341..7586c50391 100644 --- a/tests/functional/r/return_in_init.txt +++ b/tests/functional/r/return_in_init.txt @@ -1 +1 @@ -return-in-init:5:4:6:16:MyClass.__init__:Explicit return in __init__:UNDEFINED +return-in-init:5:4:5:16:MyClass.__init__:Explicit return in __init__:UNDEFINED diff --git a/tests/functional/s/signature_differs.txt b/tests/functional/s/signature_differs.txt index 4311f4ef18..8c355bc6c3 100644 --- a/tests/functional/s/signature_differs.txt +++ b/tests/functional/s/signature_differs.txt @@ -1 +1 @@ -signature-differs:21:4:22:24:Cdef.abcd:Signature differs from overridden 'abcd' method:UNDEFINED +signature-differs:21:4:21:12:Cdef.abcd:Signature differs from overridden 'abcd' method:UNDEFINED diff --git a/tests/functional/s/singledispatch_functions.txt b/tests/functional/s/singledispatch_functions.txt index 1879d136da..88973375f5 100644 --- a/tests/functional/s/singledispatch_functions.txt +++ b/tests/functional/s/singledispatch_functions.txt @@ -1,5 +1,5 @@ unused-variable:60:4:60:10:_:Unused variable 'unused':UNDEFINED unused-argument:65:24:65:27:not_single_dispatch:Unused argument 'arg':HIGH unused-argument:70:24:70:27:bad_single_dispatch:Unused argument 'arg':HIGH -function-redefined:75:0:76:13:bad_single_dispatch:function already defined line 70:UNDEFINED +function-redefined:75:0:75:23:bad_single_dispatch:function already defined line 70:UNDEFINED unused-argument:75:24:75:27:bad_single_dispatch:Unused argument 'arg':HIGH diff --git a/tests/functional/s/slots_checks.txt b/tests/functional/s/slots_checks.txt index c3069131b9..17b3195522 100644 --- a/tests/functional/s/slots_checks.txt +++ b/tests/functional/s/slots_checks.txt @@ -1,11 +1,11 @@ -invalid-slots:36:0:37:20:Bad:Invalid __slots__ object:UNDEFINED -invalid-slots:39:0:40:17:SecondBad:Invalid __slots__ object:UNDEFINED +invalid-slots:36:0:36:9:Bad:Invalid __slots__ object:UNDEFINED +invalid-slots:39:0:39:15:SecondBad:Invalid __slots__ object:UNDEFINED invalid-slots-object:43:22:43:23:ThirdBad:Invalid object '2' in __slots__, must contain only non empty strings:UNDEFINED -invalid-slots:45:0:46:29:FourthBad:Invalid __slots__ object:UNDEFINED +invalid-slots:45:0:45:15:FourthBad:Invalid __slots__ object:UNDEFINED invalid-slots-object:49:27:49:29:FifthBad:"Invalid object ""''"" in __slots__, must contain only non empty strings":UNDEFINED -single-string-used-for-slots:51:0:52:19:SixthBad:Class __slots__ should be a non-string iterable:UNDEFINED -single-string-used-for-slots:54:0:55:23:SeventhBad:Class __slots__ should be a non-string iterable:UNDEFINED -single-string-used-for-slots:57:0:58:30:EighthBad:Class __slots__ should be a non-string iterable:UNDEFINED +single-string-used-for-slots:51:0:51:14:SixthBad:Class __slots__ should be a non-string iterable:UNDEFINED +single-string-used-for-slots:54:0:54:16:SeventhBad:Class __slots__ should be a non-string iterable:UNDEFINED +single-string-used-for-slots:57:0:57:15:EighthBad:Class __slots__ should be a non-string iterable:UNDEFINED class-variable-slots-conflict:85:17:85:24:ValueInSlotConflict:Value 'first' in slots conflicts with class variable:UNDEFINED class-variable-slots-conflict:85:45:85:53:ValueInSlotConflict:Value 'fourth' in slots conflicts with class variable:UNDEFINED class-variable-slots-conflict:85:36:85:43:ValueInSlotConflict:Value 'third' in slots conflicts with class variable:UNDEFINED diff --git a/tests/functional/s/subclassed_final_class_py38.txt b/tests/functional/s/subclassed_final_class_py38.txt index d7de834b1d..9dec8110e8 100644 --- a/tests/functional/s/subclassed_final_class_py38.txt +++ b/tests/functional/s/subclassed_final_class_py38.txt @@ -1 +1 @@ -subclassed-final-class:14:0:15:8:Subclass:"Class 'Subclass' is a subclass of a class decorated with typing.final: 'Base'":UNDEFINED +subclassed-final-class:14:0:14:14:Subclass:"Class 'Subclass' is a subclass of a class decorated with typing.final: 'Base'":UNDEFINED diff --git a/tests/functional/s/super/super_init_not_called.txt b/tests/functional/s/super/super_init_not_called.txt index b6a220c69f..615b24a542 100644 --- a/tests/functional/s/super/super_init_not_called.txt +++ b/tests/functional/s/super/super_init_not_called.txt @@ -1,2 +1,2 @@ undefined-variable:18:23:18:40:UninferableChild:Undefined variable 'UninferableParent':UNDEFINED -super-init-not-called:49:4:50:11:ChildThree.__init__:__init__ method from base class 'ParentWithoutInit' is not called:INFERENCE +super-init-not-called:49:4:49:16:ChildThree.__init__:__init__ method from base class 'ParentWithoutInit' is not called:INFERENCE diff --git a/tests/functional/s/super/super_init_not_called_extensions.txt b/tests/functional/s/super/super_init_not_called_extensions.txt index 6a8ad14fe6..b80cb80be4 100644 --- a/tests/functional/s/super/super_init_not_called_extensions.txt +++ b/tests/functional/s/super/super_init_not_called_extensions.txt @@ -1 +1 @@ -super-init-not-called:21:4:22:11:TestChild.__init__:__init__ method from base class 'TestParent' is not called:INFERENCE +super-init-not-called:21:4:21:16:TestChild.__init__:__init__ method from base class 'TestParent' is not called:INFERENCE diff --git a/tests/functional/s/super/super_init_not_called_extensions_py310.txt b/tests/functional/s/super/super_init_not_called_extensions_py310.txt index 6a8ad14fe6..b80cb80be4 100644 --- a/tests/functional/s/super/super_init_not_called_extensions_py310.txt +++ b/tests/functional/s/super/super_init_not_called_extensions_py310.txt @@ -1 +1 @@ -super-init-not-called:21:4:22:11:TestChild.__init__:__init__ method from base class 'TestParent' is not called:INFERENCE +super-init-not-called:21:4:21:16:TestChild.__init__:__init__ method from base class 'TestParent' is not called:INFERENCE diff --git a/tests/functional/t/too/too_few_public_methods.txt b/tests/functional/t/too/too_few_public_methods.txt index 854a780785..24f46d08f9 100644 --- a/tests/functional/t/too/too_few_public_methods.txt +++ b/tests/functional/t/too/too_few_public_methods.txt @@ -1 +1 @@ -too-few-public-methods:8:0:17:19:Aaaa:Too few public methods (1/2):UNDEFINED +too-few-public-methods:8:0:8:10:Aaaa:Too few public methods (1/2):UNDEFINED diff --git a/tests/functional/t/too/too_few_public_methods_excluded.txt b/tests/functional/t/too/too_few_public_methods_excluded.txt index 00ceaea786..b007f9b183 100644 --- a/tests/functional/t/too/too_few_public_methods_excluded.txt +++ b/tests/functional/t/too/too_few_public_methods_excluded.txt @@ -1 +1 @@ -too-few-public-methods:4:0:5:7:Control:Too few public methods (0/10):UNDEFINED +too-few-public-methods:4:0:4:13:Control:Too few public methods (0/10):UNDEFINED diff --git a/tests/functional/t/too/too_many_ancestors.txt b/tests/functional/t/too/too_many_ancestors.txt index 204e2e5993..b4d4ecd6f5 100644 --- a/tests/functional/t/too/too_many_ancestors.txt +++ b/tests/functional/t/too/too_many_ancestors.txt @@ -1,2 +1,2 @@ -too-many-ancestors:21:0:22:8:Iiii:Too many ancestors (8/7):UNDEFINED -too-many-ancestors:24:0:25:8:Jjjj:Too many ancestors (9/7):UNDEFINED +too-many-ancestors:21:0:21:10:Iiii:Too many ancestors (8/7):UNDEFINED +too-many-ancestors:24:0:24:10:Jjjj:Too many ancestors (9/7):UNDEFINED diff --git a/tests/functional/t/too/too_many_ancestors_ignored_parents.txt b/tests/functional/t/too/too_many_ancestors_ignored_parents.txt index 6ba1a7d296..fcbafdeb05 100644 --- a/tests/functional/t/too/too_many_ancestors_ignored_parents.txt +++ b/tests/functional/t/too/too_many_ancestors_ignored_parents.txt @@ -1 +1 @@ -too-many-ancestors:39:0:40:19:A:Too many ancestors (3/2):UNDEFINED +too-many-ancestors:39:0:39:7:A:Too many ancestors (3/2):UNDEFINED diff --git a/tests/functional/t/too/too_many_arguments.txt b/tests/functional/t/too/too_many_arguments.txt index 71d1bfd395..f9749e9495 100644 --- a/tests/functional/t/too/too_many_arguments.txt +++ b/tests/functional/t/too/too_many_arguments.txt @@ -1 +1 @@ -too-many-arguments:3:0:4:63:stupid_function:Too many arguments (9/5):UNDEFINED +too-many-arguments:3:0:3:19:stupid_function:Too many arguments (9/5):UNDEFINED diff --git a/tests/functional/t/too/too_many_branches.txt b/tests/functional/t/too/too_many_branches.txt index f74a70b6aa..3d37bb6df5 100644 --- a/tests/functional/t/too/too_many_branches.txt +++ b/tests/functional/t/too/too_many_branches.txt @@ -1 +1 @@ -too-many-branches:3:0:30:12:wrong:Too many branches (13/12):UNDEFINED +too-many-branches:3:0:3:9:wrong:Too many branches (13/12):UNDEFINED diff --git a/tests/functional/t/too/too_many_instance_attributes.txt b/tests/functional/t/too/too_many_instance_attributes.txt index fd1e2e58e5..d3f1282228 100644 --- a/tests/functional/t/too/too_many_instance_attributes.txt +++ b/tests/functional/t/too/too_many_instance_attributes.txt @@ -1 +1 @@ -too-many-instance-attributes:4:0:27:26:Aaaa:Too many instance attributes (21/7):UNDEFINED +too-many-instance-attributes:4:0:4:10:Aaaa:Too many instance attributes (21/7):UNDEFINED diff --git a/tests/functional/t/too/too_many_locals.txt b/tests/functional/t/too/too_many_locals.txt index 5d2055c0c3..19272626f1 100644 --- a/tests/functional/t/too/too_many_locals.txt +++ b/tests/functional/t/too/too_many_locals.txt @@ -1,3 +1,3 @@ -too-many-locals:4:0:9:51:function:Too many local variables (16/15):UNDEFINED -too-many-locals:12:0:30:17:too_many_locals_function:Too many local variables (16/15):UNDEFINED -too-many-arguments:32:0:39:15:too_many_arguments_function:Too many arguments (6/5):UNDEFINED +too-many-locals:4:0:4:12:function:Too many local variables (16/15):UNDEFINED +too-many-locals:12:0:12:28:too_many_locals_function:Too many local variables (16/15):UNDEFINED +too-many-arguments:32:0:32:31:too_many_arguments_function:Too many arguments (6/5):UNDEFINED diff --git a/tests/functional/t/too/too_many_public_methods.txt b/tests/functional/t/too/too_many_public_methods.txt index 799640bbb1..2d5ac78ba4 100644 --- a/tests/functional/t/too/too_many_public_methods.txt +++ b/tests/functional/t/too/too_many_public_methods.txt @@ -1 +1 @@ -too-many-public-methods:3:0:72:24:Aaaa:Too many public methods (21/20):UNDEFINED +too-many-public-methods:3:0:3:10:Aaaa:Too many public methods (21/20):UNDEFINED diff --git a/tests/functional/t/too/too_many_return_statements.txt b/tests/functional/t/too/too_many_return_statements.txt index 5e4de80285..815cacf28e 100644 --- a/tests/functional/t/too/too_many_return_statements.txt +++ b/tests/functional/t/too/too_many_return_statements.txt @@ -1 +1 @@ -too-many-return-statements:3:0:24:15:stupid_function:Too many return statements (11/6):UNDEFINED +too-many-return-statements:3:0:3:19:stupid_function:Too many return statements (11/6):UNDEFINED diff --git a/tests/functional/t/too/too_many_statements.txt b/tests/functional/t/too/too_many_statements.txt index 0e74c361ba..b78c4b9a54 100644 --- a/tests/functional/t/too/too_many_statements.txt +++ b/tests/functional/t/too/too_many_statements.txt @@ -1,3 +1,3 @@ -too-many-statements:5:0:60:16:stupid_function:Too many statements (55/5):UNDEFINED -too-many-statements:62:0:125:13:long_function_with_inline_def:Too many statements (62/5):UNDEFINED -too-many-statements:128:0:133:12:exmaple_function:Too many statements (6/5):UNDEFINED +too-many-statements:5:0:5:19:stupid_function:Too many statements (55/5):UNDEFINED +too-many-statements:62:0:62:33:long_function_with_inline_def:Too many statements (62/5):UNDEFINED +too-many-statements:128:0:128:20:exmaple_function:Too many statements (6/5):UNDEFINED diff --git a/tests/functional/t/typing_use.txt b/tests/functional/t/typing_use.txt index 26d353a526..0007db21d5 100644 --- a/tests/functional/t/typing_use.txt +++ b/tests/functional/t/typing_use.txt @@ -1 +1 @@ -function-redefined:21:0:23:18:double_with_docstring:function already defined line 16:UNDEFINED +function-redefined:21:0:21:25:double_with_docstring:function already defined line 16:UNDEFINED diff --git a/tests/functional/u/undefined/undefined_variable_py30.txt b/tests/functional/u/undefined/undefined_variable_py30.txt index 364b5a1487..31c1ef9f49 100644 --- a/tests/functional/u/undefined/undefined_variable_py30.txt +++ b/tests/functional/u/undefined/undefined_variable_py30.txt @@ -4,7 +4,7 @@ undefined-variable:36:25:36:28:Undefined1.InnerScope.test1:Undefined variable 'A undefined-variable:51:28:51:32:FalsePositive342.test_bad:Undefined variable 'trop':UNDEFINED undefined-variable:54:31:54:36:FalsePositive342.test_bad1:Undefined variable 'trop1':UNDEFINED undefined-variable:57:31:57:36:FalsePositive342.test_bad2:Undefined variable 'trop2':UNDEFINED -undefined-variable:63:0:64:27:Bad:Undefined variable 'ABCMet':UNDEFINED -undefined-variable:66:0:67:35:SecondBad:Undefined variable 'ab':UNDEFINED +undefined-variable:63:0:63:9:Bad:Undefined variable 'ABCMet':UNDEFINED +undefined-variable:66:0:66:15:SecondBad:Undefined variable 'ab':UNDEFINED undefined-variable:97:53:97:61:InheritingClass:Undefined variable 'variable':UNDEFINED -undefined-variable:103:0:104:8:Inheritor:Undefined variable 'DefinedTooLate':UNDEFINED +undefined-variable:103:0:103:15:Inheritor:Undefined variable 'DefinedTooLate':UNDEFINED diff --git a/tests/functional/u/unexpected_special_method_signature.txt b/tests/functional/u/unexpected_special_method_signature.txt index 9751b6447e..dd9297f16d 100644 --- a/tests/functional/u/unexpected_special_method_signature.txt +++ b/tests/functional/u/unexpected_special_method_signature.txt @@ -1,16 +1,16 @@ -unexpected-special-method-signature:8:4:9:12:Invalid.__enter__:The special method '__enter__' expects 0 param(s), 1 was given:UNDEFINED -unexpected-special-method-signature:11:4:12:12:Invalid.__del__:The special method '__del__' expects 0 param(s), 1 was given:UNDEFINED -unexpected-special-method-signature:14:4:15:12:Invalid.__format__:The special method '__format__' expects 1 param(s), 2 were given:UNDEFINED -unexpected-special-method-signature:17:4:18:12:Invalid.__setattr__:The special method '__setattr__' expects 2 param(s), 0 was given:UNDEFINED -unexpected-special-method-signature:20:4:21:12:Invalid.__round__:The special method '__round__' expects between 0 or 1 param(s), 2 were given:UNDEFINED -unexpected-special-method-signature:23:4:24:12:Invalid.__deepcopy__:The special method '__deepcopy__' expects 1 param(s), 2 were given:UNDEFINED -no-method-argument:26:4:27:12:Invalid.__iter__:Method has no argument:UNDEFINED -unexpected-special-method-signature:30:4:31:12:Invalid.__getattr__:The special method '__getattr__' expects 1 param(s), 2 were given:UNDEFINED -unexpected-special-method-signature:37:4:38:12:FirstBadContextManager.__exit__:The special method '__exit__' expects 3 param(s), 1 was given:UNDEFINED -unexpected-special-method-signature:43:4:44:12:SecondBadContextManager.__exit__:The special method '__exit__' expects 3 param(s), 4 were given:UNDEFINED -unexpected-special-method-signature:51:4:52:12:ThirdBadContextManager.__exit__:The special method '__exit__' expects 3 param(s), 4 were given:UNDEFINED -unexpected-special-method-signature:57:4:58:12:Async.__aiter__:The special method '__aiter__' expects 0 param(s), 1 was given:UNDEFINED -unexpected-special-method-signature:59:4:60:12:Async.__anext__:The special method '__anext__' expects 0 param(s), 2 were given:UNDEFINED -unexpected-special-method-signature:61:4:62:12:Async.__await__:The special method '__await__' expects 0 param(s), 1 was given:UNDEFINED -unexpected-special-method-signature:63:4:64:12:Async.__aenter__:The special method '__aenter__' expects 0 param(s), 1 was given:UNDEFINED -unexpected-special-method-signature:65:4:66:12:Async.__aexit__:The special method '__aexit__' expects 3 param(s), 0 was given:UNDEFINED +unexpected-special-method-signature:8:4:8:17:Invalid.__enter__:The special method '__enter__' expects 0 param(s), 1 was given:UNDEFINED +unexpected-special-method-signature:11:4:11:15:Invalid.__del__:The special method '__del__' expects 0 param(s), 1 was given:UNDEFINED +unexpected-special-method-signature:14:4:14:18:Invalid.__format__:The special method '__format__' expects 1 param(s), 2 were given:UNDEFINED +unexpected-special-method-signature:17:4:17:19:Invalid.__setattr__:The special method '__setattr__' expects 2 param(s), 0 was given:UNDEFINED +unexpected-special-method-signature:20:4:20:17:Invalid.__round__:The special method '__round__' expects between 0 or 1 param(s), 2 were given:UNDEFINED +unexpected-special-method-signature:23:4:23:20:Invalid.__deepcopy__:The special method '__deepcopy__' expects 1 param(s), 2 were given:UNDEFINED +no-method-argument:26:4:26:16:Invalid.__iter__:Method has no argument:UNDEFINED +unexpected-special-method-signature:30:4:30:19:Invalid.__getattr__:The special method '__getattr__' expects 1 param(s), 2 were given:UNDEFINED +unexpected-special-method-signature:37:4:37:16:FirstBadContextManager.__exit__:The special method '__exit__' expects 3 param(s), 1 was given:UNDEFINED +unexpected-special-method-signature:43:4:43:16:SecondBadContextManager.__exit__:The special method '__exit__' expects 3 param(s), 4 were given:UNDEFINED +unexpected-special-method-signature:51:4:51:16:ThirdBadContextManager.__exit__:The special method '__exit__' expects 3 param(s), 4 were given:UNDEFINED +unexpected-special-method-signature:57:4:57:17:Async.__aiter__:The special method '__aiter__' expects 0 param(s), 1 was given:UNDEFINED +unexpected-special-method-signature:59:4:59:17:Async.__anext__:The special method '__anext__' expects 0 param(s), 2 were given:UNDEFINED +unexpected-special-method-signature:61:4:61:17:Async.__await__:The special method '__await__' expects 0 param(s), 1 was given:UNDEFINED +unexpected-special-method-signature:63:4:63:18:Async.__aenter__:The special method '__aenter__' expects 0 param(s), 1 was given:UNDEFINED +unexpected-special-method-signature:65:4:65:17:Async.__aexit__:The special method '__aexit__' expects 3 param(s), 0 was given:UNDEFINED diff --git a/tests/functional/u/unused/unused_private_member.txt b/tests/functional/u/unused/unused_private_member.txt index 99f34b7f53..71c95c9764 100644 --- a/tests/functional/u/unused/unused_private_member.txt +++ b/tests/functional/u/unused/unused_private_member.txt @@ -1,20 +1,20 @@ -unused-private-member:4:4:5:12:AnotherClass.__test:Unused private member `AnotherClass.__test(self)`:UNDEFINED +unused-private-member:4:4:4:14:AnotherClass.__test:Unused private member `AnotherClass.__test(self)`:UNDEFINED unused-private-member:8:4:8:15:HasUnusedInClass:Unused private member `HasUnusedInClass.__my_secret`:UNDEFINED -unused-private-member:12:4:13:35:HasUnusedInClass.__private_class_method_unused:Unused private member `HasUnusedInClass.__private_class_method_unused(cls)`:UNDEFINED -unused-private-member:20:4:21:12:HasUnusedInClass.__private_static_method_unused:Unused private member `HasUnusedInClass.__private_static_method_unused()`:UNDEFINED +unused-private-member:12:4:12:37:HasUnusedInClass.__private_class_method_unused:Unused private member `HasUnusedInClass.__private_class_method_unused(cls)`:UNDEFINED +unused-private-member:20:4:20:38:HasUnusedInClass.__private_static_method_unused:Unused private member `HasUnusedInClass.__private_static_method_unused()`:UNDEFINED unused-private-member:28:8:28:30:HasUnusedInClass.__init__:Unused private member `HasUnusedInClass.__instance_secret`:UNDEFINED -unused-private-member:34:4:38:13:HasUnusedInClass.__test:Unused private member `HasUnusedInClass.__test(self, x, y, z)`:UNDEFINED -unused-private-member:55:4:56:31:HasUnusedInClass.__test_recursive:Unused private member `HasUnusedInClass.__test_recursive(self)`:UNDEFINED +unused-private-member:34:4:34:14:HasUnusedInClass.__test:Unused private member `HasUnusedInClass.__test(self, x, y, z)`:UNDEFINED +unused-private-member:55:4:55:24:HasUnusedInClass.__test_recursive:Unused private member `HasUnusedInClass.__test_recursive(self)`:UNDEFINED unused-private-member:133:8:133:21:FalsePositive4657.__init__:Unused private member `FalsePositive4657.__attr_c`:UNDEFINED undefined-variable:138:15:138:18:FalsePositive4657.attr_c:Undefined variable 'cls':UNDEFINED unused-private-member:157:8:157:26:FalsePositive4668.__new__:Unused private member `FalsePositive4668.__unused`:UNDEFINED -unused-private-member:181:8:182:27:FalsePositive4673.do_thing.__true_positive:Unused private member `FalsePositive4673.do_thing.__true_positive(in_thing)`:UNDEFINED -unused-private-member:201:8:202:16:FalsePositive4673.complicated_example.__inner_4:Unused private member `FalsePositive4673.complicated_example.__inner_4()`:UNDEFINED +unused-private-member:181:8:181:27:FalsePositive4673.do_thing.__true_positive:Unused private member `FalsePositive4673.do_thing.__true_positive(in_thing)`:UNDEFINED +unused-private-member:201:8:201:21:FalsePositive4673.complicated_example.__inner_4:Unused private member `FalsePositive4673.complicated_example.__inner_4()`:UNDEFINED unused-private-member:212:8:212:23:Crash4755Context.__init__:Unused private member `Crash4755Context.__messages`:UNDEFINED unused-private-member:229:4:229:24:FalsePositive4681:Unused private member `FalsePositive4681.__should_cause_error`:UNDEFINED unused-private-member:239:12:239:50:FalsePositive4681.__init__:Unused private member `FalsePositive4681.__should_cause_error`:UNDEFINED unused-private-member:243:12:243:50:FalsePositive4681.__init__:Unused private member `FalsePositive4681.__should_cause_error`:UNDEFINED -unused-private-member:274:4:275:26:FalsePositive4849.__unused_private_method:Unused private member `FalsePositive4849.__unused_private_method()`:UNDEFINED -unused-private-member:291:4:294:44:Pony.__init_defaults:Unused private member `Pony.__init_defaults(self)`:UNDEFINED -unused-private-member:296:4:298:20:Pony.__get_fur_color:Unused private member `Pony.__get_fur_color(self)`:UNDEFINED +unused-private-member:274:4:274:31:FalsePositive4849.__unused_private_method:Unused private member `FalsePositive4849.__unused_private_method()`:UNDEFINED +unused-private-member:291:4:291:23:Pony.__init_defaults:Unused private member `Pony.__init_defaults(self)`:UNDEFINED +unused-private-member:296:4:296:23:Pony.__get_fur_color:Unused private member `Pony.__get_fur_color(self)`:UNDEFINED unused-private-member:318:8:318:15:TypeSelfCallInMethod.b:Unused private member `TypeSelfCallInMethod.__a`:UNDEFINED diff --git a/tests/functional/u/unused/unused_variable_py38.txt b/tests/functional/u/unused/unused_variable_py38.txt index 62a9e8b6ce..c870838e6e 100644 --- a/tests/functional/u/unused/unused_variable_py38.txt +++ b/tests/functional/u/unused/unused_variable_py38.txt @@ -1,6 +1,6 @@ -unused-variable:4:0:8:16:typed_assignment_in_function_default:Unused variable 'typed_assignment_in_function_default':UNDEFINED +unused-variable:4:0:4:40:typed_assignment_in_function_default:Unused variable 'typed_assignment_in_function_default':UNDEFINED unused-variable:5:18:5:31::Unused variable 'typed_default':UNDEFINED -unused-variable:11:0:15:16:assignment_in_function_default:Unused variable 'assignment_in_function_default':UNDEFINED +unused-variable:11:0:11:34:assignment_in_function_default:Unused variable 'assignment_in_function_default':UNDEFINED unused-variable:12:11:12:18::Unused variable 'default':UNDEFINED -unused-variable:18:0:23:16:assignment_used_in_function_scope:Unused variable 'assignment_used_in_function_scope':UNDEFINED -unused-variable:26:0:30:16:assignment_used_in_global_scope:Unused variable 'assignment_used_in_global_scope':UNDEFINED +unused-variable:18:0:18:37:assignment_used_in_function_scope:Unused variable 'assignment_used_in_function_scope':UNDEFINED +unused-variable:26:0:26:35:assignment_used_in_global_scope:Unused variable 'assignment_used_in_global_scope':UNDEFINED diff --git a/tests/functional/u/use/use_symbolic_message_instead.txt b/tests/functional/u/use/use_symbolic_message_instead.txt index bbc1f24bd4..5a01b7cdbe 100644 --- a/tests/functional/u/use/use_symbolic_message_instead.txt +++ b/tests/functional/u/use/use_symbolic_message_instead.txt @@ -3,12 +3,12 @@ use-symbolic-message-instead:1:0:None:None::"'C0111' is cryptic: use '# pylint: use-symbolic-message-instead:1:0:None:None::"'R0903' is cryptic: use '# pylint: disable=too-few-public-methods' instead":UNDEFINED use-symbolic-message-instead:2:0:None:None::"'c0111' is cryptic: use '# pylint: enable=missing-docstring' instead":UNDEFINED use-symbolic-message-instead:2:0:None:None::"'w0223' is cryptic: use '# pylint: enable=abstract-method' instead":UNDEFINED -missing-function-docstring:4:0:5:22:my_function:Missing function or method docstring:HIGH +missing-function-docstring:4:0:4:15:my_function:Missing function or method docstring:HIGH use-symbolic-message-instead:7:0:None:None::"'C0111' is cryptic: use '# pylint: disable=missing-docstring' instead":UNDEFINED use-symbolic-message-instead:8:0:None:None::"'R0903' is cryptic: use '# pylint: enable=too-few-public-methods' instead":UNDEFINED use-symbolic-message-instead:9:0:None:None::"'R0903' is cryptic: use '# pylint: disable=too-few-public-methods' instead":UNDEFINED use-symbolic-message-instead:12:0:None:None::"'C0102' is cryptic: use '# pylint: disable=blacklisted-name' instead":UNDEFINED use-symbolic-message-instead:16:0:None:None::"'C0102' is cryptic: use '# pylint: disable=blacklisted-name' instead":UNDEFINED use-symbolic-message-instead:16:0:None:None::"'R1711' is cryptic: use '# pylint: disable=useless-return' instead":UNDEFINED -missing-function-docstring:20:0:21:8:test_enabled_by_id_msg:Missing function or method docstring:HIGH +missing-function-docstring:20:0:20:26:test_enabled_by_id_msg:Missing function or method docstring:HIGH use-symbolic-message-instead:20:0:None:None::"'C0111' is cryptic: use '# pylint: enable=missing-docstring' instead":UNDEFINED diff --git a/tests/functional/u/useless/useless_object_inheritance.txt b/tests/functional/u/useless/useless_object_inheritance.txt index fe3bd2e4a8..67f48417f9 100644 --- a/tests/functional/u/useless/useless_object_inheritance.txt +++ b/tests/functional/u/useless/useless_object_inheritance.txt @@ -1,4 +1,4 @@ -useless-object-inheritance:8:0:9:8:A:Class 'A' inherits from object, can be safely removed from bases in python3:UNDEFINED -useless-object-inheritance:14:0:15:8:C:Class 'C' inherits from object, can be safely removed from bases in python3:UNDEFINED -useless-object-inheritance:17:0:18:8:D:Class 'D' inherits from object, can be safely removed from bases in python3:UNDEFINED -useless-object-inheritance:20:0:21:8:E:Class 'E' inherits from object, can be safely removed from bases in python3:UNDEFINED +useless-object-inheritance:8:0:8:7:A:Class 'A' inherits from object, can be safely removed from bases in python3:UNDEFINED +useless-object-inheritance:14:0:14:7:C:Class 'C' inherits from object, can be safely removed from bases in python3:UNDEFINED +useless-object-inheritance:17:0:17:7:D:Class 'D' inherits from object, can be safely removed from bases in python3:UNDEFINED +useless-object-inheritance:20:0:20:7:E:Class 'E' inherits from object, can be safely removed from bases in python3:UNDEFINED diff --git a/tests/functional/u/useless/useless_return.txt b/tests/functional/u/useless/useless_return.txt index b64b76be4d..035e951ab2 100644 --- a/tests/functional/u/useless/useless_return.txt +++ b/tests/functional/u/useless/useless_return.txt @@ -1,2 +1,2 @@ -useless-return:4:0:6:10:myfunc:Useless return at end of function or method:UNDEFINED -useless-return:9:4:11:19:SomeClass.mymethod:Useless return at end of function or method:UNDEFINED +useless-return:4:0:4:10:myfunc:Useless return at end of function or method:UNDEFINED +useless-return:9:4:9:16:SomeClass.mymethod:Useless return at end of function or method:UNDEFINED diff --git a/tests/functional/u/useless/useless_super_delegation.txt b/tests/functional/u/useless/useless_super_delegation.txt index 43f52674a9..b69febe691 100644 --- a/tests/functional/u/useless/useless_super_delegation.txt +++ b/tests/functional/u/useless/useless_super_delegation.txt @@ -1,19 +1,19 @@ -useless-super-delegation:214:4:215:60:UselessSuper.equivalent_params:Useless super delegation in method 'equivalent_params':UNDEFINED -useless-super-delegation:217:4:218:67:UselessSuper.equivalent_params_1:Useless super delegation in method 'equivalent_params_1':UNDEFINED -useless-super-delegation:220:4:221:67:UselessSuper.equivalent_params_2:Useless super delegation in method 'equivalent_params_2':UNDEFINED -useless-super-delegation:223:4:224:77:UselessSuper.equivalent_params_3:Useless super delegation in method 'equivalent_params_3':UNDEFINED -useless-super-delegation:226:4:227:60:UselessSuper.equivalent_params_4:Useless super delegation in method 'equivalent_params_4':UNDEFINED -useless-super-delegation:229:4:230:67:UselessSuper.equivalent_params_5:Useless super delegation in method 'equivalent_params_5':UNDEFINED -useless-super-delegation:232:4:233:84:UselessSuper.equivalent_params_6:Useless super delegation in method 'equivalent_params_6':UNDEFINED -useless-super-delegation:235:4:237:82:UselessSuper.with_default_argument:Useless super delegation in method 'with_default_argument':UNDEFINED -useless-super-delegation:239:4:240:80:UselessSuper.without_default_argument:Useless super delegation in method 'without_default_argument':UNDEFINED -useless-super-delegation:242:4:244:80:UselessSuper.with_default_argument_none:Useless super delegation in method 'with_default_argument_none':UNDEFINED -useless-super-delegation:246:4:247:79:UselessSuper.with_default_argument_int:Useless super delegation in method 'with_default_argument_int':UNDEFINED -useless-super-delegation:249:4:250:81:UselessSuper.with_default_argument_tuple:Useless super delegation in method 'with_default_argument_tuple':UNDEFINED -useless-super-delegation:252:4:253:80:UselessSuper.with_default_argument_dict:Useless super delegation in method 'with_default_argument_dict':UNDEFINED -useless-super-delegation:255:4:256:79:UselessSuper.with_default_argument_var:Useless super delegation in method 'with_default_argument_var':UNDEFINED -useless-super-delegation:258:4:259:44:UselessSuper.__init__:Useless super delegation in method '__init__':UNDEFINED -useless-super-delegation:261:4:262:70:UselessSuper.with_default_arg:Useless super delegation in method 'with_default_arg':UNDEFINED -useless-super-delegation:264:4:265:74:UselessSuper.with_default_arg_bis:Useless super delegation in method 'with_default_arg_bis':UNDEFINED -useless-super-delegation:267:4:268:74:UselessSuper.with_default_arg_ter:Useless super delegation in method 'with_default_arg_ter':UNDEFINED -useless-super-delegation:270:4:271:75:UselessSuper.with_default_arg_quad:Useless super delegation in method 'with_default_arg_quad':UNDEFINED +useless-super-delegation:214:4:214:25:UselessSuper.equivalent_params:Useless super delegation in method 'equivalent_params':UNDEFINED +useless-super-delegation:217:4:217:27:UselessSuper.equivalent_params_1:Useless super delegation in method 'equivalent_params_1':UNDEFINED +useless-super-delegation:220:4:220:27:UselessSuper.equivalent_params_2:Useless super delegation in method 'equivalent_params_2':UNDEFINED +useless-super-delegation:223:4:223:27:UselessSuper.equivalent_params_3:Useless super delegation in method 'equivalent_params_3':UNDEFINED +useless-super-delegation:226:4:226:27:UselessSuper.equivalent_params_4:Useless super delegation in method 'equivalent_params_4':UNDEFINED +useless-super-delegation:229:4:229:27:UselessSuper.equivalent_params_5:Useless super delegation in method 'equivalent_params_5':UNDEFINED +useless-super-delegation:232:4:232:27:UselessSuper.equivalent_params_6:Useless super delegation in method 'equivalent_params_6':UNDEFINED +useless-super-delegation:235:4:235:29:UselessSuper.with_default_argument:Useless super delegation in method 'with_default_argument':UNDEFINED +useless-super-delegation:239:4:239:32:UselessSuper.without_default_argument:Useless super delegation in method 'without_default_argument':UNDEFINED +useless-super-delegation:242:4:242:34:UselessSuper.with_default_argument_none:Useless super delegation in method 'with_default_argument_none':UNDEFINED +useless-super-delegation:246:4:246:33:UselessSuper.with_default_argument_int:Useless super delegation in method 'with_default_argument_int':UNDEFINED +useless-super-delegation:249:4:249:35:UselessSuper.with_default_argument_tuple:Useless super delegation in method 'with_default_argument_tuple':UNDEFINED +useless-super-delegation:252:4:252:34:UselessSuper.with_default_argument_dict:Useless super delegation in method 'with_default_argument_dict':UNDEFINED +useless-super-delegation:255:4:255:33:UselessSuper.with_default_argument_var:Useless super delegation in method 'with_default_argument_var':UNDEFINED +useless-super-delegation:258:4:258:16:UselessSuper.__init__:Useless super delegation in method '__init__':UNDEFINED +useless-super-delegation:261:4:261:24:UselessSuper.with_default_arg:Useless super delegation in method 'with_default_arg':UNDEFINED +useless-super-delegation:264:4:264:28:UselessSuper.with_default_arg_bis:Useless super delegation in method 'with_default_arg_bis':UNDEFINED +useless-super-delegation:267:4:267:28:UselessSuper.with_default_arg_ter:Useless super delegation in method 'with_default_arg_ter':UNDEFINED +useless-super-delegation:270:4:270:29:UselessSuper.with_default_arg_quad:Useless super delegation in method 'with_default_arg_quad':UNDEFINED diff --git a/tests/functional/u/useless/useless_super_delegation_py3.txt b/tests/functional/u/useless/useless_super_delegation_py3.txt index bad62c1bda..2497504a06 100644 --- a/tests/functional/u/useless/useless_super_delegation_py3.txt +++ b/tests/functional/u/useless/useless_super_delegation_py3.txt @@ -1,2 +1,2 @@ -useless-super-delegation:21:4:22:36:UselessSuper.useless:Useless super delegation in method 'useless':UNDEFINED -useless-super-delegation:34:4:35:31:Ham.__init__:Useless super delegation in method '__init__':UNDEFINED +useless-super-delegation:21:4:21:15:UselessSuper.useless:Useless super delegation in method 'useless':UNDEFINED +useless-super-delegation:34:4:34:16:Ham.__init__:Useless super delegation in method '__init__':UNDEFINED diff --git a/tests/functional/u/useless/useless_super_delegation_py35.txt b/tests/functional/u/useless/useless_super_delegation_py35.txt index fdcf74142e..abcf6c5fb4 100644 --- a/tests/functional/u/useless/useless_super_delegation_py35.txt +++ b/tests/functional/u/useless/useless_super_delegation_py35.txt @@ -1 +1 @@ -useless-super-delegation:11:4:12:62:UselessSuper.useless:Useless super delegation in method 'useless':UNDEFINED +useless-super-delegation:11:4:11:15:UselessSuper.useless:Useless super delegation in method 'useless':UNDEFINED diff --git a/tests/functional/u/useless/useless_super_delegation_py38.txt b/tests/functional/u/useless/useless_super_delegation_py38.txt index da08eb3a75..1c4631c938 100644 --- a/tests/functional/u/useless/useless_super_delegation_py38.txt +++ b/tests/functional/u/useless/useless_super_delegation_py38.txt @@ -1 +1 @@ -useless-super-delegation:16:4:17:39:Ham.__init__:Useless super delegation in method '__init__':UNDEFINED +useless-super-delegation:16:4:16:16:Ham.__init__:Useless super delegation in method '__init__':UNDEFINED From 29480d4e119b27ab419c5d53e8a955220de61e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sat, 12 Mar 2022 20:51:24 +0100 Subject: [PATCH 038/473] Fix end position in unittests (#5904) * Fix end position in unittests * Add pragma's for warnings --- pylint/testutils/checker_test_case.py | 4 ++-- tests/checkers/unittest_base.py | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pylint/testutils/checker_test_case.py b/pylint/testutils/checker_test_case.py index f8324b9a9a..739db50810 100644 --- a/pylint/testutils/checker_test_case.py +++ b/pylint/testutils/checker_test_case.py @@ -73,14 +73,14 @@ def assertAddsMessages( # pylint: disable=fixme # TODO: Require end_line and end_col_offset and remove the warning if not expected_msg.end_line == gotten_msg.end_line: - warnings.warn( + warnings.warn( # pragma: no cover f"The end_line attribute of {gotten_msg} does not match " f"the expected value in {expected_msg}. In pylint 3.0 correct end_line " "attributes will be required for MessageTest.", DeprecationWarning, ) if not expected_msg.end_col_offset == gotten_msg.end_col_offset: - warnings.warn( + warnings.warn( # pragma: no cover f"The end_col_offset attribute of {gotten_msg} does not match " f"the expected value in {expected_msg}. In pylint 3.0 correct end_col_offset " "attributes will be required for MessageTest.", diff --git a/tests/checkers/unittest_base.py b/tests/checkers/unittest_base.py index fe46efcb4e..c1c76610ca 100644 --- a/tests/checkers/unittest_base.py +++ b/tests/checkers/unittest_base.py @@ -66,8 +66,8 @@ class CLASSC(object): #@ confidence=HIGH, line=2, col_offset=0, - end_line=3, - end_col_offset=8, + end_line=2, + end_col_offset=12, ) with self.assertAddsMessages(message): cls = None @@ -100,8 +100,8 @@ class CLASSC(object): #@ confidence=HIGH, line=2, col_offset=0, - end_line=3, - end_col_offset=8, + end_line=2, + end_col_offset=13, ), MessageTest( "invalid-name", @@ -114,8 +114,8 @@ class CLASSC(object): #@ confidence=HIGH, line=6, col_offset=0, - end_line=7, - end_col_offset=8, + end_line=6, + end_col_offset=12, ), ] with self.assertAddsMessages(*messages): @@ -153,7 +153,7 @@ def FUNC(): #@ confidence=HIGH, line=6, col_offset=0, - end_line=7, + end_line=6, end_col_offset=8, ) with self.assertAddsMessages(message): @@ -190,8 +190,8 @@ def UPPER(): #@ confidence=HIGH, line=8, col_offset=0, - end_line=9, - end_col_offset=8, + end_line=8, + end_col_offset=9, ) with self.assertAddsMessages(message): func = None From 5756fae16b336e8828f6d220c532dc48ddd04183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sat, 12 Mar 2022 21:31:37 +0100 Subject: [PATCH 039/473] Fix disabling of ``ungrouped-imports`` (#5903) Co-authored-by: Pierre Sassoulas --- ChangeLog | 5 +++++ doc/whatsnew/2.13.rst | 5 +++++ pylint/checkers/imports.py | 8 ++++---- .../functional/u/ungrouped_imports_suppression.py | 15 +++++++++++++++ .../u/ungrouped_imports_suppression.txt | 2 ++ 5 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 tests/functional/u/ungrouped_imports_suppression.py create mode 100644 tests/functional/u/ungrouped_imports_suppression.txt diff --git a/ChangeLog b/ChangeLog index 709c895854..528da76833 100644 --- a/ChangeLog +++ b/ChangeLog @@ -76,6 +76,11 @@ Release date: TBA Closes #5025 +* Fixed an issue where ``ungrouped-imports`` could not be disabled without raising + ``useless-suppression``. + + Ref #2366 + * Added several checkers to deal with unicode security issues (see `Trojan Sources `_ and `PEP 672 `_ for details) that also diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 2314725da5..3c3f088eac 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -216,6 +216,11 @@ Other Changes Closes #5713 +* Fixed an issue where ``ungrouped-imports`` could not be disabled without raising + ``useless-suppression``. + + Ref #2366 + * Fixed a crash on ``__init__`` nodes when the attribute was previously uninferable due to a cache limit size. This limit can be hit when the inheritance pattern of a class (and therefore of the ``__init__`` attribute) is very large. diff --git a/pylint/checkers/imports.py b/pylint/checkers/imports.py index bcad7692ed..689573b211 100644 --- a/pylint/checkers/imports.py +++ b/pylint/checkers/imports.py @@ -537,10 +537,6 @@ def leave_module(self, node: nodes.Module) -> None: met_from: Set[str] = set() # set for 'from x import y' style current_package = None for import_node, import_name in std_imports + ext_imports + loc_imports: - if not self.linter.is_message_enabled( - "ungrouped-imports", import_node.fromlineno - ): - continue met = met_from if isinstance(import_node, nodes.ImportFrom) else met_import package, _, _ = import_name.partition(".") if ( @@ -551,6 +547,10 @@ def leave_module(self, node: nodes.Module) -> None: ): self.add_message("ungrouped-imports", node=import_node, args=package) current_package = package + if not self.linter.is_message_enabled( + "ungrouped-imports", import_node.fromlineno + ): + continue met.add(package) self._imports_stack = [] diff --git a/tests/functional/u/ungrouped_imports_suppression.py b/tests/functional/u/ungrouped_imports_suppression.py new file mode 100644 index 0000000000..9b482b355a --- /dev/null +++ b/tests/functional/u/ungrouped_imports_suppression.py @@ -0,0 +1,15 @@ +"""Check ungrouped import and interaction with useless-suppression. + +Previously disabling ungrouped-imports would always lead to useless-suppression. +""" +# pylint: enable=useless-suppression +# pylint: disable=unused-import, wrong-import-order + +import logging.config +import os.path +from astroid import are_exclusive # pylint: disable=ungrouped-imports # [useless-suppression] +import logging.handlers # pylint: disable=ungrouped-imports # This should not raise useless-suppression +try: + import os # [ungrouped-imports] +except ImportError: + pass diff --git a/tests/functional/u/ungrouped_imports_suppression.txt b/tests/functional/u/ungrouped_imports_suppression.txt new file mode 100644 index 0000000000..3ba8b0ea0f --- /dev/null +++ b/tests/functional/u/ungrouped_imports_suppression.txt @@ -0,0 +1,2 @@ +useless-suppression:10:0:None:None::Useless suppression of 'ungrouped-imports':UNDEFINED +ungrouped-imports:13:4:13:13::Imports from package os are not grouped:UNDEFINED From 9d46885ab0dba902ce6a0aecfbec90bcbef1bee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sat, 12 Mar 2022 22:11:55 +0100 Subject: [PATCH 040/473] Use ``functools.cached_property`` on 3.8+ (#5907) --- pylint/checkers/classes/class_checker.py | 13 +++++++++--- pylint/checkers/design_analysis.py | 9 +++++++- .../refactoring/refactoring_checker.py | 21 +++++++++++++++++-- pylint/checkers/typecheck.py | 11 ++++++++-- pylint/checkers/variables.py | 14 ++++++++++--- 5 files changed, 57 insertions(+), 11 deletions(-) diff --git a/pylint/checkers/classes/class_checker.py b/pylint/checkers/classes/class_checker.py index 8dbb58fd4a..dd9a0b31ce 100644 --- a/pylint/checkers/classes/class_checker.py +++ b/pylint/checkers/classes/class_checker.py @@ -51,8 +51,9 @@ """Classes checker for Python code.""" import collections +import sys from itertools import chain, zip_longest -from typing import Dict, List, Pattern, Set +from typing import TYPE_CHECKING, Dict, List, Pattern, Set import astroid from astroid import bases, nodes @@ -84,6 +85,12 @@ from pylint.interfaces import INFERENCE, IAstroidChecker from pylint.utils import get_global_option +if sys.version_info >= (3, 8) or TYPE_CHECKING: + from functools import cached_property +else: + # pylint: disable-next=ungrouped-imports + from astroid.decorators import cachedproperty as cached_property + INVALID_BASE_CLASSES = {"bool", "range", "slice", "memoryview"} BUILTIN_DECORATORS = {"builtins.property", "builtins.classmethod"} ASTROID_TYPE_COMPARATORS = { @@ -778,11 +785,11 @@ def open(self) -> None: py_version = get_global_option(self, "py-version") self._py38_plus = py_version >= (3, 8) - @astroid.decorators.cachedproperty + @cached_property def _dummy_rgx(self): return get_global_option(self, "dummy-variables-rgx", default=None) - @astroid.decorators.cachedproperty + @cached_property def _ignore_mixin(self): return get_global_option(self, "ignore-mixin-members", default=True) diff --git a/pylint/checkers/design_analysis.py b/pylint/checkers/design_analysis.py index 94569d4ea8..37cd16c571 100644 --- a/pylint/checkers/design_analysis.py +++ b/pylint/checkers/design_analysis.py @@ -31,6 +31,7 @@ """Check for signs of poor design.""" import re +import sys from collections import defaultdict from typing import TYPE_CHECKING, FrozenSet, Iterator, List, Set, cast @@ -42,6 +43,12 @@ from pylint.checkers.utils import check_messages from pylint.interfaces import IAstroidChecker +if sys.version_info >= (3, 8) or TYPE_CHECKING: + from functools import cached_property +else: + # pylint: disable-next=ungrouped-imports + from astroid.decorators import cachedproperty as cached_property + if TYPE_CHECKING: from pylint.lint import PyLinter @@ -441,7 +448,7 @@ def _inc_all_stmts(self, amount): for i, _ in enumerate(self._stmts): self._stmts[i] += amount - @astroid.decorators.cachedproperty + @cached_property def _ignored_argument_names(self): return utils.get_global_option(self, "ignored-argument-names", default=None) diff --git a/pylint/checkers/refactoring/refactoring_checker.py b/pylint/checkers/refactoring/refactoring_checker.py index b727f1b632..07fcff802c 100644 --- a/pylint/checkers/refactoring/refactoring_checker.py +++ b/pylint/checkers/refactoring/refactoring_checker.py @@ -4,9 +4,19 @@ import collections import copy import itertools +import sys import tokenize from functools import reduce -from typing import Dict, Iterator, List, NamedTuple, Optional, Tuple, Union +from typing import ( + TYPE_CHECKING, + Dict, + Iterator, + List, + NamedTuple, + Optional, + Tuple, + Union, +) import astroid from astroid import nodes @@ -17,6 +27,13 @@ from pylint.checkers import utils from pylint.checkers.utils import node_frame_class +if sys.version_info >= (3, 8) or TYPE_CHECKING: + # pylint: disable-next=ungrouped-imports + from functools import cached_property +else: + # pylint: disable-next=ungrouped-imports + from astroid.decorators import cachedproperty as cached_property + KNOWN_INFINITE_ITERATORS = {"itertools.count"} BUILTIN_EXIT_FUNCS = frozenset(("quit", "exit")) CALLS_THAT_COULD_BE_REPLACED_BY_WITH = frozenset( @@ -475,7 +492,7 @@ def open(self): # do this in open since config not fully initialized in __init__ self._never_returning_functions = set(self.config.never_returning_functions) - @astroid.decorators.cachedproperty + @cached_property def _dummy_rgx(self): return lint_utils.get_global_option(self, "dummy-variables-rgx", default=None) diff --git a/pylint/checkers/typecheck.py b/pylint/checkers/typecheck.py index b28815e704..78e92becb8 100644 --- a/pylint/checkers/typecheck.py +++ b/pylint/checkers/typecheck.py @@ -109,6 +109,13 @@ from pylint.interfaces import INFERENCE, IAstroidChecker from pylint.utils import get_global_option +if sys.version_info >= (3, 8) or TYPE_CHECKING: + # pylint: disable-next=ungrouped-imports + from functools import cached_property +else: + # pylint: disable-next=ungrouped-imports + from astroid.decorators import cachedproperty as cached_property + if TYPE_CHECKING: from pylint.lint import PyLinter @@ -937,11 +944,11 @@ def open(self) -> None: self._py310_plus = py_version >= (3, 10) self._mixin_class_rgx = get_global_option(self, "mixin-class-rgx") - @astroid.decorators.cachedproperty + @cached_property def _suggestion_mode(self): return get_global_option(self, "suggestion-mode", default=True) - @astroid.decorators.cachedproperty + @cached_property def _compiled_generated_members(self) -> Tuple[Pattern, ...]: # do this lazily since config not fully initialized in __init__ # generated_members may contain regular expressions diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index 1781866aa2..c03d9b667c 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -60,6 +60,7 @@ import itertools import os import re +import sys from enum import Enum from functools import lru_cache from typing import ( @@ -90,6 +91,13 @@ ) from pylint.utils import get_global_option +if sys.version_info >= (3, 8) or TYPE_CHECKING: + # pylint: disable-next=ungrouped-imports + from functools import cached_property +else: + # pylint: disable-next=ungrouped-imports + from astroid.decorators import cachedproperty as cached_property + if TYPE_CHECKING: from pylint.lint import PyLinter @@ -1810,15 +1818,15 @@ def visit_arguments(self, node: nodes.Arguments) -> None: self._store_type_annotation_node(annotation) # Relying on other checker's options, which might not have been initialized yet. - @astroid.decorators.cachedproperty + @cached_property def _analyse_fallback_blocks(self): return get_global_option(self, "analyse-fallback-blocks", default=False) - @astroid.decorators.cachedproperty + @cached_property def _ignored_modules(self): return get_global_option(self, "ignored-modules", default=[]) - @astroid.decorators.cachedproperty + @cached_property def _allow_global_unused_variables(self): return get_global_option(self, "allow-global-unused-variables", default=True) From 8d57195ddcad664eeed6c7f7d07efd4513a65336 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Sun, 13 Mar 2022 01:32:32 -0500 Subject: [PATCH 041/473] Add regression test for #5771 (#5908) --- ChangeLog | 6 ++++++ doc/whatsnew/2.13.rst | 6 ++++++ pylint/checkers/variables.py | 4 +--- tests/functional/u/unused/unused_argument.py | 15 +++++++++++++++ tests/functional/u/unused/unused_argument.txt | 1 + 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 528da76833..a78a1d0048 100644 --- a/ChangeLog +++ b/ChangeLog @@ -154,6 +154,12 @@ Release date: TBA Closes #5408 Ref PyCQA/astroid#1392 +* Fixed false positive for ``unused-argument`` when a method overridden in a subclass + does nothing with the value of a keyword-only argument. + + Closes #5771 + Ref PyCQA/astroid#1382 + * The issue template for crashes is now created for crashes which were previously not covered by this mechanism. diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 3c3f088eac..9ddbc2ee7e 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -247,6 +247,12 @@ Other Changes Closes #5408 Ref PyCQA/astroid#1392 +* Fixed false positive for ``unused-argument`` when a method overridden in a subclass + does nothing with the value of a keyword-only argument. + + Closes #5771 + Ref PyCQA/astroid#1382 + * Fix ``unnecessary_dict_index_lookup`` false positive when deleting a dictionary's entry. Closes #4716 diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index c03d9b667c..b61c5a68ae 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -2310,9 +2310,7 @@ def _check_is_unused(self, name, node, stmt, global_names, nonlocal_names): if global_names and _import_name_is_global(stmt, global_names): return - argnames = list( - itertools.chain(node.argnames(), [arg.name for arg in node.args.kwonlyargs]) - ) + argnames = node.argnames() # Care about functions with unknown argument (builtins) if name in argnames: self._check_unused_arguments(name, node, stmt, argnames) diff --git a/tests/functional/u/unused/unused_argument.py b/tests/functional/u/unused/unused_argument.py index a3fd4e6abc..91243ce753 100644 --- a/tests/functional/u/unused/unused_argument.py +++ b/tests/functional/u/unused/unused_argument.py @@ -87,3 +87,18 @@ class BBBB(object): def __init__(self, arg): # [unused-argument] """Constructor with an extra parameter. Should raise a warning""" self.spam = 1 + + +# Regression test for https://github.com/PyCQA/pylint/issues/5771 +# involving keyword-only arguments +class Ancestor: + def __init__(self): + self.thing = None + + def set_thing(self, thing, *, other=None): # [unused-argument] + self.thing = thing + +class Descendant(Ancestor): + def set_thing(self, thing, *, other=None): + """Subclass does not raise unused-argument""" + self.thing = thing diff --git a/tests/functional/u/unused/unused_argument.txt b/tests/functional/u/unused/unused_argument.txt index 9d7a54b604..f73b9b5284 100644 --- a/tests/functional/u/unused/unused_argument.txt +++ b/tests/functional/u/unused/unused_argument.txt @@ -6,3 +6,4 @@ unused-argument:61:21:61:24:AAAA.method:Unused argument 'arg':INFERENCE unused-argument:68:0:None:None:AAAA.selected:Unused argument 'args':INFERENCE unused-argument:68:0:None:None:AAAA.selected:Unused argument 'kwargs':INFERENCE unused-argument:87:23:87:26:BBBB.__init__:Unused argument 'arg':INFERENCE +unused-argument:98:34:98:39:Ancestor.set_thing:Unused argument 'other':INFERENCE From 0b9a07254e8dcb336c9f785e8537fa2236046bd0 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 13 Mar 2022 09:22:17 +0100 Subject: [PATCH 042/473] Create a maintener section in contributors.txt and cleanup --- CONTRIBUTORS.txt | 87 ++++++++++++++++++------------------------------ 1 file changed, 33 insertions(+), 54 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index ec76f57d7b..1ec04b94f1 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -1,48 +1,43 @@ +Maintainers +----------- +- Claudiu Popa +- Pierre Sassoulas +- Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> +- Marc Mueller <30130371+cdce8p@users.noreply.github.com> +- Hippo91 +- Łukasz Rogalski +- Ashley Whetter +- Bryce Guinta +- Jacob Walls +- Dimitri Prybysh + - multiple-imports, not-iterable, not-a-mapping, various patches. + +- Roy Williams (Lyft) + - added check for implementing __eq__ without implementing __hash__, + - Added Python 3 check for accessing Exception.message. + - Added Python 3 check for calling encode/decode with invalid codecs. + - Added Python 3 check for accessing sys.maxint. + - Added Python 3 check for bad import statements. + - Added Python 3 check for accessing deprecated methods on the 'string' module, + various patches. + +- Florian Bruhin +- Andreas Finkler <3929834+DudeNr33@users.noreply.github.com> +- Yu Shao, Pang <36848472+yushao2@users.noreply.github.com> +- Arianna Yang + +Ex-maintainers +-------------- +- Sylvain Thénault : main author / maintainer +- Torsten Marek + Contributors ------------ -Current team: - -* Ashley Whetter: maintainer, contributor - -* Bryce Guinta: maintainer, contributor - -* Claudiu Popa: maintainer, contributor - -* Cara Vinson: astroid committer. - -* Guillaume Peillex: committer - -* Łukasz Rogalski: committer. - -* Roy Williams (Lyft): committer - - added check for implementing __eq__ without implementing __hash__, - Added Python 3 check for accessing Exception.message. - Added Python 3 check for calling encode/decode with invalid codecs. - Added Python 3 check for accessing sys.maxint. - Added Python 3 check for bad import statements. - Added Python 3 check for accessing deprecated methods on the 'string' module, - various patches. - -* Dmitri Prybysh: committer - - multiple-imports, not-iterable, not-a-mapping, various patches. - -* Jim Robertson: committer - -Ex-maintainers: - -* Sylvain Thenault (Logilab): main author / maintainer - -* Torsten Marek (Google): committer / contributor - - We would not be here without folks that contributed patches, pull requests, issues and their time to pylint. We're incredibly grateful to all of these contributors: - * Daniel Balparda (Google): GPyLint maintainer (Google's pylint variant), various patches @@ -150,8 +145,6 @@ contributors: * Daniel Miller: contributor. -* Bryce Guinta: contributor - * Martin Bašti: contributor Added new check for shallow copy of os.environ Added new check for useless `with threading.Lock():` statement @@ -289,8 +282,6 @@ contributors: * Michael Scott Cuthbert: contributor -* Pierre Sassoulas : maintainer, contributor - * Nathan Marrow * Taewon Kim : contributor @@ -447,8 +438,6 @@ contributors: * Matthew Suozzo: contributor -* Marc Mueller (cdce8p): contributor - * David Gilman: contributor * Ikraduya Edian: contributor @@ -472,8 +461,6 @@ contributors: * James Sinclair (irgeek): contributor -* Andreas Finkler: contributor - * Aidan Haase, Elizabeth Bott: contributor * Sebastian Müller: contributor @@ -490,13 +477,9 @@ contributors: * Andrew Haigh (nelfin): contributor -* Pang Yu Shao (yushao2): contributor - * Aditya Gupta (adityagupta1089) : contributor - Added ignore_signatures to duplicate checker -* Jacob Walls: contributor - * ruro: contributor * David Liu (david-yz-liu): contributor @@ -536,8 +519,6 @@ contributors: * Eisuke Kawashima (e-kwsm): contributor -* Daniel van Noord (DanielNoord): contributor - * Michal Vasilek: contributor * Kai Mueller (kasium): contributor @@ -567,8 +548,6 @@ contributors: * Youngsoo Sung: contributor -* Arianna Yang: contributor - * Samuel Freilich (sfreilich): contributor * Mike Fiedler (miketheman): contributor From d9c78bded2a40111b09d69e9828525020be9e357 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 13 Mar 2022 09:27:25 +0100 Subject: [PATCH 043/473] Remove superfluous role for contributors in contributors.txt --- CONTRIBUTORS.txt | 362 +++++++++++++++++++++++------------------------ 1 file changed, 181 insertions(+), 181 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 1ec04b94f1..5c9d21d754 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -102,7 +102,7 @@ contributors: * Aru Sahni: Git ignoring, regex-based ignores -* Mike Frysinger: contributor. +* Mike Frysinger * Moisés López (Vauxoo): Support for deprecated-modules in modules not installed, Refactor wrong-import-order to integrate it with `isort` library @@ -113,7 +113,7 @@ contributors: * Luis Escobar (Vauxoo), Moisés López (Vauxoo): Add bad-docstring-quotes and docstring-first-line-empty -* Yannick Brehon: contributor. +* Yannick Brehon * Glenn Matthews: autogenerated documentation for optional extensions, bug fixes and enhancements for docparams (née check_docs) extension @@ -133,7 +133,7 @@ contributors: * Anthony Foglia (Google): Added simple string slots check. -* Derek Gustafson: contributor +* Derek Gustafson * Petr Pulc: require whitespace around annotations @@ -143,27 +143,27 @@ contributors: * Ahirnish Pareek, 'keyword-arg-before-var-arg' check -* Daniel Miller: contributor. +* Daniel Miller -* Martin Bašti: contributor +* Martin Bašti Added new check for shallow copy of os.environ Added new check for useless `with threading.Lock():` statement -* Jacques Kvam: contributor +* Jacques Kvam * Brian Shaginaw: prevent error on exception check for functions * Ioana Tagirta: fix bad thread instantiation check -* Reverb Chu: contributor +* Reverb Chu -* Tobias Hernstig: contributor +* Tobias Hernstig -* Konstantin Manna: contributor +* Konstantin Manna * Andreas Freimuth: fix indentation checking with tabs -* Renat Galimov: contributor +* Renat Galimov * Thomas Snowden: fix missing-docstring for inner functions @@ -171,15 +171,15 @@ contributors: * Marianna Polatoglou: minor contribution for wildcard import check -* Ben Green: contributor +* Ben Green -* Benjamin Freeman: contributor +* Benjamin Freeman -* Fureigh: contributor +* Fureigh * Jace Browning: updated default report format with clickable paths -* Sushobhit (sushobhit27): contributor +* Sushobhit (sushobhit27) Added new check 'comparison-with-itself'. Added new check 'useless-import-alias'. Added support of annotations in missing-type-doc and missing-return-type-doc. @@ -188,44 +188,44 @@ contributors: Added new check 'chained-comparison'. Added new check 'useless-object-inheritance'. -* Mariatta Wijaya: contributor +* Mariatta Wijaya Added new check `logging-fstring-interpolation` Documentation typo fixes -* Jason Owen: contributor +* Jason Owen * Mark Roman Miller: fix inline defs in too-many-statements -* Adam Dangoor: contributor +* Adam Dangoor -* Gary Tyler McLeod: contributor +* Gary Tyler McLeod * Wolfgang Grafen, Axel Muller, Fabio Zadrozny, Pierre Rouleau, Maarten ter Huurne, Mirko Friedenhagen and all the Logilab's team (among others). -* Matej Marusak: contributor +* Matej Marusak -* Nick Drozd: contributor, performance improvements to astroid +* Nick Drozd, performance improvements to astroid -* Kosarchuk Sergey: contributor +* Kosarchuk Sergey -* Kurian Benoy: contributor +* Kurian Benoy * Carey Metcalfe: demoted `try-except-raise` from error to warning -* Marcus Näslund (naslundx): contributor +* Marcus Näslund (naslundx) -* Natalie Serebryakova: contributor +* Natalie Serebryakova -* Caio Carrara: contributor +* Caio Carrara * Roberto Leinardi: PyCharm plugin maintainer -* Aivar Annamaa: contributor +* Aivar Annamaa * Hornwitser: fix import graph -* Yuri Gribov: contributor +* Yuri Gribov * Drew Risinger: committer (docs) @@ -233,28 +233,28 @@ contributors: * Tomer Chachamu, Richard Goodman: simplifiable-if-expression -* Alan Chan: contributor +* Alan Chan * Benjamin Drung: contributing Debian Developer -* Scott Worley: contributor +* Scott Worley * Michael Hudson-Doyle -* Lucas Cimon: contributor +* Lucas Cimon -* Mike Miller: contributor +* Mike Miller -* Sergei Lebedev: contributor +* Sergei Lebedev * Sasha Bagan -* Pablo Galindo Salgado: contributor +* Pablo Galindo Salgado Fix false positive 'Non-iterable value' with async comprehensions. * Matus Valo -* Sardorbek Imomaliev: contributor +* Sardorbek Imomaliev * Justin Li (justinnhli) @@ -262,329 +262,329 @@ contributors: * Pascal Corpet -* Svetoslav Neykov: contributor +* Svetoslav Neykov -* Federico Bond: contributor +* Federico Bond -* Fantix King (UChicago): contributor +* Fantix King (UChicago) -* Yory (yory8): contributor +* Yory (yory8) -* Thomas Hisch: contributor +* Thomas Hisch -* Clément Pit-Claudel : contributor +* Clément Pit-Claudel -* Goudcode: contributor +* Goudcode -* Paul Renvoise : contributor +* Paul Renvoise -* Bluesheeptoken: contributor +* Bluesheeptoken -* Michael Scott Cuthbert: contributor +* Michael Scott Cuthbert * Nathan Marrow -* Taewon Kim : contributor +* Taewon Kim -* Daniil Kharkov: contributor +* Daniil Kharkov -* Tyler N. Thieding: contributor +* Tyler N. Thieding -* Zeb Nicholls: contributor +* Zeb Nicholls - Made W9011 compatible with 'of' syntax in return types -* Martin Vielsmaier: contributor +* Martin Vielsmaier -* Agustin Toledo: contributor +* Agustin Toledo -* Nicholas Smith: contributor +* Nicholas Smith -* Peter Kolbus (Garmin): contributor +* Peter Kolbus (Garmin) -* Oisin Moran: contributor +* Oisin Moran -* Andrzej Klajnert: contributor +* Andrzej Klajnert -* Andrés Pérez Hortal: contributor +* Andrés Pérez Hortal -* Niko Wenselowski: contributor +* Niko Wenselowski -* Danny Hermes: contributor +* Danny Hermes -* Eric Froemling: contributor +* Eric Froemling -* Robert Schweizer: contributor +* Robert Schweizer -* Hugo van Kemenade: contributor +* Hugo van Kemenade -* Mikhail Fesenko: contributor +* Mikhail Fesenko -* Trevor Bekolay: contributor +* Trevor Bekolay - Added --list-msgs-enabled command -* Rémi Cardona: contributor +* Rémi Cardona -* Daniel Draper: contributor +* Daniel Draper -* Gabriel R. Sezefredo: contributor +* Gabriel R. Sezefredo - Fixed "exception-escape" false positive with generators -* laike9m: contributor +* laike9m -* Janne Rönkkö: contributor +* Janne Rönkkö -* Hugues Bruant: contributor +* Hugues Bruant -* Tim Gates: contributor +* Tim Gates -* Enji Cooper: contributor +* Enji Cooper -* Bastien Vallet: contributor +* Bastien Vallet -* Pek Chhan: contributor +* Pek Chhan -* Craig Henriques: contributor +* Craig Henriques -* Matthijs Blom: contributor +* Matthijs Blom -* Andy Palmer: contributor +* Andy Palmer * Wes Turner (Google): added new check 'inconsistent-quotes' * Athos Ribeiro Fixed dict-keys-not-iterating false positive for inverse containment checks -* Anubhav: contributor +* Anubhav -* Ben Graham: contributor +* Ben Graham -* Anthony Tan: contributor +* Anthony Tan -* Benny Müller: contributor +* Benny Müller -* Bernie Gray: contributor +* Bernie Gray -* Slavfox: contributor +* Slavfox -* Matthew Beckers (mattlbeck): contributor +* Matthew Beckers (mattlbeck) -* Yang Yang: contributor +* Yang Yang -* Andrew J. Simmons (anjsimmo): contributor +* Andrew J. Simmons (anjsimmo) -* Damien Baty: contributor +* Damien Baty -* Daniel R. Neal (danrneal): contributor +* Daniel R. Neal (danrneal) -* Jeremy Fleischman (jfly): contributor +* Jeremy Fleischman (jfly) * Shiv Venkatasubrahmanyam -* Jochen Preusche (iilei): contributor +* Jochen Preusche (iilei) * Ram Rachum (cool-RR) -* D. Alphus (Alphadelta14): contributor +* D. Alphus (Alphadelta14) * Pieter Engelbrecht -* Ethan Leba: contributor +* Ethan Leba -* Matěj Grabovský: contributor +* Matěj Grabovský -* Yeting Li (yetingli): contributor +* Yeting Li (yetingli) -* Frost Ming (frostming): contributor +* Frost Ming (frostming) -* Luigi Bertaco Cristofolini (luigibertaco): contributor +* Luigi Bertaco Cristofolini (luigibertaco) * Eli Fine (eli88fine): Fixed false positive duplicate code warning for lines with symbols only -* Ganden Schaffner: contributor +* Ganden Schaffner -* Josselin Feist: contributor +* Josselin Feist -* David Cain: contributor +* David Cain -* Pedro Algarvio (s0undt3ch): contributor +* Pedro Algarvio (s0undt3ch) -* Luigi Bertaco Cristofolini (luigibertaco): contributor +* Luigi Bertaco Cristofolini (luigibertaco) -* Or Bahari: contributor +* Or Bahari -* Joshua Cannon: contributor +* Joshua Cannon -* Giuseppe Valente: contributor +* Giuseppe Valente -* Takashi Hirashima: contributor +* Takashi Hirashima -* Joffrey Mander: contributor +* Joffrey Mander -* Julien Palard: contributor +* Julien Palard -* Raphael Gaschignard: contributor +* Raphael Gaschignard -* Sorin Sbarnea: contributor +* Sorin Sbarnea -* Gergely Kalmár: contributor +* Gergely Kalmár -* Batuhan Taskaya: contributor +* Batuhan Taskaya -* Frank Harrison (doublethefish): contributor +* Frank Harrison (doublethefish) -* Gauthier Sebaux: contributor +* Gauthier Sebaux -* Logan Miller (komodo472): contributor +* Logan Miller (komodo472) -* Matthew Suozzo: contributor +* Matthew Suozzo -* David Gilman: contributor +* David Gilman -* Ikraduya Edian: contributor +* Ikraduya Edian - Added new checks 'consider-using-generator' and 'use-a-generator'. -* Tiago Honorato: contributor +* Tiago Honorato -* Lefteris Karapetsas: contributor +* Lefteris Karapetsas -* Louis Sautier: contributor +* Louis Sautier -* Quentin Young: contributor +* Quentin Young -* Alexander Kapshuna: contributor +* Alexander Kapshuna -* Mark Byrne: contributor +* Mark Byrne -* Konstantina Saketou: contributor +* Konstantina Saketou -* Andrew Howe: contributor +* Andrew Howe -* James Sinclair (irgeek): contributor +* James Sinclair (irgeek) -* Aidan Haase, Elizabeth Bott: contributor +* Aidan Haase, Elizabeth Bott -* Sebastian Müller: contributor +* Sebastian Müller * Ramiro Leal-Cavazos (ramiro050): Fixed bug preventing pylint from working with emacs tramp -* manderj: contributor +* manderj -* qwiddle: contributor +* qwiddle -* das-intensity: contributor +* das-intensity -* Jiajunsu (victor): contributor +* Jiajunsu (victor) -* Andrew Haigh (nelfin): contributor +* Andrew Haigh (nelfin) -* Aditya Gupta (adityagupta1089) : contributor +* Aditya Gupta (adityagupta1089) - Added ignore_signatures to duplicate checker -* ruro: contributor +* ruro -* David Liu (david-yz-liu): contributor +* David Liu (david-yz-liu) -* Bernard Nauwelaerts: contributor +* Bernard Nauwelaerts -* Fabian Damken: contributor +* Fabian Damken -* Markus Siebenhaar: contributor +* Markus Siebenhaar -* Lorena Buciu (lorena-b): contributor +* Lorena Buciu (lorena-b) -* Sergei Lebedev (superbobry): contributor +* Sergei Lebedev (superbobry) -* Maksym Humetskyi (mhumetskyi): contributor +* Maksym Humetskyi (mhumetskyi) - Fixed ignored empty functions by similarities checker with "ignore-signatures" option enabled - Ignore function decorators signatures as well by similarities checker with "ignore-signatures" option enabled - Ignore class methods and nested functions signatures as well by similarities checker with "ignore-signatures" option enabled -* Daniel Dorani (doranid): contributor +* Daniel Dorani (doranid) -* Will Shanks: contributor +* Will Shanks -* Mark Bell: contributor +* Mark Bell -* Marco Gorelli: contributor +* Marco Gorelli - Documented Jupyter integration -* Rebecca Turner (9999years): contributor +* Rebecca Turner (9999years) -* Yilei Yang: contributor +* Yilei Yang -* Marcin Kurczewski (rr-): contributor +* Marcin Kurczewski (rr-) -* Tanvi Moharir: contributor +* Tanvi Moharir - Fix for invalid toml config -* Eisuke Kawashima (e-kwsm): contributor +* Eisuke Kawashima (e-kwsm) -* Michal Vasilek: contributor +* Michal Vasilek -* Kai Mueller (kasium): contributor +* Kai Mueller (kasium) -* Sam Vermeiren (PaaEl): contributor +* Sam Vermeiren (PaaEl) -* Phil A. (flying-sheep): contributor +* Phil A. (flying-sheep) -* Melvin Hazeleger (melvio): contributor +* Melvin Hazeleger (melvio) -* Hayden Richards (SupImDos): contributor +* Hayden Richards (SupImDos) - Fixed "no-self-use" for async methods - Fixed "docparams" extension for async functions and methods -* Jeroen Seegers (jeroenseegers): contributor +* Jeroen Seegers (jeroenseegers) - Fixed `toml` dependency issue -* Tim Martin: contributor +* Tim Martin -* Jaehoon Hwang (jaehoonhwang): contributor +* Jaehoon Hwang (jaehoonhwang) -* Samuel Forestier: contributor +* Samuel Forestier -* Nick Pesce: contributor +* Nick Pesce -* James DesLauriers: contributor +* James DesLauriers -* Youngsoo Sung: contributor +* Youngsoo Sung -* Samuel Freilich (sfreilich): contributor +* Samuel Freilich (sfreilich) -* Mike Fiedler (miketheman): contributor +* Mike Fiedler (miketheman) -* Takahide Nojima: contributor +* Takahide Nojima -* Tushar Sadhwani (tusharsadhwani): contributor +* Tushar Sadhwani (tusharsadhwani) -* Ikraduya Edian: contributor +* Ikraduya Edian -* Antonio Quarta (sgheppy): contributor +* Antonio Quarta (sgheppy) -* Harshil (harshil21): contributor +* Harshil (harshil21) -* Jérome Perrin (perrinjerome): contributor +* Jérome Perrin (perrinjerome) -* Felix von Drigalski (felixvd): contributor +* Felix von Drigalski (felixvd) -* Jake Lishman (jakelishman): contributor +* Jake Lishman (jakelishman) -* Philipp Albrecht (pylbrecht): contributor +* Philipp Albrecht (pylbrecht) -* Allan Chandler (allanc65): contributor +* Allan Chandler (allanc65) - Fixed issue 5452, false positive missing-param-doc for multi-line Google-style params -* Eero Vuojolahti: contributor +* Eero Vuojolahti -* Kian-Meng, Ang: contributor +* Kian-Meng, Ang -* Nuzula H. Yudaka (Nuzhuka): contributor +* Nuzula H. Yudaka (Nuzhuka) -* Carli Freudenberg (CarliJoy): contributor +* Carli Freudenberg (CarliJoy) - Fixed issue 5281, added Unicode checker - Improve non-ascii-name checker -* Daniel Brookman: contributor +* Daniel Brookman -* Téo Bouvard: contributor +* Téo Bouvard -* Konrad Weihmann: contributor +* Konrad Weihmann From 82f60059bc4e725e993bbd9ddd0134f8abd367b3 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 13 Mar 2022 09:38:55 +0100 Subject: [PATCH 044/473] Remove superfluous role 'committer' in contributors.txt --- CONTRIBUTORS.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 5c9d21d754..06be0fa3cf 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -227,7 +227,7 @@ contributors: * Yuri Gribov -* Drew Risinger: committer (docs) +* Drew Risinger * Ben James From 3d6bab0b8e01f7a2492943145a961a25b84203e2 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 13 Mar 2022 09:40:46 +0100 Subject: [PATCH 045/473] Upgrade developments guides for CONTRIBUTORS.txt --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- doc/development_guide/contribute.rst | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5cb6329f62..46b9eb71a1 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,7 +3,7 @@ Thank you for submitting a PR to pylint! To ease the process of reviewing your PR, do make sure to complete the following boxes. -- [ ] Add yourself to CONTRIBUTORS if you are a new contributor. +- [ ] Add yourself to ``CONTRIBUTORS.txt`` 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/`. diff --git a/doc/development_guide/contribute.rst b/doc/development_guide/contribute.rst index 8e484a5147..aa975bb278 100644 --- a/doc/development_guide/contribute.rst +++ b/doc/development_guide/contribute.rst @@ -87,8 +87,7 @@ of Pylint as it gives you access to the latest ``ast`` parser. - Add a short entry in :file:`doc/whatsnew/VERSION.rst`. -- Add yourself to the `CONTRIBUTORS` file, flag yourself appropriately - (if in doubt, you're a ``contributor``). +- Add yourself to the `CONTRIBUTORS.txt` file. - Write a comprehensive commit message From 8a0b23d9d59b968cbe9fee623d038d18577ade44 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 13 Mar 2022 09:52:31 +0100 Subject: [PATCH 046/473] Uniformize formatting in CONTRIBUTORS.txt --- CONTRIBUTORS.txt | 606 ++++++++++++++++++++++++----------------------- 1 file changed, 307 insertions(+), 299 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 06be0fa3cf..2ae3149181 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -10,15 +10,15 @@ Maintainers - Bryce Guinta - Jacob Walls - Dimitri Prybysh - - multiple-imports, not-iterable, not-a-mapping, various patches. + * multiple-imports, not-iterable, not-a-mapping, various patches. - Roy Williams (Lyft) - - added check for implementing __eq__ without implementing __hash__, - - Added Python 3 check for accessing Exception.message. - - Added Python 3 check for calling encode/decode with invalid codecs. - - Added Python 3 check for accessing sys.maxint. - - Added Python 3 check for bad import statements. - - Added Python 3 check for accessing deprecated methods on the 'string' module, + * added check for implementing __eq__ without implementing __hash__, + * Added Python 3 check for accessing Exception.message. + * Added Python 3 check for calling encode/decode with invalid codecs. + * Added Python 3 check for accessing sys.maxint. + * Added Python 3 check for bad import statements. + * Added Python 3 check for accessing deprecated methods on the 'string' module, various patches. - Florian Bruhin @@ -38,553 +38,561 @@ We would not be here without folks that contributed patches, pull requests, issues and their time to pylint. We're incredibly grateful to all of these contributors: -* Daniel Balparda (Google): GPyLint maintainer (Google's pylint variant), +- Daniel Balparda (Google): GPyLint maintainer (Google's pylint variant), various patches -* Martin Pool (Google): warnings for anomalous backslashes, symbolic names for +- Martin Pool (Google): warnings for anomalous backslashes, symbolic names for messages (like 'unused'), etc -* Alexandre Fayolle (Logilab): TkInter gui, documentation, debian support +- Alexandre Fayolle (Logilab): TkInter gui, documentation, debian support -* Julien Cristau, Emile Anclin (Logilab): python 3 support +- Julien Cristau, Emile Anclin (Logilab): python 3 support -* Sandro Tosi: Debian packaging +- Sandro Tosi: Debian packaging -* Mads Kiilerich, Boris Feld, Bill Wendling, Sebastian Ulrich: +- Mads Kiilerich, Boris Feld, Bill Wendling, Sebastian Ulrich: various patches -* Brian van den Broek: windows installation documentation +- Brian van den Broek: windows installation documentation -* Amaury Forgeot d'Arc: check names imported from a module exists in the module +- Amaury Forgeot d'Arc: check names imported from a module exists in the module -* Benjamin Niemann: allow block level enabling/disabling of messages +- Benjamin Niemann: allow block level enabling/disabling of messages -* Nathaniel Manista: suspicious lambda checking +- Nathaniel Manista: suspicious lambda checking -* David Shea: invalid sequence and slice index +- David Shea: invalid sequence and slice index -* Carl Crowder: don't evaluate the value of arguments for 'dangerous-default-value' +- Carl Crowder: don't evaluate the value of arguments for 'dangerous-default-value' -* Michal Nowikowski: wrong-spelling-in-comment, wrong-spelling-in-docstring, +- Michal Nowikowski: wrong-spelling-in-comment, wrong-spelling-in-docstring, parallel execution on multiple CPUs and other patches. -* David Lindquist: logging-format-interpolation warning. +- David Lindquist: logging-format-interpolation warning. -* Brett Cannon: Port source code to be Python 2/3 compatible, Python 3 +- Brett Cannon: Port source code to be Python 2/3 compatible, Python 3 checker. -* Vlad Temian: redundant-unittest-assert and the JSON reporter. +- Vlad Temian: redundant-unittest-assert and the JSON reporter. -* Cosmin Poieană: unichr-builtin and improvements to bad-open-mode. +- Cosmin Poieană: unichr-builtin and improvements to bad-open-mode. -* Viorel Știrbu: intern-builtin warning. +- Viorel Știrbu: intern-builtin warning. -* Dan Goldsmith: support for msg-template in HTML reporter. +- Dan Goldsmith: support for msg-template in HTML reporter. -* Chris Rebert: unidiomatic-typecheck. +- Chris Rebert: unidiomatic-typecheck. -* Steven Myint: duplicate-except. +- Steven Myint: duplicate-except. -* Radu Ciorba: not-context-manager and confusing-with-statement warnings. +- Radu Ciorba: not-context-manager and confusing-with-statement warnings. -* Bruno Daniel: check_docs extension. +- Bruno Daniel: check_docs extension. -* James Morgensen: ignored-modules option applies to import errors. +- James Morgensen: ignored-modules option applies to import errors. -* Cezar Elnazli: deprecated-method +- Cezar Elnazli: deprecated-method -* Stéphane Wirtel: nonlocal-without-binding +- Stéphane Wirtel: nonlocal-without-binding -* Laura Medioni (Logilab, on behalf of the CNES): misplaced-comparison-constant, - no-classmethod-decorator, no-staticmethod-decorator, too-many-nested-blocks, - too-many-boolean-expressions, unneeded-not, wrong-import-order, ungrouped-imports, - wrong-import-position, redefined-variable-type +- Laura Medioni (Logilab, on behalf of the CNES): + * misplaced-comparison-constant + * no-classmethod-decorator + * no-staticmethod-decorator + * too-many-nested-blocks, + * too-many-boolean-expressions + * unneeded-not + * wrong-import-order + * ungrouped-imports, + * wrong-import-position + * redefined-variable-type -* Aru Sahni: Git ignoring, regex-based ignores +- Aru Sahni: Git ignoring, regex-based ignores -* Mike Frysinger +- Mike Frysinger -* Moisés López (Vauxoo): Support for deprecated-modules in modules not installed, - Refactor wrong-import-order to integrate it with `isort` library - Add check too-complex with mccabe for cyclomatic complexity - Refactor wrong-import-position to skip try-import and nested cases - Add consider-merging-isinstance, superfluous-else-return - Fix consider-using-ternary for 'True and True and True or True' case +- Moisés López (Vauxoo): + * Support for deprecated-modules in modules not installed, + * Refactor wrong-import-order to integrate it with `isort` library + * Add check too-complex with mccabe for cyclomatic complexity + * Refactor wrong-import-position to skip try-import and nested cases + * Add consider-merging-isinstance, superfluous-else-return + * Fix consider-using-ternary for 'True and True and True or True' case -* Luis Escobar (Vauxoo), Moisés López (Vauxoo): Add bad-docstring-quotes and docstring-first-line-empty +- Luis Escobar (Vauxoo), Moisés López (Vauxoo): Add bad-docstring-quotes and docstring-first-line-empty -* Yannick Brehon +- Yannick Brehon -* Glenn Matthews: autogenerated documentation for optional extensions, +- Glenn Matthews: autogenerated documentation for optional extensions, bug fixes and enhancements for docparams (née check_docs) extension -* Elias Dorneles: minor adjust to config defaults and docs +- Elias Dorneles: minor adjust to config defaults and docs -* Yuri Bochkarev: Added epytext support to docparams extension. +- Yuri Bochkarev: Added epytext support to docparams extension. -* Alexander Todorov: added new error conditions to 'bad-super-call', - Added new check for incorrect len(SEQUENCE) usage, - Added new extension for comparison against empty string constants, - Added new extension which detects comparing integers to zero, - Added new useless-return checker, - Added new try-except-raise checker +- Alexander Todorov: added new error conditions to 'bad-super-call', + * Added new check for incorrect len(SEQUENCE) usage, + * Added new extension for comparison against empty string constants, + * Added new extension which detects comparing integers to zero, + * Added new useless-return checker, + * Added new try-except-raise checker -* Erik Eriksson - Added overlapping-except error check. +- Erik Eriksson - Added overlapping-except error check. -* Anthony Foglia (Google): Added simple string slots check. +- Anthony Foglia (Google): Added simple string slots check. -* Derek Gustafson +- Derek Gustafson -* Petr Pulc: require whitespace around annotations +- Petr Pulc: require whitespace around annotations -* John Paraskevopoulos: add 'differing-param-doc' and 'differing-type-doc' +- John Paraskevopoulos: add 'differing-param-doc' and 'differing-type-doc' -* Martin von Gagern (Google): Added 'raising-format-tuple' warning. +- Martin von Gagern (Google): Added 'raising-format-tuple' warning. -* Ahirnish Pareek, 'keyword-arg-before-var-arg' check +- Ahirnish Pareek, 'keyword-arg-before-var-arg' check -* Daniel Miller +- Daniel Miller -* Martin Bašti - Added new check for shallow copy of os.environ - Added new check for useless `with threading.Lock():` statement +- Martin Bašti + * Added new check for shallow copy of os.environ + * Added new check for useless `with threading.Lock():` statement -* Jacques Kvam +- Jacques Kvam -* Brian Shaginaw: prevent error on exception check for functions +- Brian Shaginaw: prevent error on exception check for functions -* Ioana Tagirta: fix bad thread instantiation check +- Ioana Tagirta: fix bad thread instantiation check -* Reverb Chu +- Reverb Chu -* Tobias Hernstig +- Tobias Hernstig -* Konstantin Manna +- Konstantin Manna -* Andreas Freimuth: fix indentation checking with tabs +- Andreas Freimuth: fix indentation checking with tabs -* Renat Galimov +- Renat Galimov -* Thomas Snowden: fix missing-docstring for inner functions +- Thomas Snowden: fix missing-docstring for inner functions -* Mitchell Young: minor adjustment to docparams +- Mitchell Young: minor adjustment to docparams -* Marianna Polatoglou: minor contribution for wildcard import check +- Marianna Polatoglou: minor contribution for wildcard import check -* Ben Green +- Ben Green -* Benjamin Freeman +- Benjamin Freeman -* Fureigh +- Fureigh -* Jace Browning: updated default report format with clickable paths +- Jace Browning: updated default report format with clickable paths -* Sushobhit (sushobhit27) - Added new check 'comparison-with-itself'. - Added new check 'useless-import-alias'. - Added support of annotations in missing-type-doc and missing-return-type-doc. - Added new check 'comparison-with-callable'. - Removed six package dependency. - Added new check 'chained-comparison'. - Added new check 'useless-object-inheritance'. +- Sushobhit (sushobhit27) + * Added new check 'comparison-with-itself'. + * Added new check 'useless-import-alias'. + * Added support of annotations in missing-type-doc and missing-return-type-doc. + * Added new check 'comparison-with-callable'. + * Removed six package dependency. + * Added new check 'chained-comparison'. + * Added new check 'useless-object-inheritance'. -* Mariatta Wijaya - Added new check `logging-fstring-interpolation` - Documentation typo fixes +- Mariatta Wijaya + * Added new check `logging-fstring-interpolation` + * Documentation typo fixes -* Jason Owen +- Jason Owen -* Mark Roman Miller: fix inline defs in too-many-statements +- Mark Roman Miller: fix inline defs in too-many-statements -* Adam Dangoor +- Adam Dangoor -* Gary Tyler McLeod +- Gary Tyler McLeod -* Wolfgang Grafen, Axel Muller, Fabio Zadrozny, Pierre Rouleau, +- Wolfgang Grafen, Axel Muller, Fabio Zadrozny, Pierre Rouleau, Maarten ter Huurne, Mirko Friedenhagen and all the Logilab's team (among others). -* Matej Marusak +- Matej Marusak -* Nick Drozd, performance improvements to astroid +- Nick Drozd, performance improvements to astroid -* Kosarchuk Sergey +- Kosarchuk Sergey -* Kurian Benoy +- Kurian Benoy -* Carey Metcalfe: demoted `try-except-raise` from error to warning +- Carey Metcalfe: demoted `try-except-raise` from error to warning -* Marcus Näslund (naslundx) +- Marcus Näslund (naslundx) -* Natalie Serebryakova +- Natalie Serebryakova -* Caio Carrara +- Caio Carrara -* Roberto Leinardi: PyCharm plugin maintainer +- Roberto Leinardi: PyCharm plugin maintainer -* Aivar Annamaa +- Aivar Annamaa -* Hornwitser: fix import graph +- Hornwitser: fix import graph -* Yuri Gribov +- Yuri Gribov -* Drew Risinger +- Drew Risinger -* Ben James +- Ben James -* Tomer Chachamu, Richard Goodman: simplifiable-if-expression +- Tomer Chachamu, Richard Goodman: simplifiable-if-expression -* Alan Chan +- Alan Chan -* Benjamin Drung: contributing Debian Developer +- Benjamin Drung: contributing Debian Developer -* Scott Worley +- Scott Worley -* Michael Hudson-Doyle +- Michael Hudson-Doyle -* Lucas Cimon +- Lucas Cimon -* Mike Miller +- Mike Miller -* Sergei Lebedev +- Sergei Lebedev -* Sasha Bagan +- Sasha Bagan -* Pablo Galindo Salgado - Fix false positive 'Non-iterable value' with async comprehensions. +- Pablo Galindo Salgado + * Fix false positive 'Non-iterable value' with async comprehensions. -* Matus Valo +- Matus Valo -* Sardorbek Imomaliev +- Sardorbek Imomaliev -* Justin Li (justinnhli) +- Justin Li (justinnhli) -* Nicolas Dickreuter +- Nicolas Dickreuter -* Pascal Corpet +- Pascal Corpet -* Svetoslav Neykov +- Svetoslav Neykov -* Federico Bond +- Federico Bond -* Fantix King (UChicago) +- Fantix King (UChicago) -* Yory (yory8) +- Yory (yory8) -* Thomas Hisch +- Thomas Hisch -* Clément Pit-Claudel +- Clément Pit-Claudel -* Goudcode +- Goudcode -* Paul Renvoise +- Paul Renvoise -* Bluesheeptoken +- Bluesheeptoken -* Michael Scott Cuthbert +- Michael Scott Cuthbert -* Nathan Marrow +- Nathan Marrow -* Taewon Kim +- Taewon Kim -* Daniil Kharkov +- Daniil Kharkov -* Tyler N. Thieding +- Tyler N. Thieding -* Zeb Nicholls - - Made W9011 compatible with 'of' syntax in return types +- Zeb Nicholls + * Made W9011 compatible with 'of' syntax in return types -* Martin Vielsmaier +- Martin Vielsmaier -* Agustin Toledo +- Agustin Toledo -* Nicholas Smith +- Nicholas Smith -* Peter Kolbus (Garmin) +- Peter Kolbus (Garmin) -* Oisin Moran +- Oisin Moran -* Andrzej Klajnert +- Andrzej Klajnert -* Andrés Pérez Hortal +- Andrés Pérez Hortal -* Niko Wenselowski +- Niko Wenselowski -* Danny Hermes +- Danny Hermes -* Eric Froemling +- Eric Froemling -* Robert Schweizer +- Robert Schweizer -* Hugo van Kemenade +- Hugo van Kemenade -* Mikhail Fesenko +- Mikhail Fesenko -* Trevor Bekolay - - Added --list-msgs-enabled command +- Trevor Bekolay + * Added --list-msgs-enabled command -* Rémi Cardona +- Rémi Cardona -* Daniel Draper +- Daniel Draper -* Gabriel R. Sezefredo - - Fixed "exception-escape" false positive with generators +- Gabriel R. Sezefredo + * Fixed "exception-escape" false positive with generators -* laike9m +- laike9m -* Janne Rönkkö +- Janne Rönkkö -* Hugues Bruant +- Hugues Bruant -* Tim Gates +- Tim Gates -* Enji Cooper +- Enji Cooper -* Bastien Vallet +- Bastien Vallet -* Pek Chhan +- Pek Chhan -* Craig Henriques +- Craig Henriques -* Matthijs Blom +- Matthijs Blom -* Andy Palmer +- Andy Palmer -* Wes Turner (Google): added new check 'inconsistent-quotes' +- Wes Turner (Google): added new check 'inconsistent-quotes' -* Athos Ribeiro +- Athos Ribeiro Fixed dict-keys-not-iterating false positive for inverse containment checks -* Anubhav +- Anubhav -* Ben Graham +- Ben Graham -* Anthony Tan +- Anthony Tan -* Benny Müller +- Benny Müller -* Bernie Gray +- Bernie Gray -* Slavfox +- Slavfox -* Matthew Beckers (mattlbeck) +- Matthew Beckers (mattlbeck) -* Yang Yang +- Yang Yang -* Andrew J. Simmons (anjsimmo) +- Andrew J. Simmons (anjsimmo) -* Damien Baty +- Damien Baty -* Daniel R. Neal (danrneal) +- Daniel R. Neal (danrneal) -* Jeremy Fleischman (jfly) +- Jeremy Fleischman (jfly) -* Shiv Venkatasubrahmanyam +- Shiv Venkatasubrahmanyam -* Jochen Preusche (iilei) +- Jochen Preusche (iilei) -* Ram Rachum (cool-RR) +- Ram Rachum (cool-RR) -* D. Alphus (Alphadelta14) +- D. Alphus (Alphadelta14) -* Pieter Engelbrecht +- Pieter Engelbrecht -* Ethan Leba +- Ethan Leba -* Matěj Grabovský +- Matěj Grabovský -* Yeting Li (yetingli) +- Yeting Li (yetingli) -* Frost Ming (frostming) +- Frost Ming (frostming) -* Luigi Bertaco Cristofolini (luigibertaco) +- Luigi Bertaco Cristofolini (luigibertaco) -* Eli Fine (eli88fine): Fixed false positive duplicate code warning for lines with symbols only +- Eli Fine (eli88fine): Fixed false positive duplicate code warning for lines with symbols only -* Ganden Schaffner +- Ganden Schaffner -* Josselin Feist +- Josselin Feist -* David Cain +- David Cain -* Pedro Algarvio (s0undt3ch) +- Pedro Algarvio (s0undt3ch) -* Luigi Bertaco Cristofolini (luigibertaco) +- Luigi Bertaco Cristofolini (luigibertaco) -* Or Bahari +- Or Bahari -* Joshua Cannon +- Joshua Cannon -* Giuseppe Valente +- Giuseppe Valente -* Takashi Hirashima +- Takashi Hirashima -* Joffrey Mander +- Joffrey Mander -* Julien Palard +- Julien Palard -* Raphael Gaschignard +- Raphael Gaschignard -* Sorin Sbarnea +- Sorin Sbarnea -* Gergely Kalmár +- Gergely Kalmár -* Batuhan Taskaya +- Batuhan Taskaya -* Frank Harrison (doublethefish) +- Frank Harrison (doublethefish) -* Gauthier Sebaux +- Gauthier Sebaux -* Logan Miller (komodo472) +- Logan Miller (komodo472) -* Matthew Suozzo +- Matthew Suozzo -* David Gilman +- David Gilman -* Ikraduya Edian - - Added new checks 'consider-using-generator' and 'use-a-generator'. +- Ikraduya Edian + * Added new checks 'consider-using-generator' and 'use-a-generator'. -* Tiago Honorato +- Tiago Honorato -* Lefteris Karapetsas +- Lefteris Karapetsas -* Louis Sautier +- Louis Sautier -* Quentin Young +- Quentin Young -* Alexander Kapshuna +- Alexander Kapshuna -* Mark Byrne +- Mark Byrne -* Konstantina Saketou +- Konstantina Saketou -* Andrew Howe +- Andrew Howe -* James Sinclair (irgeek) +- James Sinclair (irgeek) -* Aidan Haase, Elizabeth Bott +- Aidan Haase, Elizabeth Bott -* Sebastian Müller +- Sebastian Müller -* Ramiro Leal-Cavazos (ramiro050): Fixed bug preventing pylint from working with emacs tramp +- Ramiro Leal-Cavazos (ramiro050): Fixed bug preventing pylint from working with emacs tramp -* manderj +- manderj -* qwiddle +- qwiddle -* das-intensity +- das-intensity -* Jiajunsu (victor) +- Jiajunsu (victor) -* Andrew Haigh (nelfin) +- Andrew Haigh (nelfin) -* Aditya Gupta (adityagupta1089) - - Added ignore_signatures to duplicate checker +- Aditya Gupta (adityagupta1089) + * Added ignore_signatures to duplicate checker -* ruro +- ruro -* David Liu (david-yz-liu) +- David Liu (david-yz-liu) -* Bernard Nauwelaerts +- Bernard Nauwelaerts -* Fabian Damken +- Fabian Damken -* Markus Siebenhaar +- Markus Siebenhaar -* Lorena Buciu (lorena-b) +- Lorena Buciu (lorena-b) -* Sergei Lebedev (superbobry) +- Sergei Lebedev (superbobry) -* Maksym Humetskyi (mhumetskyi) - - Fixed ignored empty functions by similarities checker with "ignore-signatures" option enabled - - Ignore function decorators signatures as well by similarities checker with "ignore-signatures" option enabled - - Ignore class methods and nested functions signatures as well by similarities checker with "ignore-signatures" option enabled +- Maksym Humetskyi (mhumetskyi) + * Fixed ignored empty functions by similarities checker with "ignore-signatures" option enabled + * Ignore function decorators signatures as well by similarities checker with "ignore-signatures" option enabled + * Ignore class methods and nested functions signatures as well by similarities checker with "ignore-signatures" option enabled -* Daniel Dorani (doranid) +- Daniel Dorani (doranid) -* Will Shanks +- Will Shanks -* Mark Bell +- Mark Bell -* Marco Gorelli - - Documented Jupyter integration +- Marco Gorelli + * Documented Jupyter integration -* Rebecca Turner (9999years) +- Rebecca Turner (9999years) -* Yilei Yang +- Yilei Yang -* Marcin Kurczewski (rr-) +- Marcin Kurczewski (rr-) -* Tanvi Moharir - - Fix for invalid toml config +- Tanvi Moharir + * Fix for invalid toml config -* Eisuke Kawashima (e-kwsm) +- Eisuke Kawashima (e-kwsm) -* Michal Vasilek +- Michal Vasilek -* Kai Mueller (kasium) +- Kai Mueller (kasium) -* Sam Vermeiren (PaaEl) +- Sam Vermeiren (PaaEl) -* Phil A. (flying-sheep) +- Phil A. (flying-sheep) -* Melvin Hazeleger (melvio) +- Melvin Hazeleger (melvio) -* Hayden Richards (SupImDos) - - Fixed "no-self-use" for async methods - - Fixed "docparams" extension for async functions and methods +- Hayden Richards (SupImDos) + * Fixed "no-self-use" for async methods + * Fixed "docparams" extension for async functions and methods -* Jeroen Seegers (jeroenseegers) - - Fixed `toml` dependency issue +- Jeroen Seegers (jeroenseegers) + * Fixed `toml` dependency issue -* Tim Martin +- Tim Martin -* Jaehoon Hwang (jaehoonhwang) +- Jaehoon Hwang (jaehoonhwang) -* Samuel Forestier +- Samuel Forestier -* Nick Pesce +- Nick Pesce -* James DesLauriers +- James DesLauriers -* Youngsoo Sung +- Youngsoo Sung -* Samuel Freilich (sfreilich) +- Samuel Freilich (sfreilich) -* Mike Fiedler (miketheman) +- Mike Fiedler (miketheman) -* Takahide Nojima +- Takahide Nojima -* Tushar Sadhwani (tusharsadhwani) +- Tushar Sadhwani (tusharsadhwani) -* Ikraduya Edian +- Ikraduya Edian -* Antonio Quarta (sgheppy) +- Antonio Quarta (sgheppy) -* Harshil (harshil21) +- Harshil (harshil21) -* Jérome Perrin (perrinjerome) +- Jérome Perrin (perrinjerome) -* Felix von Drigalski (felixvd) +- Felix von Drigalski (felixvd) -* Jake Lishman (jakelishman) +- Jake Lishman (jakelishman) -* Philipp Albrecht (pylbrecht) +- Philipp Albrecht (pylbrecht) -* Allan Chandler (allanc65) - - Fixed issue 5452, false positive missing-param-doc for multi-line Google-style params +- Allan Chandler (allanc65) + * Fixed issue 5452, false positive missing-param-doc for multi-line Google-style params -* Eero Vuojolahti +- Eero Vuojolahti -* Kian-Meng, Ang +- Kian-Meng, Ang -* Nuzula H. Yudaka (Nuzhuka) +- Nuzula H. Yudaka (Nuzhuka) -* Carli Freudenberg (CarliJoy) - - Fixed issue 5281, added Unicode checker - - Improve non-ascii-name checker +- Carli Freudenberg (CarliJoy) + * Fixed issue 5281, added Unicode checker + * Improve non-ascii-name checker -* Daniel Brookman +- Daniel Brookman -* Téo Bouvard +- Téo Bouvard -* Konrad Weihmann +- Konrad Weihmann From 7981ec021b84c6f2b216202c1c028da4b0ee995b Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 13 Mar 2022 10:03:53 +0100 Subject: [PATCH 047/473] Enforce one name per line and no line break in CONTRIBUTORS.txt --- CONTRIBUTORS.txt | 327 +++++++---------------------------------------- 1 file changed, 43 insertions(+), 284 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 2ae3149181..01c49f1b7e 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -11,7 +11,6 @@ Maintainers - Jacob Walls - Dimitri Prybysh * multiple-imports, not-iterable, not-a-mapping, various patches. - - Roy Williams (Lyft) * added check for implementing __eq__ without implementing __hash__, * Added Python 3 check for accessing Exception.message. @@ -20,7 +19,6 @@ Maintainers * Added Python 3 check for bad import statements. * Added Python 3 check for accessing deprecated methods on the 'string' module, various patches. - - Florian Bruhin - Andreas Finkler <3929834+DudeNr33@users.noreply.github.com> - Yu Shao, Pang <36848472+yushao2@users.noreply.github.com> @@ -38,63 +36,44 @@ We would not be here without folks that contributed patches, pull requests, issues and their time to pylint. We're incredibly grateful to all of these contributors: -- Daniel Balparda (Google): GPyLint maintainer (Google's pylint variant), - various patches - -- Martin Pool (Google): warnings for anomalous backslashes, symbolic names for - messages (like 'unused'), etc - +- Daniel Balparda (Google): GPyLint maintainer (Google's pylint variant) +- Martin Pool (Google): + * warnings for anomalous backslashes + * symbolic names for messages (like 'unused') + * etc. - Alexandre Fayolle (Logilab): TkInter gui, documentation, debian support - -- Julien Cristau, Emile Anclin (Logilab): python 3 support - +- Julien Cristau (Logilab): python 3 support +- Emile Anclin (Logilab): python 3 support - Sandro Tosi: Debian packaging - -- Mads Kiilerich, Boris Feld, Bill Wendling, Sebastian Ulrich: - various patches - +- Mads Kiilerich +- Boris Feld +- Bill Wendling +- Sebastian Ulrich - Brian van den Broek: windows installation documentation - - Amaury Forgeot d'Arc: check names imported from a module exists in the module - - Benjamin Niemann: allow block level enabling/disabling of messages - - Nathaniel Manista: suspicious lambda checking - - David Shea: invalid sequence and slice index - - Carl Crowder: don't evaluate the value of arguments for 'dangerous-default-value' - -- Michal Nowikowski: wrong-spelling-in-comment, wrong-spelling-in-docstring, - parallel execution on multiple CPUs and other patches. - +- Michal Nowikowski: + * wrong-spelling-in-comment + * wrong-spelling-in-docstring + * parallel execution on multiple CPUs - David Lindquist: logging-format-interpolation warning. - -- Brett Cannon: Port source code to be Python 2/3 compatible, Python 3 - checker. - +- Brett Cannon: + * Port source code to be Python 2/3 compatible + * Python 3 checker - Vlad Temian: redundant-unittest-assert and the JSON reporter. - - Cosmin Poieană: unichr-builtin and improvements to bad-open-mode. - - Viorel Știrbu: intern-builtin warning. - - Dan Goldsmith: support for msg-template in HTML reporter. - - Chris Rebert: unidiomatic-typecheck. - - Steven Myint: duplicate-except. - - Radu Ciorba: not-context-manager and confusing-with-statement warnings. - - Bruno Daniel: check_docs extension. - - James Morgensen: ignored-modules option applies to import errors. - - Cezar Elnazli: deprecated-method - - Stéphane Wirtel: nonlocal-without-binding - - Laura Medioni (Logilab, on behalf of the CNES): * misplaced-comparison-constant * no-classmethod-decorator @@ -106,11 +85,8 @@ contributors: * ungrouped-imports, * wrong-import-position * redefined-variable-type - - Aru Sahni: Git ignoring, regex-based ignores - - Mike Frysinger - - Moisés López (Vauxoo): * Support for deprecated-modules in modules not installed, * Refactor wrong-import-order to integrate it with `isort` library @@ -118,75 +94,47 @@ contributors: * Refactor wrong-import-position to skip try-import and nested cases * Add consider-merging-isinstance, superfluous-else-return * Fix consider-using-ternary for 'True and True and True or True' case - -- Luis Escobar (Vauxoo), Moisés López (Vauxoo): Add bad-docstring-quotes and docstring-first-line-empty - +- Luis Escobar (Vauxoo): Add bad-docstring-quotes and docstring-first-line-empty +- Moisés López (Vauxoo): Add bad-docstring-quotes and docstring-first-line-empty - Yannick Brehon - -- Glenn Matthews: autogenerated documentation for optional extensions, - bug fixes and enhancements for docparams (née check_docs) extension - +- Glenn Matthews: + * autogenerated documentation for optional extensions, + * bug fixes and enhancements for docparams (née check_docs) extension - Elias Dorneles: minor adjust to config defaults and docs - - Yuri Bochkarev: Added epytext support to docparams extension. - -- Alexander Todorov: added new error conditions to 'bad-super-call', +- Alexander Todorov: + * added new error conditions to 'bad-super-call', * Added new check for incorrect len(SEQUENCE) usage, * Added new extension for comparison against empty string constants, * Added new extension which detects comparing integers to zero, * Added new useless-return checker, * Added new try-except-raise checker - -- Erik Eriksson - Added overlapping-except error check. - +- Erik Eriksson: Added overlapping-except error check. - Anthony Foglia (Google): Added simple string slots check. - - Derek Gustafson - - Petr Pulc: require whitespace around annotations - - John Paraskevopoulos: add 'differing-param-doc' and 'differing-type-doc' - - Martin von Gagern (Google): Added 'raising-format-tuple' warning. - -- Ahirnish Pareek, 'keyword-arg-before-var-arg' check - +- Ahirnish Pareek: 'keyword-arg-before-var-arg' check - Daniel Miller - - Martin Bašti * Added new check for shallow copy of os.environ * Added new check for useless `with threading.Lock():` statement - - Jacques Kvam - - Brian Shaginaw: prevent error on exception check for functions - - Ioana Tagirta: fix bad thread instantiation check - - Reverb Chu - - Tobias Hernstig - - Konstantin Manna - - Andreas Freimuth: fix indentation checking with tabs - - Renat Galimov - - Thomas Snowden: fix missing-docstring for inner functions - - Mitchell Young: minor adjustment to docparams - - Marianna Polatoglou: minor contribution for wildcard import check - - Ben Green - - Benjamin Freeman - - Fureigh - - Jace Browning: updated default report format with clickable paths - - Sushobhit (sushobhit27) * Added new check 'comparison-with-itself'. * Added new check 'useless-import-alias'. @@ -195,404 +143,215 @@ contributors: * Removed six package dependency. * Added new check 'chained-comparison'. * Added new check 'useless-object-inheritance'. - - Mariatta Wijaya * Added new check `logging-fstring-interpolation` * Documentation typo fixes - - Jason Owen - - Mark Roman Miller: fix inline defs in too-many-statements - - Adam Dangoor - - Gary Tyler McLeod - -- Wolfgang Grafen, Axel Muller, Fabio Zadrozny, Pierre Rouleau, - Maarten ter Huurne, Mirko Friedenhagen and all the Logilab's team (among others). - +- Wolfgang Grafen +- Axel Muller +- Fabio Zadrozny +- Pierre Rouleau, +- Maarten ter Huurne +- Mirko Friedenhagen - Matej Marusak - -- Nick Drozd, performance improvements to astroid - +- Nick Drozd: performance improvements to astroid - Kosarchuk Sergey - - Kurian Benoy - - Carey Metcalfe: demoted `try-except-raise` from error to warning - - Marcus Näslund (naslundx) - - Natalie Serebryakova - - Caio Carrara - - Roberto Leinardi: PyCharm plugin maintainer - - Aivar Annamaa - - Hornwitser: fix import graph - - Yuri Gribov - - Drew Risinger - - Ben James - -- Tomer Chachamu, Richard Goodman: simplifiable-if-expression - +- Tomer Chachamu: simplifiable-if-expression +- Richard Goodman: simplifiable-if-expression - Alan Chan - - Benjamin Drung: contributing Debian Developer - - Scott Worley - - Michael Hudson-Doyle - - Lucas Cimon - - Mike Miller - - Sergei Lebedev - - Sasha Bagan - - Pablo Galindo Salgado * Fix false positive 'Non-iterable value' with async comprehensions. - - Matus Valo - - Sardorbek Imomaliev - - Justin Li (justinnhli) - - Nicolas Dickreuter - - Pascal Corpet - - Svetoslav Neykov - - Federico Bond - - Fantix King (UChicago) - - Yory (yory8) - - Thomas Hisch - - Clément Pit-Claudel - - Goudcode - - Paul Renvoise - - Bluesheeptoken - - Michael Scott Cuthbert - - Nathan Marrow - - Taewon Kim - - Daniil Kharkov - - Tyler N. Thieding - - Zeb Nicholls * Made W9011 compatible with 'of' syntax in return types - - Martin Vielsmaier - - Agustin Toledo - - Nicholas Smith - - Peter Kolbus (Garmin) - - Oisin Moran - - Andrzej Klajnert - - Andrés Pérez Hortal - - Niko Wenselowski - - Danny Hermes - - Eric Froemling - - Robert Schweizer - - Hugo van Kemenade - - Mikhail Fesenko - - Trevor Bekolay * Added --list-msgs-enabled command - - Rémi Cardona - - Daniel Draper - -- Gabriel R. Sezefredo - * Fixed "exception-escape" false positive with generators - +- Gabriel R. Sezefredo: Fixed "exception-escape" false positive with generators - laike9m - - Janne Rönkkö - - Hugues Bruant - - Tim Gates - - Enji Cooper - - Bastien Vallet - - Pek Chhan - - Craig Henriques - - Matthijs Blom - - Andy Palmer - - Wes Turner (Google): added new check 'inconsistent-quotes' - -- Athos Ribeiro - Fixed dict-keys-not-iterating false positive for inverse containment checks - +- Athos Ribeiro: Fixed dict-keys-not-iterating false positive for inverse containment checks - Anubhav - - Ben Graham - - Anthony Tan - - Benny Müller - - Bernie Gray - - Slavfox - - Matthew Beckers (mattlbeck) - - Yang Yang - - Andrew J. Simmons (anjsimmo) - - Damien Baty - - Daniel R. Neal (danrneal) - - Jeremy Fleischman (jfly) - - Shiv Venkatasubrahmanyam - - Jochen Preusche (iilei) - - Ram Rachum (cool-RR) - - D. Alphus (Alphadelta14) - - Pieter Engelbrecht - - Ethan Leba - - Matěj Grabovský - - Yeting Li (yetingli) - - Frost Ming (frostming) - - Luigi Bertaco Cristofolini (luigibertaco) - - Eli Fine (eli88fine): Fixed false positive duplicate code warning for lines with symbols only - - Ganden Schaffner - - Josselin Feist - - David Cain - - Pedro Algarvio (s0undt3ch) - - Luigi Bertaco Cristofolini (luigibertaco) - - Or Bahari - - Joshua Cannon - - Giuseppe Valente - - Takashi Hirashima - - Joffrey Mander - - Julien Palard - - Raphael Gaschignard - - Sorin Sbarnea - - Gergely Kalmár - - Batuhan Taskaya - - Frank Harrison (doublethefish) - - Gauthier Sebaux - - Logan Miller (komodo472) - - Matthew Suozzo - - David Gilman - -- Ikraduya Edian - * Added new checks 'consider-using-generator' and 'use-a-generator'. - +- Ikraduya Edian: Added new checks 'consider-using-generator' and 'use-a-generator'. - Tiago Honorato - - Lefteris Karapetsas - - Louis Sautier - - Quentin Young - - Alexander Kapshuna - - Mark Byrne - - Konstantina Saketou - - Andrew Howe - - James Sinclair (irgeek) - -- Aidan Haase, Elizabeth Bott - +- Aidan Haase +- Elizabeth Bott - Sebastian Müller - - Ramiro Leal-Cavazos (ramiro050): Fixed bug preventing pylint from working with emacs tramp - - manderj - - qwiddle - - das-intensity - - Jiajunsu (victor) - - Andrew Haigh (nelfin) - - Aditya Gupta (adityagupta1089) * Added ignore_signatures to duplicate checker - - ruro - - David Liu (david-yz-liu) - - Bernard Nauwelaerts - - Fabian Damken - - Markus Siebenhaar - - Lorena Buciu (lorena-b) - - Sergei Lebedev (superbobry) - - Maksym Humetskyi (mhumetskyi) * Fixed ignored empty functions by similarities checker with "ignore-signatures" option enabled * Ignore function decorators signatures as well by similarities checker with "ignore-signatures" option enabled * Ignore class methods and nested functions signatures as well by similarities checker with "ignore-signatures" option enabled - - Daniel Dorani (doranid) - - Will Shanks - - Mark Bell - -- Marco Gorelli - * Documented Jupyter integration - +- Marco Gorelli: Documented Jupyter integration - Rebecca Turner (9999years) - - Yilei Yang - - Marcin Kurczewski (rr-) - -- Tanvi Moharir - * Fix for invalid toml config - +- Tanvi Moharir: Fix for invalid toml config - Eisuke Kawashima (e-kwsm) - - Michal Vasilek - - Kai Mueller (kasium) - - Sam Vermeiren (PaaEl) - - Phil A. (flying-sheep) - - Melvin Hazeleger (melvio) - - Hayden Richards (SupImDos) * Fixed "no-self-use" for async methods * Fixed "docparams" extension for async functions and methods - - Jeroen Seegers (jeroenseegers) * Fixed `toml` dependency issue - - Tim Martin - - Jaehoon Hwang (jaehoonhwang) - - Samuel Forestier - - Nick Pesce - - James DesLauriers - - Youngsoo Sung - - Samuel Freilich (sfreilich) - - Mike Fiedler (miketheman) - - Takahide Nojima - - Tushar Sadhwani (tusharsadhwani) - - Ikraduya Edian - - Antonio Quarta (sgheppy) - - Harshil (harshil21) - - Jérome Perrin (perrinjerome) - - Felix von Drigalski (felixvd) - - Jake Lishman (jakelishman) - - Philipp Albrecht (pylbrecht) - - Allan Chandler (allanc65) * Fixed issue 5452, false positive missing-param-doc for multi-line Google-style params - - Eero Vuojolahti - - Kian-Meng, Ang - - Nuzula H. Yudaka (Nuzhuka) - - Carli Freudenberg (CarliJoy) * Fixed issue 5281, added Unicode checker * Improve non-ascii-name checker - - Daniel Brookman - - Téo Bouvard - - Konrad Weihmann From 663a2be7abd407fc680f426155ba26becaaa278d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sun, 13 Mar 2022 13:15:46 +0100 Subject: [PATCH 048/473] Upgrade ``pydocstringformatter`` to ``0.5.0`` (#5910) --- .pre-commit-config.yaml | 4 +- doc/exts/pylint_messages.py | 2 + pylint/checkers/__init__.py | 5 ++- pylint/checkers/base.py | 18 ++++++--- pylint/checkers/base_checker.py | 6 ++- pylint/checkers/classes/class_checker.py | 19 +++++++--- pylint/checkers/deprecated.py | 6 ++- pylint/checkers/design_analysis.py | 4 +- pylint/checkers/ellipsis_checker.py | 3 +- pylint/checkers/exceptions.py | 1 + pylint/checkers/format.py | 8 +++- pylint/checkers/imports.py | 4 +- pylint/checkers/misc.py | 4 +- pylint/checkers/newstyle.py | 3 +- pylint/checkers/raw_metrics.py | 4 +- .../implicit_booleaness_checker.py | 3 +- .../refactoring/refactoring_checker.py | 7 +++- pylint/checkers/similar.py | 26 ++++++++----- pylint/checkers/stdlib.py | 4 +- pylint/checkers/strings.py | 1 + pylint/checkers/typecheck.py | 5 ++- pylint/checkers/utils.py | 30 +++++++++------ pylint/checkers/variables.py | 37 +++++++++++-------- pylint/extensions/_check_docs_utils.py | 4 +- pylint/extensions/code_style.py | 1 + pylint/extensions/comparetozero.py | 1 + pylint/extensions/docparams.py | 6 +-- pylint/extensions/emptystring.py | 1 + pylint/extensions/eq_without_hash.py | 7 ++-- pylint/extensions/overlapping_exceptions.py | 1 + pylint/extensions/typing.py | 5 ++- pylint/graph.py | 11 +++--- pylint/lint/expand_modules.py | 4 +- pylint/lint/parallel.py | 3 +- pylint/lint/run.py | 4 +- pylint/pyreverse/dot_printer.py | 5 ++- pylint/pyreverse/inspector.py | 1 + pylint/pyreverse/mermaidjs_printer.py | 5 ++- pylint/pyreverse/plantuml_printer.py | 5 ++- pylint/pyreverse/printer.py | 5 ++- pylint/pyreverse/utils.py | 1 + pylint/pyreverse/vcg_printer.py | 6 ++- pylint/reporters/multi_reporter.py | 7 ++-- pylint/testutils/output_line.py | 10 +++-- pylint/testutils/pyreverse.py | 1 + pylint/utils/utils.py | 2 +- 46 files changed, 199 insertions(+), 101 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f4ace61f43..039f220c6c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -95,7 +95,9 @@ repos: args: [--prose-wrap=always, --print-width=88] exclude: tests(/.*)*/data - repo: https://github.com/DanielNoord/pydocstringformatter - rev: a9f94bf13b08fe33f784ed7f0a0fc39e2a8549e2 + rev: v0.5.0 hooks: - id: pydocstringformatter exclude: *fixtures + args: ["--max-summary-lines=2", "--split-summary-body", "-w"] + files: "pylint" diff --git a/doc/exts/pylint_messages.py b/doc/exts/pylint_messages.py index 1ca3bdb88a..7f910918f4 100644 --- a/doc/exts/pylint_messages.py +++ b/doc/exts/pylint_messages.py @@ -52,6 +52,7 @@ def _get_all_messages( ) -> Tuple[MessagesDict, OldMessagesDict]: """Get all messages registered to a linter and return a dictionary indexed by message type. + Also return a dictionary of old message and the new messages they can be mapped to. """ messages_dict: MessagesDict = { @@ -202,6 +203,7 @@ def _write_redirect_pages(old_messages: OldMessagesDict) -> None: # pylint: disable-next=unused-argument def build_messages_pages(app: Optional[Sphinx]) -> None: """Overwrite messages files by printing the documentation to a stream. + Documentation is written in ReST format. """ # Create linter, register all checkers and extensions and get all messages diff --git a/pylint/checkers/__init__.py b/pylint/checkers/__init__.py index ab23b6b592..160bad8af2 100644 --- a/pylint/checkers/__init__.py +++ b/pylint/checkers/__init__.py @@ -77,8 +77,9 @@ def table_lines_from_stats( stat_type: Literal["duplicated_lines", "message_types"], ) -> List[str]: """Get values listed in from and , - and return a formatted list of values, designed to be given to a - ureport.Table object + and return a formatted list of values. + + The return value is designed to be given to a ureport.Table object """ lines: List[str] = [] if stat_type == "duplicated_lines": diff --git a/pylint/checkers/base.py b/pylint/checkers/base.py index 71dabd8efc..cd678b6cb7 100644 --- a/pylint/checkers/base.py +++ b/pylint/checkers/base.py @@ -102,8 +102,7 @@ class NamingStyle: """It may seem counterintuitive that single naming style has multiple "accepted" - forms of regular expressions, but we need to special-case stuff like dunder names - in method names. + forms of regular expressions, but we need to special-case stuff like dunder names in method names. """ ANY: Pattern[str] = re.compile(".*") @@ -234,6 +233,7 @@ class AnyStyle(NamingStyle): def _redefines_import(node): """Detect that the given node (AssignName) is inside an exception handler and redefines an import from the tryexcept body. + Returns True if the node redefines an import, False otherwise. """ current = node @@ -940,7 +940,9 @@ def _check_redefinition(self, redeftype, node): class BasicChecker(_BasicChecker): - """Checks for : + """Basic checker. + + Checks for : * doc strings * number of arguments, local variables, branches, returns and statements in functions, methods @@ -1360,7 +1362,9 @@ def is_iterable(internal_node): @utils.check_messages("unreachable", "lost-exception") def visit_return(self, node: nodes.Return) -> None: - """1 - check if the node has a right sibling (if so, that's some + """Return node visitor. + + 1 - check if the node has a right sibling (if so, that's some unreachable code) 2 - check if the node is inside the 'finally' clause of a 'try...finally' block @@ -1378,7 +1382,9 @@ def visit_continue(self, node: nodes.Continue) -> None: @utils.check_messages("unreachable", "lost-exception") def visit_break(self, node: nodes.Break) -> None: - """1 - check if the node has a right sibling (if so, that's some + """Break node visitor. + + 1 - check if the node has a right sibling (if so, that's some unreachable code) 2 - check if the node is inside the 'finally' clause of a 'try...finally' block @@ -1495,6 +1501,7 @@ def _check_unreachable(self, node): def _check_not_in_finally(self, node, node_name, breaker_classes=()): """Check that a node is not inside a 'finally' clause of a 'try...finally' statement. + If we find a parent which type is in breaker_classes before a 'try...finally' block we skip the whole check. """ @@ -2561,6 +2568,7 @@ def _check_literal_comparison(self, literal, node: nodes.Compare): def _check_logical_tautology(self, node: nodes.Compare): """Check if identifier is compared against itself. + :param node: Compare node :Example: val = 786 diff --git a/pylint/checkers/base_checker.py b/pylint/checkers/base_checker.py index 10e990f935..376e785450 100644 --- a/pylint/checkers/base_checker.py +++ b/pylint/checkers/base_checker.py @@ -67,8 +67,10 @@ def __repr__(self): return f"{status} '{self.name}' (responsible for '{msgs}')" def __str__(self): - """This might be incomplete because multiple class inheriting BaseChecker - can have the same name. Cf MessageHandlerMixIn.get_full_documentation() + """This might be incomplete because multiple classes inheriting BaseChecker + can have the same name. + + See: MessageHandlerMixIn.get_full_documentation() """ return self.get_full_documentation( msgs=self.msgs, options=self.options_and_values(), reports=self.reports diff --git a/pylint/checkers/classes/class_checker.py b/pylint/checkers/classes/class_checker.py index dd9a0b31ce..63078cf421 100644 --- a/pylint/checkers/classes/class_checker.py +++ b/pylint/checkers/classes/class_checker.py @@ -362,7 +362,9 @@ def _has_data_descriptor(cls, attr): def _called_in_methods(func, klass, methods): """Check if the func was called in any of the given methods, - belonging to the *klass*. Returns True if so, False otherwise. + belonging to the *klass*. + + Returns True if so, False otherwise. """ if not isinstance(func, nodes.FunctionDef): return False @@ -697,7 +699,9 @@ def accessed(self, scope): class ClassChecker(BaseChecker): - """Checks for : + """Checker for class nodes. + + Checks for : * methods without self as first argument * overridden methods signature * access only to existent members via self @@ -876,7 +880,8 @@ def _check_typing_final(self, node: nodes.ClassDef) -> None: @check_messages("unused-private-member", "attribute-defined-outside-init") def leave_classdef(self, node: nodes.ClassDef) -> None: - """Close a class node: + """Checker for Class nodes. + check that instance attributes are defined in __init__ and check access to existent members """ @@ -1463,7 +1468,9 @@ def leave_functiondef(self, node: nodes.FunctionDef) -> None: def visit_attribute(self, node: nodes.Attribute) -> None: """Check if the getattr is an access to a class member - if so, register it. Also check for access to protected + if so, register it + + Also check for access to protected class member from outside its class (but ignore __special__ methods) """ @@ -1617,7 +1624,9 @@ def _check_classmethod_declaration(self, node): def _check_protected_attribute_access(self, node: nodes.Attribute): """Given an attribute access node (set or get), check if attribute - access is legitimate. Call _check_first_attr with node before calling + access is legitimate. + + Call _check_first_attr with node before calling this method. Valid cases are: * self._attr in a method or cls._attr in a classmethod. Checked by _check_first_attr. diff --git a/pylint/checkers/deprecated.py b/pylint/checkers/deprecated.py index dc0713a89e..dd75547b95 100644 --- a/pylint/checkers/deprecated.py +++ b/pylint/checkers/deprecated.py @@ -22,6 +22,7 @@ class DeprecatedMixin(BaseChecker): """A mixin implementing logic for checking deprecated symbols. + A class implementing mixin must define "deprecated-method" Message. """ @@ -180,8 +181,9 @@ def check_deprecated_module(self, node, mod_path): self.add_message("deprecated-module", node=node, args=mod_path) def check_deprecated_method(self, node, inferred): - """Executes the checker for the given node. This method should - be called from the checker implementing this mixin. + """Executes the checker for the given node. + + This method should be called from the checker implementing this mixin. """ # Reject nodes which aren't of interest to us. diff --git a/pylint/checkers/design_analysis.py b/pylint/checkers/design_analysis.py index 37cd16c571..46bd443a2e 100644 --- a/pylint/checkers/design_analysis.py +++ b/pylint/checkers/design_analysis.py @@ -298,7 +298,9 @@ def _get_parents( class MisdesignChecker(BaseChecker): - """Checks for sign of poor/misdesign: + """Checker of potential misdesigns. + + Checks for sign of poor/misdesign: * number of methods, attributes, local variables... * size, complexity of functions, methods """ diff --git a/pylint/checkers/ellipsis_checker.py b/pylint/checkers/ellipsis_checker.py index f29ebed042..1261485b82 100644 --- a/pylint/checkers/ellipsis_checker.py +++ b/pylint/checkers/ellipsis_checker.py @@ -28,7 +28,8 @@ class EllipsisChecker(BaseChecker): @check_messages("unnecessary-ellipsis") def visit_const(self, node: nodes.Const) -> None: """Check if the ellipsis constant is used unnecessarily. - Emit a warning when: + + Emits a warning when: - A line consisting of an ellipsis is preceded by a docstring. - A statement exists in the same scope as the ellipsis. For example: A function consisting of an ellipsis followed by a diff --git a/pylint/checkers/exceptions.py b/pylint/checkers/exceptions.py index 9960b8d32e..58d273ca2e 100644 --- a/pylint/checkers/exceptions.py +++ b/pylint/checkers/exceptions.py @@ -58,6 +58,7 @@ def predicate(obj): def _annotated_unpack_infer(stmt, context=None): """Recursively generate nodes inferred by the given statement. + If the inferred value is a list or a tuple, recurse on the elements. Returns an iterator which yields tuples in the format ('original node', 'inferred node'). diff --git a/pylint/checkers/format.py b/pylint/checkers/format.py index 799d97cbc5..716dce4cba 100644 --- a/pylint/checkers/format.py +++ b/pylint/checkers/format.py @@ -237,7 +237,9 @@ def line(self, idx): class FormatChecker(BaseTokenChecker): - """Checks for : + """Formatting checker. + + Checks for : * unauthorized constructions * strict indentation * line length @@ -739,7 +741,9 @@ def specific_splitlines(lines: str) -> List[str]: return res def check_lines(self, lines: str, lineno: int) -> None: - """Check lines have : + """Check given lines for potential messages. + + Check lines have : - a final newline - no trailing whitespace - less than a maximum number of characters diff --git a/pylint/checkers/imports.py b/pylint/checkers/imports.py index 689573b211..f9422f9b32 100644 --- a/pylint/checkers/imports.py +++ b/pylint/checkers/imports.py @@ -300,7 +300,9 @@ def _make_graph( class ImportsChecker(DeprecatedMixin, BaseChecker): - """Checks for + """BaseChecker for import statements. + + Checks for * external modules dependencies * relative / wildcard imports * cyclic imports diff --git a/pylint/checkers/misc.py b/pylint/checkers/misc.py index baec58fbbf..6461975ae4 100644 --- a/pylint/checkers/misc.py +++ b/pylint/checkers/misc.py @@ -76,7 +76,9 @@ def process_module(self, node: nodes.Module) -> None: class EncodingChecker(BaseChecker): - """Checks for: + """BaseChecker for encoding issues. + + Checks for: * warning notes in the code like FIXME, XXX * encoding issues. """ diff --git a/pylint/checkers/newstyle.py b/pylint/checkers/newstyle.py index 00fa0748e3..eb8473d09f 100644 --- a/pylint/checkers/newstyle.py +++ b/pylint/checkers/newstyle.py @@ -45,7 +45,8 @@ class NewStyleConflictChecker(BaseChecker): """Checks for usage of new style capabilities on old style classes and - other new/old styles conflicts problems + other new/old styles conflicts problems. + * use of property, __slots__, super * "super" usage """ diff --git a/pylint/checkers/raw_metrics.py b/pylint/checkers/raw_metrics.py index 84e6c23c47..dae296ec84 100644 --- a/pylint/checkers/raw_metrics.py +++ b/pylint/checkers/raw_metrics.py @@ -60,7 +60,9 @@ def report_raw_stats( class RawMetricsChecker(BaseTokenChecker): - """Does not check anything but gives some raw metrics : + """Checker that provides raw metrics instead of checking anything. + + Provides: * total number of lines * total number of code lines * total number of docstring lines diff --git a/pylint/checkers/refactoring/implicit_booleaness_checker.py b/pylint/checkers/refactoring/implicit_booleaness_checker.py index b1fa672788..e9482f6b71 100644 --- a/pylint/checkers/refactoring/implicit_booleaness_checker.py +++ b/pylint/checkers/refactoring/implicit_booleaness_checker.py @@ -128,8 +128,7 @@ def instance_has_bool(class_def: nodes.ClassDef) -> bool: @utils.check_messages("use-implicit-booleaness-not-len") def visit_unaryop(self, node: nodes.UnaryOp) -> None: """`not len(S)` must become `not S` regardless if the parent block - is a test condition or something else (boolean expression) - e.g. `if not len(S):` + is a test condition or something else (boolean expression) e.g. `if not len(S):` """ if ( isinstance(node, nodes.UnaryOp) diff --git a/pylint/checkers/refactoring/refactoring_checker.py b/pylint/checkers/refactoring/refactoring_checker.py index 07fcff802c..00e234cbd6 100644 --- a/pylint/checkers/refactoring/refactoring_checker.py +++ b/pylint/checkers/refactoring/refactoring_checker.py @@ -1531,6 +1531,7 @@ def _check_use_list_or_dict_literal(self, node: nodes.Call) -> None: def _check_consider_using_join(self, aug_assign): """We start with the augmented assignment and work our way upwards. + Names of variables for nodes if match successful: result = '' # assign for number in ['1', '2', '3'] # for_loop @@ -1824,7 +1825,7 @@ def _has_return_in_siblings(node: nodes.NodeNG) -> bool: return False def _is_function_def_never_returning(self, node: nodes.FunctionDef) -> bool: - """Return True if the function never returns. False otherwise. + """Return True if the function never returns, False otherwise. Args: node (nodes.FunctionDef): function definition node to be analyzed. @@ -1846,7 +1847,9 @@ def _is_function_def_never_returning(self, node: nodes.FunctionDef) -> bool: def _check_return_at_the_end(self, node): """Check for presence of a *single* return statement at the end of a - function. "return" or "return None" are useless because None is the + function. + + "return" or "return None" are useless because None is the default return type if they are missing. NOTE: produces a message only if there is a single return statement diff --git a/pylint/checkers/similar.py b/pylint/checkers/similar.py index 5287e31279..8e6eee92d5 100644 --- a/pylint/checkers/similar.py +++ b/pylint/checkers/similar.py @@ -109,9 +109,8 @@ class LineSpecifs(NamedTuple): class CplSuccessiveLinesLimits: - """This class holds a couple of SuccessiveLinesLimits objects, one for each file compared, - and a counter on the number of common lines between both stripped lines collections extracted - from both files + """Holds a SuccessiveLinesLimits object for each file compared and a + counter on the number of common lines between both stripped lines collections extracted from both files """ __slots__ = ("first_file", "second_file", "effective_cmn_lines_nb") @@ -230,7 +229,9 @@ def increment(self, value: Index) -> "LineSetStartCouple": def hash_lineset( lineset: "LineSet", min_common_lines: int = DEFAULT_MIN_SIMILARITY_LINE ) -> Tuple[HashToIndex_T, IndexToLines_T]: - """Return two dicts. The first associates the hash of successive stripped lines of a lineset + """Return two dicts. + + The first associates the hash of successive stripped lines of a lineset to the indices of the starting lines. The second dict, associates the index of the starting line in the lineset's stripped lines to the couple [start, end] lines number in the corresponding file. @@ -318,9 +319,12 @@ def filter_noncode_lines( stindex_2: Index, common_lines_nb: int, ) -> int: - """Return the effective number of common lines between lineset1 and lineset2 filtered from non code lines, that is to say the number of - common successive stripped lines except those that do not contain code (for example a ligne with only an - ending parathensis) + """Return the effective number of common lines between lineset1 + and lineset2 filtered from non code lines. + + That is to say the number of common successive stripped + lines except those that do not contain code (for example + a line with only an ending parathensis) :param ls_1: first lineset :param stindex_1: first lineset starting index @@ -665,6 +669,7 @@ def _get_functions( @functools.total_ordering class LineSet: """Holds and indexes all the lines of a single source file. + Allows for correspondence between real lines of the source file and stripped ones, which are the real ones from which undesired patterns have been removed. """ @@ -737,9 +742,10 @@ def report_similarities( # wrapper to get a pylint checker from the similar class class SimilarChecker(BaseChecker, Similar, MapReduceMixin): - """Checks for similarities and duplicated code. This computation may be - memory / CPU intensive, so you should disable it if you experiment some - problems. + """Checks for similarities and duplicated code. + + This computation may be memory / CPU intensive, so you + should disable it if you experiment some problems. """ __implements__ = (IRawChecker,) diff --git a/pylint/checkers/stdlib.py b/pylint/checkers/stdlib.py index 3884fc32e4..5b4670803e 100644 --- a/pylint/checkers/stdlib.py +++ b/pylint/checkers/stdlib.py @@ -646,9 +646,7 @@ def _check_redundant_assert(self, node, infer): ) def _check_datetime(self, node): - """Check that a datetime was inferred. - If so, emit boolean-datetime warning. - """ + """Check that a datetime was inferred, if so, emit boolean-datetime warning.""" try: inferred = next(node.infer()) except astroid.InferenceError: diff --git a/pylint/checkers/strings.py b/pylint/checkers/strings.py index e89e8db5f3..3b2ed51068 100644 --- a/pylint/checkers/strings.py +++ b/pylint/checkers/strings.py @@ -933,6 +933,7 @@ def register(linter: "PyLinter") -> None: def str_eval(token): """Mostly replicate `ast.literal_eval(token)` manually to avoid any performance hit. + This supports f-strings, contrary to `ast.literal_eval`. We have to support all string literal notations: https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals diff --git a/pylint/checkers/typecheck.py b/pylint/checkers/typecheck.py index 78e92becb8..d3ab8ca8e4 100644 --- a/pylint/checkers/typecheck.py +++ b/pylint/checkers/typecheck.py @@ -1289,6 +1289,7 @@ def _check_uninferable_call(self, node): def _check_argument_order(self, node, call_site, called, called_param_names): """Match the supplied argument names against the function parameters. + Warn if some argument names are not in the same order as they are in the function signature. """ @@ -1339,8 +1340,7 @@ def _check_isinstance_args(self, node): @check_messages(*(list(MSGS.keys()))) def visit_call(self, node: nodes.Call) -> None: """Check that called functions/methods are inferred to callable objects, - and that the arguments passed to the function match the parameters in - the inferred function's definition + and that passed arguments match the parameters in the inferred function. """ called = safe_infer(node.func) @@ -2001,6 +2001,7 @@ def visit_for(self, node: nodes.For) -> None: class IterableChecker(BaseChecker): """Checks for non-iterables used in an iterable context. + Contexts include: - for-statement - starargs in function call diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py index 026a78b5e7..4cc413e5c3 100644 --- a/pylint/checkers/utils.py +++ b/pylint/checkers/utils.py @@ -512,8 +512,9 @@ def __init__(self, index): def parse_format_string( format_string: str, ) -> Tuple[Set[str], int, Dict[str, str], List[str]]: - """Parses a format string, returning a tuple of (keys, num_args), where 'keys' - is the set of mapping keys in the format string, and 'num_args' is the number + """Parses a format string, returning a tuple (keys, num_args). + + Where 'keys' is the set of mapping keys in the format string, and 'num_args' is the number of arguments required by the format string. Raises IncompleteFormatString or UnsupportedFormatCharacter if a parse error occurs. """ @@ -593,8 +594,9 @@ def split_format_field_names(format_string) -> Tuple[str, Iterable[Tuple[bool, s def collect_string_fields(format_string) -> Iterable[Optional[str]]: """Given a format string, return an iterator - of all the valid format fields. It handles nested fields - as well. + of all the valid format fields. + + It handles nested fields as well. """ formatter = string.Formatter() try: @@ -627,8 +629,9 @@ def parse_format_method_string( format_string: str, ) -> Tuple[List[Tuple[str, List[Tuple[bool, str]]]], int, int]: """Parses a PEP 3101 format string, returning a tuple of - (keyword_arguments, implicit_pos_args_cnt, explicit_pos_args), - where keyword_arguments is the set of mapping keys in the format string, implicit_pos_args_cnt + (keyword_arguments, implicit_pos_args_cnt, explicit_pos_args). + + keyword_arguments is the set of mapping keys in the format string, implicit_pos_args_cnt is the number of arguments required by the format string and explicit_pos_args is the number of arguments passed with the position. """ @@ -1045,8 +1048,8 @@ def get_exception_handlers( def is_node_inside_try_except(node: nodes.Raise) -> bool: - """Check if the node is directly under a Try/Except statement. - (but not under an ExceptHandler!) + """Check if the node is directly under a Try/Except statement + (but not under an ExceptHandler!). Args: node (nodes.Raise): the node raising the exception. @@ -1366,7 +1369,9 @@ def is_registered_in_singledispatch_function(node: nodes.FunctionDef) -> bool: def get_node_last_lineno(node: nodes.NodeNG) -> int: - """Get the last lineno of the given node. For a simple statement this will just be node.lineno, + """Get the last lineno of the given node. + + For a simple statement this will just be node.lineno, but for a node that has child statements (e.g. a method) this will be the lineno of the last child statement recursively. """ @@ -1438,6 +1443,7 @@ def is_node_in_type_annotation_context(node: nodes.NodeNG) -> bool: def is_subclass_of(child: nodes.ClassDef, parent: nodes.ClassDef) -> bool: """Check if first node is a subclass of second node. + :param child: Node to check for subclass. :param parent: Node to check for superclass. :returns: True if child is derived from parent. False otherwise. @@ -1658,6 +1664,7 @@ def is_typing_guard(node: nodes.If) -> bool: def is_node_in_guarded_import_block(node: nodes.NodeNG) -> bool: """Return True if node is part for guarded if block. + I.e. `sys.version_info` or `typing.TYPE_CHECKING` """ return isinstance(node.parent, nodes.If) and ( @@ -1731,8 +1738,9 @@ def get_node_first_ancestor_of_type_and_its_child( node: nodes.NodeNG, ancestor_type: Union[Type[T_Node], Tuple[Type[T_Node], ...]] ) -> Union[Tuple[None, None], Tuple[T_Node, nodes.NodeNG]]: """Modified version of get_node_first_ancestor_of_type to also return the - descendant visited directly before reaching the sought ancestor. Useful - for extracting whether a statement is guarded by a try, except, or finally + descendant visited directly before reaching the sought ancestor + + Useful for extracting whether a statement is guarded by a try, except, or finally when searching for a TryFinally ancestor. """ child = node diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index b61c5a68ae..d4663e37ba 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -310,7 +310,9 @@ def _infer_name_module(node, name): def _fix_dot_imports(not_consumed): """Try to fix imports with multiple dots, by returning a dictionary - with the import names expanded. The function unflattens root imports, + with the import names expanded. + + The function unflattens root imports, like 'xml' (when we have both 'xml.etree' and 'xml.sax'), to 'xml.etree' and 'xml.sax' respectively. """ @@ -351,8 +353,9 @@ def _fix_dot_imports(not_consumed): def _find_frame_imports(name, frame): - """Detect imports in the frame, with the required - *name*. Such imports can be considered assignments. + """Detect imports in the frame, with the required *name*. + + Such imports can be considered assignments. Returns True if an import for the given name was found. """ imports = frame.nodes_of_class((nodes.Import, nodes.ImportFrom)) @@ -603,6 +606,7 @@ def consumed(self): def consumed_uncertain(self) -> DefaultDict[str, List[nodes.NodeNG]]: """Retrieves nodes filtered out by get_next_to_consume() that may not have executed, such as statements in except blocks, or statements + in try blocks (when evaluating their corresponding except and finally blocks). Checkers that want to treat the statements as executed (e.g. for unused-variable) may need to add them back. @@ -615,6 +619,7 @@ def scope_type(self): def mark_as_consumed(self, name, consumed_nodes): """Mark the given nodes as consumed for the name. + If all of the nodes for the name were consumed, delete the name from the to_consume dictionary """ @@ -627,8 +632,9 @@ def mark_as_consumed(self, name, consumed_nodes): del self.to_consume[name] def get_next_to_consume(self, node: nodes.Name) -> Optional[List[nodes.NodeNG]]: - """Return a list of the nodes that define `node` from this scope. If it is - uncertain whether a node will be consumed, such as for statements in + """Return a list of the nodes that define `node` from this scope. + + If it is uncertain whether a node will be consumed, such as for statements in except blocks, add it to self.consumed_uncertain instead of returning it. Return None to indicate a special case that needs to be handled by the caller. """ @@ -804,6 +810,7 @@ def _check_loop_finishes_via_except( node: nodes.NodeNG, other_node_try_except: nodes.TryExcept ) -> bool: """Check for a case described in https://github.com/PyCQA/pylint/issues/5683. + It consists of a specific control flow scenario where the only non-break exit from a loop consists of the very except handler we are examining, such that code in the `else` branch of the loop can depend on it @@ -895,9 +902,8 @@ def _recursive_search_for_continue_before_break( def _uncertain_nodes_in_try_blocks_when_evaluating_except_blocks( found_nodes: List[nodes.NodeNG], node_statement: nodes.Statement ) -> List[nodes.NodeNG]: - """Return any nodes in ``found_nodes`` that should be treated as uncertain - because they are in a try block and the ``node_statement`` being evaluated - is in one of its except handlers. + """Return any nodes in ``found_nodes`` that should be treated as uncertain because they + are in a try block and the ``node_statement`` being evaluated is in one of its except handlers. """ uncertain_nodes: List[nodes.NodeNG] = [] closest_except_handler = utils.get_node_first_ancestor_of_type( @@ -994,7 +1000,9 @@ def _uncertain_nodes_in_try_blocks_when_evaluating_finally_blocks( # pylint: disable=too-many-public-methods class VariablesChecker(BaseChecker): - """Checks for + """BaseChecker for variables. + + Checks for * unused variables / imports * undefined variables * redefinition of variable from builtins or from an outer scope @@ -1781,9 +1789,8 @@ def visit_importfrom(self, node: nodes.ImportFrom) -> None: "unbalanced-tuple-unpacking", "unpacking-non-sequence", "self-cls-assignment" ) def visit_assign(self, node: nodes.Assign) -> None: - """Check unbalanced tuple unpacking for assignments - and unpacking non-sequences as well as in case self/cls - get assigned. + """Check unbalanced tuple unpacking for assignments and unpacking + non-sequences as well as in case self/cls get assigned. """ self._check_self_cls_assign(node) if not isinstance(node.targets[0], (nodes.Tuple, nodes.List)): @@ -2485,8 +2492,7 @@ def _has_homonym_in_upper_function_scope( self, node: nodes.Name, index: int ) -> bool: """Return whether there is a node with the same name in the - to_consume dict of an upper scope and if that scope is a - function + to_consume dict of an upper scope and if that scope is a function :param node: node to check for :param index: index of the current consumer inside self._to_consume @@ -2615,8 +2621,7 @@ def _nodes_to_unpack(node: nodes.NodeNG) -> Optional[List[nodes.NodeNG]]: def _check_module_attrs(self, node, module, module_names): """Check that module_names (list of string) are accessible through the - given module - if the latest access name corresponds to a module, return it + given module, if the latest access name corresponds to a module, return it """ while module_names: name = module_names.pop(0) diff --git a/pylint/extensions/_check_docs_utils.py b/pylint/extensions/_check_docs_utils.py index 70b312539e..2e295ca110 100644 --- a/pylint/extensions/_check_docs_utils.py +++ b/pylint/extensions/_check_docs_utils.py @@ -400,7 +400,9 @@ def match_param_docs(self): class EpytextDocstring(SphinxDocstring): - """Epytext is similar to Sphinx. See the docs: + """Epytext is similar to Sphinx. + + See the docs: http://epydoc.sourceforge.net/epytext.html http://epydoc.sourceforge.net/fields.html#fields diff --git a/pylint/extensions/code_style.py b/pylint/extensions/code_style.py index 5a3e3ba17d..d1bb04928a 100644 --- a/pylint/extensions/code_style.py +++ b/pylint/extensions/code_style.py @@ -252,6 +252,7 @@ def _check_prev_sibling_to_if_stmt( prev_sibling: Optional[nodes.NodeNG], name: Optional[str] ) -> TypeGuard[Union[nodes.Assign, nodes.AnnAssign]]: """Check if previous sibling is an assignment with the same name. + Ignore statements which span multiple lines. """ if prev_sibling is None or prev_sibling.tolineno - prev_sibling.fromlineno != 0: diff --git a/pylint/extensions/comparetozero.py b/pylint/extensions/comparetozero.py index 592e15a5b9..0d0865a133 100644 --- a/pylint/extensions/comparetozero.py +++ b/pylint/extensions/comparetozero.py @@ -31,6 +31,7 @@ def _is_constant_zero(node): class CompareToZeroChecker(checkers.BaseChecker): """Checks for comparisons to zero. + Most of the time you should use the fact that integers with a value of 0 are false. An exception to this rule is when 0 is allowed in the program and has a different meaning than None! diff --git a/pylint/extensions/docparams.py b/pylint/extensions/docparams.py index 35324ac041..d618ea4d4d 100644 --- a/pylint/extensions/docparams.py +++ b/pylint/extensions/docparams.py @@ -492,10 +492,8 @@ def check_arguments_in_docstring( warning_node: astroid.NodeNG, accept_no_param_doc: Optional[bool] = None, ): - """Check that all parameters in a function, method or class constructor - on the one hand and the parameters mentioned in the parameter - documentation (e.g. the Sphinx tags 'param' and 'type') on the other - hand are consistent with each other. + """Check that all parameters are consistent with the parameters mentioned + in the parameter documentation (e.g. the Sphinx tags 'param' and 'type'). * Undocumented parameters except 'self' are noticed. * Undocumented parameter types except for 'self' and the ``*`` diff --git a/pylint/extensions/emptystring.py b/pylint/extensions/emptystring.py index 15bdd1e584..096b96ec90 100644 --- a/pylint/extensions/emptystring.py +++ b/pylint/extensions/emptystring.py @@ -26,6 +26,7 @@ class CompareToEmptyStringChecker(checkers.BaseChecker): """Checks for comparisons to empty string. + Most of the time you should use the fact that empty strings are false. An exception to this rule is when an empty string value is allowed in the program and has a different meaning than None! diff --git a/pylint/extensions/eq_without_hash.py b/pylint/extensions/eq_without_hash.py index b0dd6ce46f..aeadac9b33 100644 --- a/pylint/extensions/eq_without_hash.py +++ b/pylint/extensions/eq_without_hash.py @@ -1,9 +1,10 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -"""This is the remnant of the python3 checker. It was removed because -the transition from python 2 to python3 is behind us, but some checks -are still useful in python3 after all. +"""This is the remnant of the python3 checker. + +It was removed because the transition from python 2 to python3 is +behind us, but some checks are still useful in python3 after all. See https://github.com/PyCQA/pylint/issues/5025 """ diff --git a/pylint/extensions/overlapping_exceptions.py b/pylint/extensions/overlapping_exceptions.py index 11c79eb04e..c3bf9aab2e 100644 --- a/pylint/extensions/overlapping_exceptions.py +++ b/pylint/extensions/overlapping_exceptions.py @@ -19,6 +19,7 @@ class OverlappingExceptionsChecker(checkers.BaseChecker): """Checks for two or more exceptions in the same exception handler clause that are identical or parts of the same inheritance hierarchy + (i.e. overlapping). """ diff --git a/pylint/extensions/typing.py b/pylint/extensions/typing.py index b2e6d769d0..07d18fdc7f 100644 --- a/pylint/extensions/typing.py +++ b/pylint/extensions/typing.py @@ -305,8 +305,9 @@ def _check_for_typing_alias( @check_messages("consider-using-alias") def leave_module(self, node: nodes.Module) -> None: """After parsing of module is complete, add messages for - 'consider-using-alias' check. Make sure results are safe - to recommend / collision free. + 'consider-using-alias' check. + + Make sure results are safe to recommend / collision free. """ if self._py39_plus: for msg in self._deprecated_typing_alias_msgs: diff --git a/pylint/graph.py b/pylint/graph.py index f75ce4e641..c35cf8c5da 100644 --- a/pylint/graph.py +++ b/pylint/graph.py @@ -152,7 +152,8 @@ def emit(self, line): def emit_edge(self, name1, name2, **props): """Emit an edge from to . - edge properties: see https://www.graphviz.org/doc/info/attrs.html + + For edge properties: see https://www.graphviz.org/doc/info/attrs.html """ attrs = [f'{prop}="{value}"' for prop, value in props.items()] n_from, n_to = normalize_node_id(name1), normalize_node_id(name2) @@ -160,7 +161,8 @@ def emit_edge(self, name1, name2, **props): def emit_node(self, name, **props): """Emit a node with given properties. - node properties: see https://www.graphviz.org/doc/info/attrs.html + + For node properties: see https://www.graphviz.org/doc/info/attrs.html """ attrs = [f'{prop}="{value}"' for prop, value in props.items()] self.emit(f"{normalize_node_id(name)} [{', '.join(sorted(attrs))}];") @@ -172,9 +174,8 @@ def normalize_node_id(nid): def get_cycles(graph_dict, vertices=None): - """Given a dictionary representing an ordered graph (i.e. key are vertices - and values is a list of destination vertices representing edges), return a - list of detected cycles + """Return a list of detected cycles in a dictionary representing an ordered graph + (i.e. key are vertices and values is a list of destination vertices representing edges) """ if not graph_dict: return () diff --git a/pylint/lint/expand_modules.py b/pylint/lint/expand_modules.py index 296e6b5778..236e49c992 100644 --- a/pylint/lint/expand_modules.py +++ b/pylint/lint/expand_modules.py @@ -18,7 +18,9 @@ def _is_package_cb(inner_path, parts): def get_python_path(filepath: str) -> str: """TODO This get the python path with the (bad) assumption that there is always - an __init__.py. This is not true since python 3.3 and is causing problem. + an __init__.py + + This is not true since python 3.3 and is causing problem. """ dirname = os.path.realpath(os.path.expanduser(filepath)) if not os.path.isdir(dirname): diff --git a/pylint/lint/parallel.py b/pylint/lint/parallel.py index f3e2d6cb45..99c3714931 100644 --- a/pylint/lint/parallel.py +++ b/pylint/lint/parallel.py @@ -133,7 +133,8 @@ def check_parallel( files: Iterable[FileItem], arguments: Union[None, str, Sequence[str]] = None, ) -> None: - """Use the given linter to lint the files with given amount of workers (jobs) + """Use the given linter to lint the files with given amount of workers (jobs). + This splits the work filestream-by-filestream. If you need to do work across multiple files, as in the similarity-checker, then inherit from MapReduceMixin and implement the map/reduce mixin functionality. diff --git a/pylint/lint/run.py b/pylint/lint/run.py index 6cbdc5cc71..b719051844 100644 --- a/pylint/lint/run.py +++ b/pylint/lint/run.py @@ -398,7 +398,9 @@ def cb_add_plugins(self, name, value): self._plugins.extend(utils._splitstrip(value)) def cb_error_mode(self, *args, **kwargs): - """Error mode: + """Callback for --errors-only. + + Error mode: * disable all but error messages * disable the 'miscellaneous' checker which can be safely deactivated in debug diff --git a/pylint/pyreverse/dot_printer.py b/pylint/pyreverse/dot_printer.py index ee19a5b659..fccdcf5579 100644 --- a/pylint/pyreverse/dot_printer.py +++ b/pylint/pyreverse/dot_printer.py @@ -67,7 +67,10 @@ def emit_node( type_: NodeType, properties: Optional[NodeProperties] = None, ) -> None: - """Create a new node. Nodes can be classes, packages, participants etc.""" + """Create a new node. + + Nodes can be classes, packages, participants etc. + """ if properties is None: properties = NodeProperties(label=name) shape = SHAPES[type_] diff --git a/pylint/pyreverse/inspector.py b/pylint/pyreverse/inspector.py index 61c8d1f7ea..808f34266c 100644 --- a/pylint/pyreverse/inspector.py +++ b/pylint/pyreverse/inspector.py @@ -15,6 +15,7 @@ # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE """Visitor doing some postprocessing on the astroid tree. + Try to resolve definitions (namespace) dictionary, relationship... """ import collections diff --git a/pylint/pyreverse/mermaidjs_printer.py b/pylint/pyreverse/mermaidjs_printer.py index 0140419931..a725d03f4c 100644 --- a/pylint/pyreverse/mermaidjs_printer.py +++ b/pylint/pyreverse/mermaidjs_printer.py @@ -38,7 +38,10 @@ def emit_node( type_: NodeType, properties: Optional[NodeProperties] = None, ) -> None: - """Create a new node. Nodes can be classes, packages, participants etc.""" + """Create a new node. + + Nodes can be classes, packages, participants etc. + """ if properties is None: properties = NodeProperties(label=name) stereotype = "~~Interface~~" if type_ is NodeType.INTERFACE else "" diff --git a/pylint/pyreverse/plantuml_printer.py b/pylint/pyreverse/plantuml_printer.py index 5693e626ff..2e643fe1fe 100644 --- a/pylint/pyreverse/plantuml_printer.py +++ b/pylint/pyreverse/plantuml_printer.py @@ -48,7 +48,10 @@ def emit_node( type_: NodeType, properties: Optional[NodeProperties] = None, ) -> None: - """Create a new node. Nodes can be classes, packages, participants etc.""" + """Create a new node. + + Nodes can be classes, packages, participants etc. + """ if properties is None: properties = NodeProperties(label=name) stereotype = " << interface >>" if type_ is NodeType.INTERFACE else "" diff --git a/pylint/pyreverse/printer.py b/pylint/pyreverse/printer.py index ca7f9b0a2a..6f4d62f364 100644 --- a/pylint/pyreverse/printer.py +++ b/pylint/pyreverse/printer.py @@ -85,7 +85,10 @@ def emit_node( type_: NodeType, properties: Optional[NodeProperties] = None, ) -> None: - """Create a new node. Nodes can be classes, packages, participants etc.""" + """Create a new node. + + Nodes can be classes, packages, participants etc. + """ @abstractmethod def emit_edge( diff --git a/pylint/pyreverse/utils.py b/pylint/pyreverse/utils.py index 5cb4138e74..52bfb4fbdd 100644 --- a/pylint/pyreverse/utils.py +++ b/pylint/pyreverse/utils.py @@ -286,6 +286,7 @@ def infer_node(node: Union[nodes.AssignAttr, nodes.AssignName]) -> set: def check_graphviz_availability(): """Check if the ``dot`` command is available on the machine. + This is needed if image output is desired and ``dot`` is used to convert from *.dot or *.gv into the final output format. """ diff --git a/pylint/pyreverse/vcg_printer.py b/pylint/pyreverse/vcg_printer.py index f7e2a46652..52e99a300a 100644 --- a/pylint/pyreverse/vcg_printer.py +++ b/pylint/pyreverse/vcg_printer.py @@ -15,6 +15,7 @@ """Functions to generate files readable with Georg Sander's vcg (Visualization of Compiler Graphs). + You can download vcg at https://rw4.cs.uni-sb.de/~sander/html/gshome.html Note that vcg exists as a debian package. See vcg's documentation for explanation about the different values that @@ -212,7 +213,10 @@ def emit_node( type_: NodeType, properties: Optional[NodeProperties] = None, ) -> None: - """Create a new node. Nodes can be classes, packages, participants etc.""" + """Create a new node. + + Nodes can be classes, packages, participants etc. + """ if properties is None: properties = NodeProperties(label=name) elif properties.label is None: diff --git a/pylint/reporters/multi_reporter.py b/pylint/reporters/multi_reporter.py index a68c8c423d..c2c7382d29 100644 --- a/pylint/reporters/multi_reporter.py +++ b/pylint/reporters/multi_reporter.py @@ -49,9 +49,10 @@ def out(self): @out.setter def out(self, output: Optional[AnyFile] = None): - """MultiReporter doesn't have its own output. This method is only - provided for API parity with BaseReporter and should not be called - with non-None values for 'output'. + """MultiReporter doesn't have its own output. + + This method is only provided for API parity with BaseReporter + and should not be called with non-None values for 'output'. """ self.__out = None if output is not None: diff --git a/pylint/testutils/output_line.py b/pylint/testutils/output_line.py index e851ccfbe9..70dc01f383 100644 --- a/pylint/testutils/output_line.py +++ b/pylint/testutils/output_line.py @@ -23,7 +23,10 @@ class MessageTest(NamedTuple): col_offset: Optional[int] = None end_line: Optional[int] = None end_col_offset: Optional[int] = None - """Used to test messages produced by pylint. Class name cannot start with Test as pytest doesn't allow constructors in test classes.""" + """Used to test messages produced by pylint. + + Class name cannot start with Test as pytest doesn't allow constructors in test classes. + """ class MalformedOutputLineException(Exception): @@ -93,8 +96,9 @@ def from_msg(cls, msg: Message, check_endline: bool = True) -> "OutputLine": @staticmethod def _get_column(column: str) -> int: - """Handle column numbers except for python < 3.8. The ast parser in those versions doesn't - return them. + """Handle column numbers except for python < 3.8. + + The ast parser in those versions doesn't return them. """ if not PY38_PLUS: # We check the column only for the new better ast parser introduced in python 3.8 diff --git a/pylint/testutils/pyreverse.py b/pylint/testutils/pyreverse.py index ac72def41c..34d66d2177 100644 --- a/pylint/testutils/pyreverse.py +++ b/pylint/testutils/pyreverse.py @@ -8,6 +8,7 @@ # A NamedTuple is not possible as some tests need to modify attributes during the test. class PyreverseConfig: # pylint: disable=too-many-instance-attributes, too-many-arguments """Holds the configuration options for Pyreverse. + The default values correspond to the defaults of the options' parser. """ diff --git a/pylint/utils/utils.py b/pylint/utils/utils.py index c3d120458e..14f57a16c1 100644 --- a/pylint/utils/utils.py +++ b/pylint/utils/utils.py @@ -277,7 +277,7 @@ def get_global_option( def _splitstrip(string, sep=","): """Return a list of stripped string by splitting the string given as - argument on `sep` (',' by default). Empty string are discarded. + argument on `sep` (',' by default), empty strings are discarded. >>> _splitstrip('a, b, c , 4,,') ['a', 'b', 'c', '4'] From 8e9a44727545b09ccc0161d72b8b66bc92d95d88 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Sun, 13 Mar 2022 10:20:48 -0400 Subject: [PATCH 049/473] Add regression test for #5770 (#5846) --- ChangeLog | 5 +++++ doc/whatsnew/2.13.rst | 5 +++++ .../regression_newtype_fstring.py | 9 +++++++++ .../regression_newtype_fstring.rc | 2 ++ 4 files changed, 21 insertions(+) create mode 100644 tests/functional/ext/redefined_variable_type/regression_newtype_fstring.py create mode 100644 tests/functional/ext/redefined_variable_type/regression_newtype_fstring.rc diff --git a/ChangeLog b/ChangeLog index a78a1d0048..726ccc134e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -137,6 +137,11 @@ Release date: TBA Closes #5731 +* Fixed a crash involving a ``NewType`` named with an f-string. + + Closes #5770 + Ref PyCQA/astroid#1400 + * Improved ``bad-open-mode`` message when providing ``None`` to the ``mode`` argument of an ``open()`` call. diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 9ddbc2ee7e..130a9ac69b 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -281,6 +281,11 @@ Other Changes Closes #5731 +* Fixed a crash involving a ``NewType`` named with an f-string. + + Closes #5770 + Ref PyCQA/astroid#1400 + * Improved ``bad-open-mode`` message when providing ``None`` to the ``mode`` argument of an ``open()`` call. diff --git a/tests/functional/ext/redefined_variable_type/regression_newtype_fstring.py b/tests/functional/ext/redefined_variable_type/regression_newtype_fstring.py new file mode 100644 index 0000000000..1e3cb28080 --- /dev/null +++ b/tests/functional/ext/redefined_variable_type/regression_newtype_fstring.py @@ -0,0 +1,9 @@ +"""Regression test for issue 5770: NewType created with f-string +See: https://github.com/PyCQA/pylint/issues/5770 +""" +from typing import NewType + +def make_new_type(suffix): + """Dynamically create a NewType with `suffix`""" + new_type = NewType(f'IntRange_{suffix}', suffix) + print(new_type) diff --git a/tests/functional/ext/redefined_variable_type/regression_newtype_fstring.rc b/tests/functional/ext/redefined_variable_type/regression_newtype_fstring.rc new file mode 100644 index 0000000000..8ee18a8f10 --- /dev/null +++ b/tests/functional/ext/redefined_variable_type/regression_newtype_fstring.rc @@ -0,0 +1,2 @@ +[MASTER] +load-plugins=pylint.extensions.redefined_variable_type, From dee07af04df93c4b5edeb2492eaa5c46ebcdb7b7 Mon Sep 17 00:00:00 2001 From: Peter Bittner Date: Sun, 13 Mar 2022 17:55:12 +0100 Subject: [PATCH 050/473] Fix English punctuation and grammar (FAQs) --- doc/faq.rst | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/doc/faq.rst b/doc/faq.rst index fe41466307..04e3b14935 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -59,7 +59,7 @@ The supported running environment since Pylint 2.12.1 is Python 3.6.2+. Pylint expects the name of a package or module as its argument. As a convenience, you can give it a file name if it's possible to guess a module name from -the file's path using the python path. Some examples : +the file's path using the python path. Some examples: "pylint mymodule.py" should always work since the current working directory is automatically added on top of the python path @@ -142,23 +142,22 @@ When ``--recursive=y`` option is used, modules and packages are also accepted as ================== 4.1 How to disable a particular message? ------------------------------------------------------------ +---------------------------------------- -For a single line : Add ``#pylint: disable=some-message,another-one`` at the -end of the desired line of code. Since Pylint 2.10 you can also use -``#pylint: disable-next=...`` on the line just above the problem. -``...`` in the following example is a short hand for the list of -messages you want to disable. +For just a single line, add ``#pylint: disable=some-message,another-one`` at the end of +the desired line of code. Since Pylint 2.10 you can also use ``#pylint: disable-next=...`` +on the line just above the problem. ``...`` in the following example is short for the +list of messages you want to disable. -For larger disable : You can add ``#pylint: disable=...`` at the block level to -disable for the block. It's possible to enable for the reminder of the block -with ``#pylint: enable=...`` A block is either a scope (say a function, a module), -or a multiline statement (try, finally, if statements, for loops). -`It's currently impossible to disable inside an else block`_ +For larger amounts of code, you can add ``#pylint: disable=...`` at the block level +to disable messages for the entire block. It's possible to re-enable a message for the +remainder of the block with ``#pylint: enable=...``. A block is either a scope (say a +function, a module) or a multiline statement (try, finally, if statements, for loops). +Note: It's currently impossible to `disable inside an else block`_. Read :ref:`message-control` for details and examples. -.. _`It's currently impossible to disable inside an else block`: https://github.com/PyCQA/pylint/issues/872 +.. _`disable inside an else block`: https://github.com/PyCQA/pylint/issues/872 4.2 Is there a way to disable a message for a particular module only? --------------------------------------------------------------------- From 2b81cbb6d53bec271eeb7af16b57f79f10a99146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sun, 13 Mar 2022 22:59:37 +0100 Subject: [PATCH 051/473] Fix typing of safe_infer (#5902) --- pylint/checkers/utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py index 4cc413e5c3..4e775e3d24 100644 --- a/pylint/checkers/utils.py +++ b/pylint/checkers/utils.py @@ -1234,7 +1234,7 @@ def supports_delitem(value: nodes.NodeNG, _: nodes.NodeNG) -> bool: return _supports_protocol(value, _supports_delitem_protocol) -def _get_python_type_of_node(node): +def _get_python_type_of_node(node: nodes.NodeNG) -> Optional[str]: pytype = getattr(node, "pytype", None) if callable(pytype): return pytype() @@ -1242,13 +1242,15 @@ def _get_python_type_of_node(node): @lru_cache(maxsize=1024) -def safe_infer(node: nodes.NodeNG, context=None) -> Optional[nodes.NodeNG]: +def safe_infer( + node: nodes.NodeNG, context: Optional[InferenceContext] = None +) -> Union[nodes.NodeNG, Type[astroid.Uninferable], None]: """Return the inferred value for the given node. Return None if inference failed or if there is some ambiguity (more than one node has been inferred of different types). """ - inferred_types = set() + inferred_types: Set[Optional[str]] = set() try: infer_gen = node.infer(context=context) value = next(infer_gen) From 9b8841ad90e9534213af125aec52afbd15353e40 Mon Sep 17 00:00:00 2001 From: Arianna Date: Mon, 14 Mar 2022 16:17:00 -0500 Subject: [PATCH 052/473] Introduce new 'import-private-name' checker (#5610) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Co-authored-by: Pierre Sassoulas --- ChangeLog | 5 + doc/whatsnew/2.13.rst | 4 + pylint/checkers/__init__.py | 3 +- pylint/checkers/utils.py | 5 + pylint/extensions/private_import.py | 248 ++++++++++++++++++ tests/extensions/test_private_import.py | 69 +++++ .../ext/private_import/private_import.py | 121 +++++++++ .../ext/private_import/private_import.rc | 2 + .../ext/private_import/private_import.txt | 20 ++ 9 files changed, 476 insertions(+), 1 deletion(-) create mode 100644 pylint/extensions/private_import.py create mode 100644 tests/extensions/test_private_import.py create mode 100644 tests/functional/ext/private_import/private_import.py create mode 100644 tests/functional/ext/private_import/private_import.rc create mode 100644 tests/functional/ext/private_import/private_import.txt diff --git a/ChangeLog b/ChangeLog index 726ccc134e..52cb627f2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -54,6 +54,11 @@ Release date: TBA closes #5722 +* New extension ``import-private-name``: indicate imports of external private packages + and objects (prefixed with ``_``). It can be loaded using ``load-plugins=pylint.extensions.private_import``. + + Closes #5463 + * Fixed crash from ``arguments-differ`` and ``arguments-renamed`` when methods were defined outside the top level of a class. diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 130a9ac69b..d277d0d82d 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -76,6 +76,10 @@ Removed checkers Extensions ========== +* New extension ``import-private-name``: indicate imports of external private packages + and objects (prefixed with ``_``). It can be loaded using ``load-plugins=pylint.extensions.private_import``. + + Closes #5463 * Pyreverse - add output in mermaid-js format and html which is an mermaid js diagram with html boilerplate diff --git a/pylint/checkers/__init__.py b/pylint/checkers/__init__.py index 160bad8af2..61ce67ffef 100644 --- a/pylint/checkers/__init__.py +++ b/pylint/checkers/__init__.py @@ -45,7 +45,8 @@ 24: non-ascii-names 25: unicode 26: unsupported_version -27-50: not yet used: reserved for future internal checkers. +27: private-import +28-50: not yet used: reserved for future internal checkers. This file is not updated. Use script/get_unused_message_id_category.py to get the next free checker id. diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py index 4e775e3d24..f53ae88456 100644 --- a/pylint/checkers/utils.py +++ b/pylint/checkers/utils.py @@ -1664,6 +1664,11 @@ def is_typing_guard(node: nodes.If) -> bool: ) and node.test.as_string().endswith("TYPE_CHECKING") +def is_node_in_typing_guarded_import_block(node: nodes.NodeNG) -> bool: + """Return True if node is part for guarded `typing.TYPE_CHECKING` if block.""" + return isinstance(node.parent, nodes.If) and is_typing_guard(node.parent) + + def is_node_in_guarded_import_block(node: nodes.NodeNG) -> bool: """Return True if node is part for guarded if block. diff --git a/pylint/extensions/private_import.py b/pylint/extensions/private_import.py new file mode 100644 index 0000000000..88033fa1e5 --- /dev/null +++ b/pylint/extensions/private_import.py @@ -0,0 +1,248 @@ +"""Check for imports on private external modules and names.""" +from pathlib import Path +from typing import TYPE_CHECKING, Dict, List, Union + +from astroid import nodes + +from pylint.checkers import BaseChecker, utils +from pylint.interfaces import HIGH, IAstroidChecker + +if TYPE_CHECKING: + from pylint.lint.pylinter import PyLinter + + +class PrivateImportChecker(BaseChecker): + + __implements__ = (IAstroidChecker,) + name = "import-private-name" + msgs = { + "C2701": ( + "Imported private %s (%s)", + "import-private-name", + "Used when a private module or object prefixed with _ is imported. " + "PEP8 guidance on Naming Conventions states that public attributes with " + "leading underscores should be considered private.", + ), + } + + def __init__(self, linter: "PyLinter") -> None: + BaseChecker.__init__(self, linter) + + # A mapping of private names used as a type annotation to whether it is an acceptable import + self.all_used_type_annotations: Dict[str, bool] = {} + self.populated_annotations = False + + @utils.check_messages("import-private-name") + def visit_import(self, node: nodes.Import) -> None: + if utils.is_node_in_typing_guarded_import_block(node): + return + names = [name[0] for name in node.names] + private_names = self._get_private_imports(names) + private_names = self._get_type_annotation_names(node, private_names) + if private_names: + imported_identifier = "modules" if len(private_names) > 1 else "module" + private_name_string = ", ".join(private_names) + self.add_message( + "import-private-name", + node=node, + args=(imported_identifier, private_name_string), + confidence=HIGH, + ) + + @utils.check_messages("import-private-name") + def visit_importfrom(self, node: nodes.ImportFrom) -> None: + if utils.is_node_in_typing_guarded_import_block(node): + return + # Only check imported names if the module is external + if self.same_root_dir(node, node.modname): + return + + names = [n[0] for n in node.names] + + # Check the imported objects first. If they are all valid type annotations, the package can be private + private_names = self._get_type_annotation_names(node, names) + if not private_names: + return + + # There are invalid imported objects, so check the name of the package + private_module_imports = self._get_private_imports([node.modname]) + private_module_imports = self._get_type_annotation_names( + node, private_module_imports + ) + if private_module_imports: + self.add_message( + "import-private-name", + node=node, + args=("module", private_module_imports[0]), + confidence=HIGH, + ) + return # Do not emit messages on the objects if the package is private + + private_names = self._get_private_imports(private_names) + + if private_names: + imported_identifier = "objects" if len(private_names) > 1 else "object" + private_name_string = ", ".join(private_names) + self.add_message( + "import-private-name", + node=node, + args=(imported_identifier, private_name_string), + confidence=HIGH, + ) + + def _get_private_imports(self, names: List[str]) -> List[str]: + """Returns the private names from input names by a simple string check.""" + return [name for name in names if self._name_is_private(name)] + + @staticmethod + def _name_is_private(name: str) -> bool: + """Returns true if the name exists, starts with `_`, and if len(name) > 4 + it is not a dunder, i.e. it does not begin and end with two underscores. + """ + return ( + bool(name) + and name[0] == "_" + and (len(name) <= 4 or name[1] != "_" or name[-2:] != "__") + ) + + def _get_type_annotation_names( + self, node: nodes.Import, names: List[str] + ) -> List[str]: + """Removes from names any names that are used as type annotations with no other illegal usages.""" + if names and not self.populated_annotations: + self._populate_type_annotations(node.root(), self.all_used_type_annotations) + self.populated_annotations = True + + return [ + n + for n in names + if n not in self.all_used_type_annotations + or ( + n in self.all_used_type_annotations + and not self.all_used_type_annotations[n] + ) + ] + + def _populate_type_annotations( + self, node: nodes.LocalsDictNodeNG, all_used_type_annotations: Dict[str, bool] + ) -> None: + """Adds into the dict `all_used_type_annotations` the names of all names ever used as a type annotation + in the scope and nested scopes of node and whether these names are only used for type checking. + """ + for name in node.locals: + # If we find a private type annotation, make sure we do not mask illegal usages + private_name = None + # All the assignments using this variable that we might have to check for illegal usages later + name_assignments = [] + for usage_node in node.locals[name]: + if isinstance(usage_node, nodes.AssignName) and isinstance( + usage_node.parent, (nodes.AnnAssign, nodes.Assign) + ): + assign_parent = usage_node.parent + if isinstance(assign_parent, nodes.AnnAssign): + name_assignments.append(assign_parent) + private_name = self._populate_type_annotations_annotation( + usage_node.parent.annotation, all_used_type_annotations + ) + elif isinstance(assign_parent, nodes.Assign): + name_assignments.append(assign_parent) + + if isinstance(usage_node, nodes.FunctionDef): + self._populate_type_annotations_function( + usage_node, all_used_type_annotations + ) + if isinstance(usage_node, nodes.LocalsDictNodeNG): + self._populate_type_annotations( + usage_node, all_used_type_annotations + ) + if private_name is not None: + # Found a new private annotation, make sure we are not accessing it elsewhere + all_used_type_annotations[ + private_name + ] = self._assignments_call_private_name(name_assignments, private_name) + + def _populate_type_annotations_function( + self, node: nodes.FunctionDef, all_used_type_annotations: Dict[str, bool] + ) -> None: + """Adds into the dict `all_used_type_annotations` the names of all names used as a type annotation + in the arguments and return type of the function node. + """ + if node.args and node.args.annotations: + for annotation in node.args.annotations: + self._populate_type_annotations_annotation( + annotation, all_used_type_annotations + ) + if node.returns: + self._populate_type_annotations_annotation( + node.returns, all_used_type_annotations + ) + + def _populate_type_annotations_annotation( + self, + node: Union[nodes.Attribute, nodes.Subscript, nodes.Name], + all_used_type_annotations: Dict[str, bool], + ) -> Union[str, None]: + """Handles the possiblity of an annotation either being a Name, i.e. just type, + or a Subscript e.g. `Optional[type]` or an Attribute, e.g. `pylint.lint.linter`. + """ + if isinstance(node, nodes.Name) and node.name not in all_used_type_annotations: + all_used_type_annotations[node.name] = True + return node.name + if isinstance(node, nodes.Subscript): # e.g. Optional[List[str]] + # slice is the next nested type + self._populate_type_annotations_annotation( + node.slice, all_used_type_annotations + ) + # value is the current type name: could be a Name or Attribute + return self._populate_type_annotations_annotation( + node.value, all_used_type_annotations + ) + if isinstance(node, nodes.Attribute): + # An attribute is a type like `pylint.lint.pylinter`. node.expr is the next level up, could be another attribute + return self._populate_type_annotations_annotation( + node.expr, all_used_type_annotations + ) + return None + + @staticmethod + def _assignments_call_private_name( + assignments: List[Union[nodes.AnnAssign, nodes.Assign]], private_name: str + ) -> bool: + """Returns True if no assignments involve accessing `private_name`.""" + if all(not assignment.value for assignment in assignments): + # Variable annotated but unassigned is unallowed because there may be a possible illegal access elsewhere + return False + for assignment in assignments: + current_attribute = None + if isinstance(assignment.value, nodes.Call): + current_attribute = assignment.value.func + elif isinstance(assignment.value, nodes.Attribute): + current_attribute = assignment.value + elif isinstance(assignment.value, nodes.Name): + current_attribute = assignment.value.name + if not current_attribute: + continue + while isinstance(current_attribute, (nodes.Attribute, nodes.Call)): + if isinstance(current_attribute, nodes.Call): + current_attribute = current_attribute.func + current_attribute = current_attribute.expr + if ( + isinstance(current_attribute, nodes.Name) + and current_attribute.name == private_name + ): + return False + return True + + @staticmethod + def same_root_dir(node: nodes.Import, import_mod_name: str) -> bool: + """Does the node's file's path contain the base name of `import_mod_name`?""" + if not import_mod_name: # from . import ... + return True + + base_import_package = import_mod_name.split(".")[0] + + return base_import_package in Path(node.root().file).parent.parts + + +def register(linter: "PyLinter") -> None: + linter.register_checker(PrivateImportChecker(linter)) diff --git a/tests/extensions/test_private_import.py b/tests/extensions/test_private_import.py new file mode 100644 index 0000000000..10648a8f91 --- /dev/null +++ b/tests/extensions/test_private_import.py @@ -0,0 +1,69 @@ +"""Tests the local module directory comparison logic which requires mocking file directories""" + +from unittest.mock import patch + +import astroid + +from pylint.extensions import private_import +from pylint.interfaces import HIGH +from pylint.testutils import CheckerTestCase, MessageTest + + +class TestPrivateImport(CheckerTestCase): + """The mocked dirname is the directory of the file being linted, the node is code inside that file""" + + CHECKER_CLASS = private_import.PrivateImportChecker + + @patch("pathlib.Path.parent") + def test_internal_module(self, parent) -> None: + parent.parts = ("", "dir", "module") + import_from = astroid.extract_node("""from module import _file""") + + with self.assertNoMessages(): + self.checker.visit_importfrom(import_from) + + @patch("pathlib.Path.parent") + def test_external_module_nested(self, parent) -> None: + parent.parts = ("", "dir", "module", "module_files", "util") + + import_from = astroid.extract_node("""from module import _file""") + + with self.assertNoMessages(): + self.checker.visit_importfrom(import_from) + + @patch("pathlib.Path.parent") + def test_external_module_dot_import(self, parent) -> None: + parent.parts = ("", "dir", "outer", "inner", "module_files", "util") + + import_from = astroid.extract_node("""from outer.inner import _file""") + + with self.assertNoMessages(): + self.checker.visit_importfrom(import_from) + + @patch("pathlib.Path.parent") + def test_external_module_dot_import_outer_only(self, parent) -> None: + parent.parts = ("", "dir", "outer", "extensions") + + import_from = astroid.extract_node("""from outer.inner import _file""") + + with self.assertNoMessages(): + self.checker.visit_importfrom(import_from) + + @patch("pathlib.Path.parent") + def test_external_module(self, parent) -> None: + parent.parts = ("", "dir", "other") + + import_from = astroid.extract_node("""from module import _file""") + + msg = MessageTest( + msg_id="import-private-name", + node=import_from, + line=1, + col_offset=0, + end_line=1, + end_col_offset=24, + args=("object", "_file"), + confidence=HIGH, + ) + with self.assertAddsMessages(msg): + self.checker.visit_importfrom(import_from) diff --git a/tests/functional/ext/private_import/private_import.py b/tests/functional/ext/private_import/private_import.py new file mode 100644 index 0000000000..52ef405c90 --- /dev/null +++ b/tests/functional/ext/private_import/private_import.py @@ -0,0 +1,121 @@ +"""Tests for import-private-name.""" +# pylint: disable=unused-import, missing-docstring, reimported, import-error, wrong-import-order +# pylint: disable=no-name-in-module, multiple-imports, ungrouped-imports, misplaced-future +# pylint: disable=wrong-import-position + +# Basic cases +from _world import hello # [import-private-name] +from _world import _hello # [import-private-name] +from city import _house # [import-private-name] +from city import a, _b, c, _d # [import-private-name] +from _city import a, _b, c, _d # [import-private-name] +from city import a, b, c, _d # [import-private-name] +import house +import _house # [import-private-name] +import _house, _chair, _stair # [import-private-name] +import house, _chair, _stair # [import-private-name] + +# Ignore dunders +import __asd__ +import __future__ +from __future__ import print_function +from __future__ import __print_function__ + +# Ignore local modules +# The check for local modules compares directory names in the path of the file being linted to +# the name of the module we are importing from. The use of `__init__.py` to indicate Python modules +# is deprecated so this is a heuristic solution. +# If we were importing from `pylint`, it would be counted as a valid internal private import +# and not emit a message as long as this file has a parent directory called `pylint`, even though +# we are not importing from that directory. (We would be importing from `pylint/pylint`.) +from private_import import _private # pylint: disable=import-self +from private_import.other_file import _private +from . import _private +from astroid import _private # [import-private-name] +from sys import _private # [import-private-name] + +# Ignore typecheck +from typing import TYPE_CHECKING, List, Optional + +if TYPE_CHECKING: + import _TreeType + from types import _TreeType + from _types import TreeType + from _types import _TreeType + +# No error since imports are used as type annotations +from classes import _PrivateClassA, safe_get_A +from classes import _PrivateClassB +from classes import _PrivateClassC + +a_var: _PrivateClassA = safe_get_A() + +def b_func(class_b: _PrivateClassB): + print(class_b) + +def c_func() -> _PrivateClassC: + return None + +# Used as typing in slices +from classes import _SubScriptA +from classes import _SubScriptB + +a: Optional[_SubScriptA] +b: Optional[_SubScriptB[List]] + +import _TypeContainerA +import _TypeContainerB +import _TypeContainerC + +import SafeContainerA +a2: _TypeContainerA.A = SafeContainerA.safe_get_a() + +def b_func2(class_b2: _TypeContainerB.B): + print(class_b2) + +def c2_func() -> _TypeContainerC.C: + return None + +# This is allowed since all the imports are used for typing +from _TypeContainerExtra import TypeExtraA, TypeExtraB +from MakerContainerExtra import GetA, GetB +extraA: TypeExtraA = GetA() +extraB: TypeExtraB = GetB() + +# This is not allowed because there is an import not used for typing +from _TypeContainerExtra2 import TypeExtra2, NotTypeExtra # [import-private-name] +extra2: TypeExtra2 + +# Try many cases to ensure that type annotation usages of a private import +# do not mask other illegal usages of the import +import _private_module # [import-private-name] +my_var: _private_module.Thing = _private_module.Thing() + +import _private_module2 # [import-private-name] +my_var2: _private_module2.Thing2 +my_var2 = _private_module2.Thing2() + +import _private_module3 # [import-private-name] +my_var3: _private_module3.Thing3 +my_var3 = _private_module3.Thing3 +my_var3_2: _private_module3.Thing3 + +import _private_module4 # [import-private-name] +my_var4: _private_module4.Thing4 +my_var4 = _private_module4.get_callers().get_thing4() + +from _private_module5 import PrivateClass # [import-private-name] +my_var5: PrivateClass +my_var5 = PrivateClass() + +from _private_module6 import PrivateClass2 # [import-private-name] +my_var6: PrivateClass2 = PrivateClass2() + +from public_module import _PrivateClass3 # [import-private-name] +my_var7: _PrivateClass3 = _PrivateClass3() + +# Even though we do not see the private call, the type check does not keep us from emitting +# because we do not use that variable +import _private_module_unreachable # [import-private-name] +my_var8: _private_module_unreachable.Thing8 +_private_module_unreachable.Thing8() diff --git a/tests/functional/ext/private_import/private_import.rc b/tests/functional/ext/private_import/private_import.rc new file mode 100644 index 0000000000..c9bbc23f1f --- /dev/null +++ b/tests/functional/ext/private_import/private_import.rc @@ -0,0 +1,2 @@ +[MASTER] +load-plugins=pylint.extensions.private_import, diff --git a/tests/functional/ext/private_import/private_import.txt b/tests/functional/ext/private_import/private_import.txt new file mode 100644 index 0000000000..f618d58587 --- /dev/null +++ b/tests/functional/ext/private_import/private_import.txt @@ -0,0 +1,20 @@ +import-private-name:7:0:7:24::Imported private module (_world):HIGH +import-private-name:8:0:8:25::Imported private module (_world):HIGH +import-private-name:9:0:9:23::Imported private object (_house):HIGH +import-private-name:10:0:10:29::Imported private objects (_b, _d):HIGH +import-private-name:11:0:11:30::Imported private module (_city):HIGH +import-private-name:12:0:12:28::Imported private object (_d):HIGH +import-private-name:14:0:14:13::Imported private module (_house):HIGH +import-private-name:15:0:15:29::Imported private modules (_house, _chair, _stair):HIGH +import-private-name:16:0:16:28::Imported private modules (_chair, _stair):HIGH +import-private-name:34:0:34:28::Imported private object (_private):HIGH +import-private-name:35:0:35:24::Imported private object (_private):HIGH +import-private-name:86:0:86:57::Imported private module (_TypeContainerExtra2):HIGH +import-private-name:91:0:91:22::Imported private module (_private_module):HIGH +import-private-name:94:0:94:23::Imported private module (_private_module2):HIGH +import-private-name:98:0:98:23::Imported private module (_private_module3):HIGH +import-private-name:103:0:103:23::Imported private module (_private_module4):HIGH +import-private-name:107:0:107:41::Imported private module (_private_module5):HIGH +import-private-name:111:0:111:42::Imported private module (_private_module6):HIGH +import-private-name:114:0:114:40::Imported private object (_PrivateClass3):HIGH +import-private-name:119:0:119:34::Imported private module (_private_module_unreachable):HIGH From 6aba371d87966272c1bf2a2d88866f3ee566c46f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Mon, 14 Mar 2022 22:54:35 +0100 Subject: [PATCH 053/473] Simplify ``cached_property`` import guards (#5915) --- pylint/checkers/classes/class_checker.py | 5 ++--- pylint/checkers/design_analysis.py | 3 +-- .../checkers/refactoring/refactoring_checker.py | 15 ++------------- pylint/checkers/typecheck.py | 4 +--- pylint/checkers/variables.py | 4 +--- 5 files changed, 7 insertions(+), 24 deletions(-) diff --git a/pylint/checkers/classes/class_checker.py b/pylint/checkers/classes/class_checker.py index 63078cf421..3373b277b8 100644 --- a/pylint/checkers/classes/class_checker.py +++ b/pylint/checkers/classes/class_checker.py @@ -53,7 +53,7 @@ import collections import sys from itertools import chain, zip_longest -from typing import TYPE_CHECKING, Dict, List, Pattern, Set +from typing import Dict, List, Pattern, Set import astroid from astroid import bases, nodes @@ -85,10 +85,9 @@ from pylint.interfaces import INFERENCE, IAstroidChecker from pylint.utils import get_global_option -if sys.version_info >= (3, 8) or TYPE_CHECKING: +if sys.version_info >= (3, 8): from functools import cached_property else: - # pylint: disable-next=ungrouped-imports from astroid.decorators import cachedproperty as cached_property INVALID_BASE_CLASSES = {"bool", "range", "slice", "memoryview"} diff --git a/pylint/checkers/design_analysis.py b/pylint/checkers/design_analysis.py index 46bd443a2e..d2ad84539e 100644 --- a/pylint/checkers/design_analysis.py +++ b/pylint/checkers/design_analysis.py @@ -43,10 +43,9 @@ from pylint.checkers.utils import check_messages from pylint.interfaces import IAstroidChecker -if sys.version_info >= (3, 8) or TYPE_CHECKING: +if sys.version_info >= (3, 8): from functools import cached_property else: - # pylint: disable-next=ungrouped-imports from astroid.decorators import cachedproperty as cached_property if TYPE_CHECKING: diff --git a/pylint/checkers/refactoring/refactoring_checker.py b/pylint/checkers/refactoring/refactoring_checker.py index 00e234cbd6..0644271b21 100644 --- a/pylint/checkers/refactoring/refactoring_checker.py +++ b/pylint/checkers/refactoring/refactoring_checker.py @@ -7,16 +7,7 @@ import sys import tokenize from functools import reduce -from typing import ( - TYPE_CHECKING, - Dict, - Iterator, - List, - NamedTuple, - Optional, - Tuple, - Union, -) +from typing import Dict, Iterator, List, NamedTuple, Optional, Tuple, Union import astroid from astroid import nodes @@ -27,11 +18,9 @@ from pylint.checkers import utils from pylint.checkers.utils import node_frame_class -if sys.version_info >= (3, 8) or TYPE_CHECKING: - # pylint: disable-next=ungrouped-imports +if sys.version_info >= (3, 8): from functools import cached_property else: - # pylint: disable-next=ungrouped-imports from astroid.decorators import cachedproperty as cached_property KNOWN_INFINITE_ITERATORS = {"itertools.count"} diff --git a/pylint/checkers/typecheck.py b/pylint/checkers/typecheck.py index d3ab8ca8e4..8f5f35b6fe 100644 --- a/pylint/checkers/typecheck.py +++ b/pylint/checkers/typecheck.py @@ -109,11 +109,9 @@ from pylint.interfaces import INFERENCE, IAstroidChecker from pylint.utils import get_global_option -if sys.version_info >= (3, 8) or TYPE_CHECKING: - # pylint: disable-next=ungrouped-imports +if sys.version_info >= (3, 8): from functools import cached_property else: - # pylint: disable-next=ungrouped-imports from astroid.decorators import cachedproperty as cached_property if TYPE_CHECKING: diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index d4663e37ba..d05f578c05 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -91,11 +91,9 @@ ) from pylint.utils import get_global_option -if sys.version_info >= (3, 8) or TYPE_CHECKING: - # pylint: disable-next=ungrouped-imports +if sys.version_info >= (3, 8): from functools import cached_property else: - # pylint: disable-next=ungrouped-imports from astroid.decorators import cachedproperty as cached_property if TYPE_CHECKING: From 04e89f0c1a182f6bb828eafabc03d3b3951631ea Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 09:03:03 +0100 Subject: [PATCH 054/473] [pre-commit.ci] pre-commit autoupdate (#5917) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.31.0 → v2.31.1](https://github.com/asottile/pyupgrade/compare/v2.31.0...v2.31.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 039f220c6c..44cfb0ef8d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,7 @@ repos: - --remove-duplicate-keys - --remove-unused-variables - repo: https://github.com/asottile/pyupgrade - rev: v2.31.0 + rev: v2.31.1 hooks: - id: pyupgrade args: [--py36-plus] From 12b33ee244f89e6d8880a5b4b45119d19fec9c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Tue, 15 Mar 2022 09:14:58 +0100 Subject: [PATCH 055/473] Update ``pydocstringformatter`` to ``0.5.3`` (#5918) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 44cfb0ef8d..6df441d822 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -95,9 +95,9 @@ repos: args: [--prose-wrap=always, --print-width=88] exclude: tests(/.*)*/data - repo: https://github.com/DanielNoord/pydocstringformatter - rev: v0.5.0 + rev: v0.5.3 hooks: - id: pydocstringformatter exclude: *fixtures - args: ["--max-summary-lines=2", "--split-summary-body", "-w"] + args: ["--split-summary-body", "--max-summary-lines=2"] files: "pylint" From 849bdda236ec8024d9230ef4d300feb29b679fc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sat, 12 Mar 2022 20:00:12 +0100 Subject: [PATCH 056/473] Remove uses of ``NodeNG.doc`` in favour of ``doc_node`` --- pylint/checkers/base.py | 4 ++-- pylint/checkers/ellipsis_checker.py | 2 +- pylint/checkers/spelling.py | 5 ++--- pylint/extensions/_check_docs_utils.py | 12 +++++++----- pylint/extensions/docparams.py | 12 ++++++------ pylint/extensions/docstyle.py | 2 +- 6 files changed, 19 insertions(+), 18 deletions(-) diff --git a/pylint/checkers/base.py b/pylint/checkers/base.py index cd678b6cb7..faacee9984 100644 --- a/pylint/checkers/base.py +++ b/pylint/checkers/base.py @@ -2309,7 +2309,7 @@ def _check_docstring( confidence=interfaces.HIGH, ): """Check if the node has a non-empty docstring.""" - docstring = node.doc + docstring = node.doc_node.value if node.doc_node else None if docstring is None: docstring = _infer_dunder_doc_attribute(node) @@ -2375,7 +2375,7 @@ class PassChecker(_BasicChecker): def visit_pass(self, node: nodes.Pass) -> None: if len(node.parent.child_sequence(node)) > 1 or ( isinstance(node.parent, (nodes.ClassDef, nodes.FunctionDef)) - and (node.parent.doc is not None) + and node.parent.doc_node ): self.add_message("unnecessary-pass", node=node) diff --git a/pylint/checkers/ellipsis_checker.py b/pylint/checkers/ellipsis_checker.py index 1261485b82..76e8a77ce0 100644 --- a/pylint/checkers/ellipsis_checker.py +++ b/pylint/checkers/ellipsis_checker.py @@ -42,7 +42,7 @@ def visit_const(self, node: nodes.Const) -> None: len(node.parent.parent.child_sequence(node.parent)) > 1 or ( isinstance(node.parent.parent, (nodes.ClassDef, nodes.FunctionDef)) - and (node.parent.parent.doc is not None) + and node.parent.parent.doc_node ) ) ): diff --git a/pylint/checkers/spelling.py b/pylint/checkers/spelling.py index 8c004444e6..e63196155a 100644 --- a/pylint/checkers/spelling.py +++ b/pylint/checkers/spelling.py @@ -460,14 +460,13 @@ def visit_functiondef(self, node: nodes.FunctionDef) -> None: def _check_docstring(self, node): """Check the node has any spelling errors.""" - docstring = node.doc - if not docstring: + if not node.doc_node: return start_line = node.lineno + 1 # Go through lines of docstring - for idx, line in enumerate(docstring.splitlines()): + for idx, line in enumerate(node.doc_node.value.splitlines()): self._check_spelling("wrong-spelling-in-docstring", line, start_line + idx) diff --git a/pylint/extensions/_check_docs_utils.py b/pylint/extensions/_check_docs_utils.py index 2e295ca110..ffda42cd37 100644 --- a/pylint/extensions/_check_docs_utils.py +++ b/pylint/extensions/_check_docs_utils.py @@ -25,7 +25,7 @@ """Utility methods for docstring checking.""" import re -from typing import List, Set, Tuple +from typing import List, Optional, Set, Tuple import astroid from astroid import nodes @@ -176,7 +176,9 @@ def possible_exc_types(node: nodes.NodeNG) -> Set[nodes.ClassDef]: return set() -def docstringify(docstring: str, default_type: str = "default") -> "Docstring": +def docstringify( + docstring: Optional[nodes.Const], default_type: str = "default" +) -> "Docstring": best_match = (0, DOCSTRING_TYPES.get(default_type, Docstring)(docstring)) for docstring_type in ( SphinxDocstring, @@ -208,9 +210,9 @@ class Docstring: # These methods are designed to be overridden # pylint: disable=no-self-use - def __init__(self, doc): - doc = doc or "" - self.doc = doc.expandtabs() + def __init__(self, doc: Optional[nodes.Const]) -> None: + docstring = doc.value if doc else "" + self.doc = docstring.expandtabs() def __repr__(self) -> str: return f"<{self.__class__.__name__}:'''{self.doc}'''>" diff --git a/pylint/extensions/docparams.py b/pylint/extensions/docparams.py index d618ea4d4d..8d60b11881 100644 --- a/pylint/extensions/docparams.py +++ b/pylint/extensions/docparams.py @@ -219,7 +219,7 @@ def visit_functiondef(self, node: nodes.FunctionDef) -> None: :param node: Node for a function or method definition in the AST :type node: :class:`astroid.scoped_nodes.Function` """ - node_doc = utils.docstringify(node.doc, self.config.default_docstring_type) + node_doc = utils.docstringify(node.doc_node, self.config.default_docstring_type) # skip functions that match the 'no-docstring-rgx' config option no_docstring_rgx = get_global_option(self, "no-docstring-rgx") @@ -244,7 +244,7 @@ def check_functiondef_params(self, node, node_doc): class_node = checker_utils.node_frame_class(node) if class_node is not None: class_doc = utils.docstringify( - class_node.doc, self.config.default_docstring_type + class_node.doc_node, self.config.default_docstring_type ) self.check_single_constructor_params(class_doc, node_doc, class_node) @@ -298,14 +298,14 @@ def visit_raise(self, node: nodes.Raise) -> None: if not expected_excs: return - if not func_node.doc: + if not func_node.doc_node: # If this is a property setter, # the property should have the docstring instead. property_ = utils.get_setters_property(func_node) if property_: func_node = property_ - doc = utils.docstringify(func_node.doc, self.config.default_docstring_type) + doc = utils.docstringify(func_node.doc_node, self.config.default_docstring_type) if not doc.matching_sections(): if doc.doc: missing = {exc.name for exc in expected_excs} @@ -340,7 +340,7 @@ def visit_return(self, node: nodes.Return) -> None: if not isinstance(func_node, astroid.FunctionDef): return - doc = utils.docstringify(func_node.doc, self.config.default_docstring_type) + doc = utils.docstringify(func_node.doc_node, self.config.default_docstring_type) is_property = checker_utils.decorated_with_property(func_node) @@ -361,7 +361,7 @@ def visit_yield(self, node: nodes.Yield) -> None: if not isinstance(func_node, astroid.FunctionDef): return - doc = utils.docstringify(func_node.doc, self.config.default_docstring_type) + doc = utils.docstringify(func_node.doc_node, self.config.default_docstring_type) if doc.supports_yields: doc_has_yields = doc.has_yields() diff --git a/pylint/extensions/docstyle.py b/pylint/extensions/docstyle.py index 7dc26db5d4..e520d0650c 100644 --- a/pylint/extensions/docstyle.py +++ b/pylint/extensions/docstyle.py @@ -58,7 +58,7 @@ def visit_functiondef(self, node: nodes.FunctionDef) -> None: visit_asyncfunctiondef = visit_functiondef def _check_docstring(self, node_type, node): - docstring = node.doc + docstring = node.doc_node.value if node.doc_node else None if docstring and docstring[0] == "\n": self.add_message( "docstring-first-line-empty", From fcc17e97f35263775fbd27b3a8f8cf05e3f27613 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Mar 2022 13:05:15 +0000 Subject: [PATCH 057/473] Update typing-extensions requirement from ~=4.0 to ~=4.1 Updates the requirements on [typing-extensions](https://github.com/python/typing) to permit the latest version. - [Release notes](https://github.com/python/typing/releases) - [Changelog](https://github.com/python/typing/blob/master/typing_extensions/CHANGELOG) - [Commits](https://github.com/python/typing/compare/4.0.0...4.1.1) --- updated-dependencies: - dependency-name: typing-extensions dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements_test_min.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_test_min.txt b/requirements_test_min.txt index 10385cd5b6..f577fbddcd 100644 --- a/requirements_test_min.txt +++ b/requirements_test_min.txt @@ -1,6 +1,6 @@ -e .[testutil] # astroid dependency is also defined in setup.cfg astroid==2.11.0 # Pinned to a specific version for tests -typing-extensions~=4.0 +typing-extensions~=4.1 pytest~=7.0 pytest-benchmark~=3.4 From 975550582494f9e1c0eb43336943c716120bc4e6 Mon Sep 17 00:00:00 2001 From: yushao2 <36848472+yushao2@users.noreply.github.com> Date: Tue, 15 Mar 2022 18:22:33 +0800 Subject: [PATCH 058/473] fix(4756): fix false positive `unused-private-member` for private methods (#5345) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Pierre Sassoulas Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> --- ChangeLog | 4 ++ doc/whatsnew/2.13.rst | 4 ++ pylint/checkers/classes/class_checker.py | 44 +++++++++++-------- .../u/unused/unused_private_member.py | 25 +++++++++++ .../u/unused/unused_private_member.txt | 40 ++++++++--------- 5 files changed, 78 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 52cb627f2e..bcebfa4478 100644 --- a/ChangeLog +++ b/ChangeLog @@ -582,6 +582,10 @@ Release date: 2021-11-24 Closes #4412 #5287 +* Fix ``unused-private-member`` false positive when accessing private methods through ``property``. + + Closes #4756 + * Fix ``install graphiz`` message which isn't needed for puml output format. * ``MessageTest`` of the unittest ``testutil`` now requires the ``confidence`` attribute diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index d277d0d82d..629798f421 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -153,6 +153,10 @@ Other Changes Closes #5722 +* Fix ``unused-private-member`` false positive when accessing private methods through ``property``. + + Closes #4756 + * Fixed crash from ``arguments-differ`` and ``arguments-renamed`` when methods were defined outside the top level of a class. diff --git a/pylint/checkers/classes/class_checker.py b/pylint/checkers/classes/class_checker.py index 3373b277b8..ab954f2e83 100644 --- a/pylint/checkers/classes/class_checker.py +++ b/pylint/checkers/classes/class_checker.py @@ -900,29 +900,35 @@ def _check_unused_private_functions(self, node: nodes.ClassDef) -> None: n.name for n in parent_scope.nodes_of_class(nodes.Name) ): continue - for attribute in node.nodes_of_class(nodes.Attribute): - if ( - attribute.attrname != function_def.name - or attribute.scope() == function_def # We ignore recursive calls - ): - continue - if isinstance(attribute.expr, nodes.Name) and attribute.expr.name in ( - "self", - "cls", - node.name, - ): - # self.__attrname - # cls.__attrname - # node_name.__attrname + for child in node.nodes_of_class((nodes.Name, nodes.Attribute)): + # Check for cases where the functions are used as a variable instead of as a method call + if isinstance(child, nodes.Name) and child.name == function_def.name: break - if isinstance(attribute.expr, nodes.Call): - # type(self).__attrname - inferred = safe_infer(attribute.expr) + if isinstance(child, nodes.Attribute): + # Ignore recursive calls if ( - isinstance(inferred, nodes.ClassDef) - and inferred.name == node.name + child.attrname != function_def.name + or child.scope() == function_def ): + continue + + # Check self.__attrname, cls.__attrname, node_name.__attrname + if isinstance(child.expr, nodes.Name) and child.expr.name in { + "self", + "cls", + node.name, + }: + break + + # Check type(self).__attrname + if isinstance(child.expr, nodes.Call): + inferred = safe_infer(child.expr) + if ( + isinstance(inferred, nodes.ClassDef) + and inferred.name == node.name + ): + break else: name_stack = [] curr = parent_scope diff --git a/tests/functional/u/unused/unused_private_member.py b/tests/functional/u/unused/unused_private_member.py index 1b81d738b8..d69d7eb11a 100644 --- a/tests/functional/u/unused/unused_private_member.py +++ b/tests/functional/u/unused/unused_private_member.py @@ -1,4 +1,6 @@ # pylint: disable=missing-docstring, invalid-name, too-few-public-methods, no-self-use, line-too-long, unused-argument, protected-access +from functools import partialmethod + class AnotherClass(): def __test(self): # [unused-private-member] @@ -311,6 +313,29 @@ def method(self): print(self.__class__.__ham) +# https://github.com/PyCQA/pylint/issues/4756 +# Check for false positives emitted when private functions are not referenced in the class body +# with standard calls but passed as arguments to other functions. +class FalsePositive4756a: + def __bar(self, x): + print(x) + fizz = partialmethod(__bar, 'fizz') +foo = FalsePositive4756a() +foo.fizz() + +class FalsePositive4756b: + def __get_prop(self): + pass + + def __set_prop(self, value): + pass + + def __del_prop(self): + pass + + prop = property(__get_prop, __set_prop, __del_prop) + + class TypeSelfCallInMethod: """Regression test for issue 5569""" @classmethod diff --git a/tests/functional/u/unused/unused_private_member.txt b/tests/functional/u/unused/unused_private_member.txt index 71c95c9764..e6b6ab83c3 100644 --- a/tests/functional/u/unused/unused_private_member.txt +++ b/tests/functional/u/unused/unused_private_member.txt @@ -1,20 +1,20 @@ -unused-private-member:4:4:4:14:AnotherClass.__test:Unused private member `AnotherClass.__test(self)`:UNDEFINED -unused-private-member:8:4:8:15:HasUnusedInClass:Unused private member `HasUnusedInClass.__my_secret`:UNDEFINED -unused-private-member:12:4:12:37:HasUnusedInClass.__private_class_method_unused:Unused private member `HasUnusedInClass.__private_class_method_unused(cls)`:UNDEFINED -unused-private-member:20:4:20:38:HasUnusedInClass.__private_static_method_unused:Unused private member `HasUnusedInClass.__private_static_method_unused()`:UNDEFINED -unused-private-member:28:8:28:30:HasUnusedInClass.__init__:Unused private member `HasUnusedInClass.__instance_secret`:UNDEFINED -unused-private-member:34:4:34:14:HasUnusedInClass.__test:Unused private member `HasUnusedInClass.__test(self, x, y, z)`:UNDEFINED -unused-private-member:55:4:55:24:HasUnusedInClass.__test_recursive:Unused private member `HasUnusedInClass.__test_recursive(self)`:UNDEFINED -unused-private-member:133:8:133:21:FalsePositive4657.__init__:Unused private member `FalsePositive4657.__attr_c`:UNDEFINED -undefined-variable:138:15:138:18:FalsePositive4657.attr_c:Undefined variable 'cls':UNDEFINED -unused-private-member:157:8:157:26:FalsePositive4668.__new__:Unused private member `FalsePositive4668.__unused`:UNDEFINED -unused-private-member:181:8:181:27:FalsePositive4673.do_thing.__true_positive:Unused private member `FalsePositive4673.do_thing.__true_positive(in_thing)`:UNDEFINED -unused-private-member:201:8:201:21:FalsePositive4673.complicated_example.__inner_4:Unused private member `FalsePositive4673.complicated_example.__inner_4()`:UNDEFINED -unused-private-member:212:8:212:23:Crash4755Context.__init__:Unused private member `Crash4755Context.__messages`:UNDEFINED -unused-private-member:229:4:229:24:FalsePositive4681:Unused private member `FalsePositive4681.__should_cause_error`:UNDEFINED -unused-private-member:239:12:239:50:FalsePositive4681.__init__:Unused private member `FalsePositive4681.__should_cause_error`:UNDEFINED -unused-private-member:243:12:243:50:FalsePositive4681.__init__:Unused private member `FalsePositive4681.__should_cause_error`:UNDEFINED -unused-private-member:274:4:274:31:FalsePositive4849.__unused_private_method:Unused private member `FalsePositive4849.__unused_private_method()`:UNDEFINED -unused-private-member:291:4:291:23:Pony.__init_defaults:Unused private member `Pony.__init_defaults(self)`:UNDEFINED -unused-private-member:296:4:296:23:Pony.__get_fur_color:Unused private member `Pony.__get_fur_color(self)`:UNDEFINED -unused-private-member:318:8:318:15:TypeSelfCallInMethod.b:Unused private member `TypeSelfCallInMethod.__a`:UNDEFINED +unused-private-member:6:4:6:14:AnotherClass.__test:Unused private member `AnotherClass.__test(self)`:UNDEFINED +unused-private-member:10:4:10:15:HasUnusedInClass:Unused private member `HasUnusedInClass.__my_secret`:UNDEFINED +unused-private-member:14:4:14:37:HasUnusedInClass.__private_class_method_unused:Unused private member `HasUnusedInClass.__private_class_method_unused(cls)`:UNDEFINED +unused-private-member:22:4:22:38:HasUnusedInClass.__private_static_method_unused:Unused private member `HasUnusedInClass.__private_static_method_unused()`:UNDEFINED +unused-private-member:30:8:30:30:HasUnusedInClass.__init__:Unused private member `HasUnusedInClass.__instance_secret`:UNDEFINED +unused-private-member:36:4:36:14:HasUnusedInClass.__test:Unused private member `HasUnusedInClass.__test(self, x, y, z)`:UNDEFINED +unused-private-member:57:4:57:24:HasUnusedInClass.__test_recursive:Unused private member `HasUnusedInClass.__test_recursive(self)`:UNDEFINED +unused-private-member:135:8:135:21:FalsePositive4657.__init__:Unused private member `FalsePositive4657.__attr_c`:UNDEFINED +undefined-variable:140:15:140:18:FalsePositive4657.attr_c:Undefined variable 'cls':UNDEFINED +unused-private-member:159:8:159:26:FalsePositive4668.__new__:Unused private member `FalsePositive4668.__unused`:UNDEFINED +unused-private-member:183:8:183:27:FalsePositive4673.do_thing.__true_positive:Unused private member `FalsePositive4673.do_thing.__true_positive(in_thing)`:UNDEFINED +unused-private-member:203:8:203:21:FalsePositive4673.complicated_example.__inner_4:Unused private member `FalsePositive4673.complicated_example.__inner_4()`:UNDEFINED +unused-private-member:214:8:214:23:Crash4755Context.__init__:Unused private member `Crash4755Context.__messages`:UNDEFINED +unused-private-member:231:4:231:24:FalsePositive4681:Unused private member `FalsePositive4681.__should_cause_error`:UNDEFINED +unused-private-member:241:12:241:50:FalsePositive4681.__init__:Unused private member `FalsePositive4681.__should_cause_error`:UNDEFINED +unused-private-member:245:12:245:50:FalsePositive4681.__init__:Unused private member `FalsePositive4681.__should_cause_error`:UNDEFINED +unused-private-member:276:4:276:31:FalsePositive4849.__unused_private_method:Unused private member `FalsePositive4849.__unused_private_method()`:UNDEFINED +unused-private-member:293:4:293:23:Pony.__init_defaults:Unused private member `Pony.__init_defaults(self)`:UNDEFINED +unused-private-member:298:4:298:23:Pony.__get_fur_color:Unused private member `Pony.__get_fur_color(self)`:UNDEFINED +unused-private-member:343:8:343:15:TypeSelfCallInMethod.b:Unused private member `TypeSelfCallInMethod.__a`:UNDEFINED From 0481a7356140bb9506833d93149e1d219a3ec79f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Tue, 15 Mar 2022 21:30:36 +0100 Subject: [PATCH 059/473] Handle ``ComprehensionScope`` and their behaviour better (#5923) --- pylint/checkers/classes/special_methods_checker.py | 5 +++++ pylint/checkers/typecheck.py | 10 +++++----- pylint/checkers/utils.py | 5 +++++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/pylint/checkers/classes/special_methods_checker.py b/pylint/checkers/classes/special_methods_checker.py index 7eb61440df..d3d2b0935e 100644 --- a/pylint/checkers/classes/special_methods_checker.py +++ b/pylint/checkers/classes/special_methods_checker.py @@ -289,6 +289,11 @@ def _is_iterator(node): if isinstance(node, astroid.bases.Generator): # Generators can be iterated. return True + # pylint: disable-next=fixme + # TODO: Should be covered by https://github.com/PyCQA/astroid/pull/1475 + if isinstance(node, nodes.ComprehensionScope): + # Comprehensions can be iterated. + return True if isinstance(node, astroid.Instance): try: diff --git a/pylint/checkers/typecheck.py b/pylint/checkers/typecheck.py index 8f5f35b6fe..7cb132830e 100644 --- a/pylint/checkers/typecheck.py +++ b/pylint/checkers/typecheck.py @@ -273,11 +273,11 @@ def _missing_member_hint(owner, attrname, distance_threshold, max_choices): names = [repr(name) for name in names] if len(names) == 1: - names = ", ".join(names) + names_hint = ", ".join(names) else: - names = f"one of {', '.join(names[:-1])} or {names[-1]}" + names_hint = f"one of {', '.join(names[:-1])} or {names[-1]}" - return f"; maybe {names}?" + return f"; maybe {names_hint}?" MSGS = { @@ -2047,10 +2047,10 @@ def _is_asyncio_coroutine(node): return False def _check_iterable(self, node, check_async=False): - if is_inside_abstract_class(node) or is_comprehension(node): + if is_inside_abstract_class(node): return inferred = safe_infer(node) - if not inferred: + if not inferred or is_comprehension(inferred): return if not is_iterable(inferred, check_async=check_async): self.add_message("not-an-iterable", args=node.as_string(), node=node) diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py index f53ae88456..f8b7b74e30 100644 --- a/pylint/checkers/utils.py +++ b/pylint/checkers/utils.py @@ -1189,6 +1189,11 @@ def _supports_protocol( if protocol_callback(value): return True + # pylint: disable-next=fixme + # TODO: Should be covered by https://github.com/PyCQA/astroid/pull/1475 + if isinstance(value, nodes.ComprehensionScope): + return True + if ( isinstance(value, astroid.bases.Proxy) and isinstance(value._proxied, astroid.BaseInstance) From 65f65e9864dbbb130678f2c45646152d8248c27d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=A9o=20Bouvard?= Date: Wed, 16 Mar 2022 08:20:11 +0100 Subject: [PATCH 060/473] Remove primer test on black-primer (#5924) black-primer was removed from black repository, so primer test on this directory has been removed to prevent the CI from failing. See psf/black#2924 Co-authored-by: Pierre Sassoulas --- tests/primer/packages_to_lint_batch_one.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/primer/packages_to_lint_batch_one.json b/tests/primer/packages_to_lint_batch_one.json index 95768b82e7..1c90556766 100644 --- a/tests/primer/packages_to_lint_batch_one.json +++ b/tests/primer/packages_to_lint_batch_one.json @@ -1,7 +1,7 @@ { "black": { "branch": "main", - "directories": ["src/black/", "src/blackd/", "src/black_primer/", "src/blib2to3/"], + "directories": ["src/black/", "src/blackd/", "src/blib2to3/"], "url": "https://github.com/psf/black.git" }, "django": { From ccd32d32c7362f15d43ee83b3ac82b405eb049bf Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Wed, 16 Mar 2022 14:52:57 +0300 Subject: [PATCH 061/473] Optimize handling of long lines for checkers like 'missing-final-newline' (#5925) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix parsing of long lines when ``missing-final-newline`` is enabled * Adapt fa31b6b6 to be backward-compatible Fixes #5724 Also address comments from the PR PyCQA/pylint#5786 Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Co-authored-by: Pierre Sassoulas --- CONTRIBUTORS.txt | 1 + ChangeLog | 4 ++++ doc/whatsnew/2.13.rst | 4 ++++ pylint/utils/pragma_parser.py | 23 ++++++++++++----------- tests/checkers/unittest_refactoring.py | 15 +++++++++++++++ tests/regrtest_data/issue_5724.py | 1 + 6 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 tests/regrtest_data/issue_5724.py diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 01c49f1b7e..989f9297d0 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -355,3 +355,4 @@ contributors: - Daniel Brookman - Téo Bouvard - Konrad Weihmann +- Sergey B Kirpichev diff --git a/ChangeLog b/ChangeLog index bcebfa4478..99ad7a2374 100644 --- a/ChangeLog +++ b/ChangeLog @@ -201,6 +201,10 @@ Release date: TBA Closes #5569 +* Optimize parsing of long lines when ``missing-final-newline`` is enabled. + + Closes #5724 + * Fix false positives for ``used-before-assignment`` from using named expressions in a ternary operator test and using that expression as a call argument. diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 629798f421..d0696f1dbe 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -261,6 +261,10 @@ Other Changes Closes #5771 Ref PyCQA/astroid#1382 +* Optimize parsing of long lines when ``missing-final-newline`` is enabled. + + Closes #5724 + * Fix ``unnecessary_dict_index_lookup`` false positive when deleting a dictionary's entry. Closes #4716 diff --git a/pylint/utils/pragma_parser.py b/pylint/utils/pragma_parser.py index 0bf25de7ce..e09cba7c9e 100644 --- a/pylint/utils/pragma_parser.py +++ b/pylint/utils/pragma_parser.py @@ -9,17 +9,18 @@ # so that an option can be continued with the reasons # why it is active or disabled. OPTION_RGX = r""" - \s* # Any number of whitespace - \#? # One or zero hash - .* # Anything (as much as possible) - (\s* # Beginning of first matched group and any number of whitespaces - \# # Beginning of comment - .*? # Anything (as little as possible) - \bpylint: # pylint word and column - \s* # Any number of whitespaces - ([^;#\n]+)) # Anything except semicolon or hash or newline (it is the second matched group) - # and end of the first matched group - [;#]{0,1}""" # From 0 to 1 repetition of semicolon or hash + (?:^\s*\#.*|\s*| # Comment line, or whitespaces, + \s*\#.*(?=\#.*?\bpylint:)) # or a beginning of an inline comment + # followed by "pylint:" pragma + (\# # Beginning of comment + .*? # Anything (as little as possible) + \bpylint: # pylint word and column + \s* # Any number of whitespaces + ([^;#\n]+)) # Anything except semicolon or hash or + # newline (it is the second matched group) + # and end of the first matched group + [;#]{0,1} # From 0 to 1 repetition of semicolon or hash +""" OPTION_PO = re.compile(OPTION_RGX, re.VERBOSE) diff --git a/tests/checkers/unittest_refactoring.py b/tests/checkers/unittest_refactoring.py index a2694200b7..760eb2fe85 100644 --- a/tests/checkers/unittest_refactoring.py +++ b/tests/checkers/unittest_refactoring.py @@ -32,3 +32,18 @@ def test_process_tokens() -> None: with pytest.raises(SystemExit) as cm: Run([os.path.join(REGR_DATA, "very_long_line.py")], reporter=TextReporter()) assert cm.value.code == 0 + + +@pytest.mark.skipif(not hasattr(signal, "setitimer"), reason="Assumes POSIX signals") +def test_issue_5724() -> None: + """Regression test for parsing of pylint disable pragma's.""" + with timeout(25.0): + with pytest.raises(SystemExit) as cm: + Run( + [ + os.path.join(REGR_DATA, "issue_5724.py"), + "--enable=missing-final-newline", + ], + reporter=TextReporter(), + ) + assert cm.value.code == 0 diff --git a/tests/regrtest_data/issue_5724.py b/tests/regrtest_data/issue_5724.py new file mode 100644 index 0000000000..dad184c432 --- /dev/null +++ b/tests/regrtest_data/issue_5724.py @@ -0,0 +1 @@ +a = "a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #a #" From 9baa5b228a3c111a42edef026615f3d9584c63df Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Fri, 18 Mar 2022 06:16:23 +0300 Subject: [PATCH 062/473] Use pytest-timeout for tests --- requirements_test_min.txt | 1 + tests/checkers/unittest_refactoring.py | 44 ++++++++------------------ tests/test_regr.py | 30 +++--------------- 3 files changed, 19 insertions(+), 56 deletions(-) diff --git a/requirements_test_min.txt b/requirements_test_min.txt index f577fbddcd..83f1a88101 100644 --- a/requirements_test_min.txt +++ b/requirements_test_min.txt @@ -4,3 +4,4 @@ astroid==2.11.0 # Pinned to a specific version for tests typing-extensions~=4.1 pytest~=7.0 pytest-benchmark~=3.4 +pytest-timeout~=2.1 diff --git a/tests/checkers/unittest_refactoring.py b/tests/checkers/unittest_refactoring.py index 760eb2fe85..86ed28a4da 100644 --- a/tests/checkers/unittest_refactoring.py +++ b/tests/checkers/unittest_refactoring.py @@ -2,8 +2,6 @@ # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE import os -import signal -from contextlib import contextmanager import pytest @@ -14,36 +12,22 @@ REGR_DATA = os.path.join(PARENT_DIR, "regrtest_data") -@contextmanager -def timeout(timeout_s: float): - def _handle(_signum, _frame): - pytest.fail("Test took too long") - - signal.signal(signal.SIGALRM, _handle) - signal.setitimer(signal.ITIMER_REAL, timeout_s) - yield - signal.setitimer(signal.ITIMER_REAL, 0) - signal.signal(signal.SIGALRM, signal.SIG_DFL) - - -@pytest.mark.skipif(not hasattr(signal, "setitimer"), reason="Assumes POSIX signals") +@pytest.mark.timeout(8) def test_process_tokens() -> None: - with timeout(8.0): - with pytest.raises(SystemExit) as cm: - Run([os.path.join(REGR_DATA, "very_long_line.py")], reporter=TextReporter()) - assert cm.value.code == 0 + with pytest.raises(SystemExit) as cm: + Run([os.path.join(REGR_DATA, "very_long_line.py")], reporter=TextReporter()) + assert cm.value.code == 0 -@pytest.mark.skipif(not hasattr(signal, "setitimer"), reason="Assumes POSIX signals") +@pytest.mark.timeout(25) def test_issue_5724() -> None: """Regression test for parsing of pylint disable pragma's.""" - with timeout(25.0): - with pytest.raises(SystemExit) as cm: - Run( - [ - os.path.join(REGR_DATA, "issue_5724.py"), - "--enable=missing-final-newline", - ], - reporter=TextReporter(), - ) - assert cm.value.code == 0 + with pytest.raises(SystemExit) as cm: + Run( + [ + os.path.join(REGR_DATA, "issue_5724.py"), + "--enable=missing-final-newline", + ], + reporter=TextReporter(), + ) + assert cm.value.code == 0 diff --git a/tests/test_regr.py b/tests/test_regr.py index 3ece9c9873..2980057c6e 100644 --- a/tests/test_regr.py +++ b/tests/test_regr.py @@ -23,9 +23,7 @@ # pylint: disable=redefined-outer-name import os -import signal import sys -from contextlib import contextmanager from os.path import abspath, dirname, join from typing import Callable, Iterator, List, cast @@ -154,27 +152,7 @@ def test_pylint_config_attr() -> None: assert inferred[0].name == "Values" -@contextmanager -def timeout(timeout_s: float): - def _handle(_signum, _frame): - pytest.fail("timed out") - - signal.signal(signal.SIGALRM, _handle) - signal.setitimer(signal.ITIMER_REAL, timeout_s) - yield - signal.setitimer(signal.ITIMER_REAL, 0) - signal.signal(signal.SIGALRM, signal.SIG_DFL) - - -@pytest.mark.skipif(not hasattr(signal, "setitimer"), reason="Assumes POSIX signals") -@pytest.mark.parametrize( - "file_names,timeout_s", - [ - ([join(REGR_DATA, "hang", "pkg4972.string")], 30.0), - ], -) -def test_hang( - finalize_linter: PyLinter, file_names: List[str], timeout_s: float -) -> None: - with timeout(timeout_s): - finalize_linter.check(file_names) +@pytest.mark.timeout(30) +@pytest.mark.parametrize("file_names", ([join(REGR_DATA, "hang", "pkg4972.string")],)) +def test_hang(finalize_linter: PyLinter, file_names: List[str]) -> None: + finalize_linter.check(file_names) From 2a33b6742ec5cc0bc718ef6cc691ed16684b8cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=A9o=20Bouvard?= Date: Sat, 19 Mar 2022 11:35:53 +0100 Subject: [PATCH 063/473] Fix pyreverse type hints for methods returning None (#5916) --- ChangeLog | 2 ++ doc/whatsnew/2.13.rst | 2 ++ pylint/pyreverse/utils.py | 13 ++++++----- tests/data/clientmodule_test.py | 3 +++ tests/pyreverse/data/classes_No_Name.dot | 2 +- tests/pyreverse/data/classes_No_Name.html | 1 + tests/pyreverse/data/classes_No_Name.mmd | 1 + tests/pyreverse/data/classes_No_Name.puml | 1 + tests/pyreverse/data/classes_No_Name.vcg | 2 +- tests/pyreverse/data/classes_colorized.dot | 2 +- tests/pyreverse/data/classes_colorized.puml | 1 + tests/pyreverse/test_utils.py | 24 ++++++++++++++++++++- 12 files changed, 43 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 99ad7a2374..49a41526ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,8 @@ Release date: TBA * Fix pyreverse diagrams type hinting for classmethods and staticmethods. +* Fix pyreverse diagrams type hinting for methods returning None. + * Fix matching ``--notes`` options that end in a non-word character. Closes #5840 diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index d0696f1dbe..687274a652 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -506,3 +506,5 @@ Other Changes * Fixed false positive for ``global-variable-not-assigned`` when the ``del`` statement is used Closes #5333 + +* Fix type hints in class diagrams generated by pyreverse for class methods and methods returning None. diff --git a/pylint/pyreverse/utils.py b/pylint/pyreverse/utils.py index 52bfb4fbdd..7fde44225b 100644 --- a/pylint/pyreverse/utils.py +++ b/pylint/pyreverse/utils.py @@ -224,13 +224,12 @@ def visit(self, node): return None -def get_annotation_label(ann: Union[nodes.Name, nodes.Subscript]) -> str: - label = "" - if isinstance(ann, nodes.Subscript): - label = ann.as_string() - elif isinstance(ann, nodes.Name): - label = ann.name - return label +def get_annotation_label(ann: Union[nodes.Name, nodes.NodeNG]) -> str: + if isinstance(ann, nodes.Name) and ann.name is not None: + return ann.name + if isinstance(ann, nodes.NodeNG): + return ann.as_string() + return "" def get_annotation( diff --git a/tests/data/clientmodule_test.py b/tests/data/clientmodule_test.py index 257aadec1d..35c39684b5 100644 --- a/tests/data/clientmodule_test.py +++ b/tests/data/clientmodule_test.py @@ -36,3 +36,6 @@ def from_value(cls, value: int): @staticmethod def transform_value(value: int) -> int: return value * 2 + + def increment_value(self) -> None: + self.set_value(self.get_value() + 1) diff --git a/tests/pyreverse/data/classes_No_Name.dot b/tests/pyreverse/data/classes_No_Name.dot index e5a304ce37..1f3f705e78 100644 --- a/tests/pyreverse/data/classes_No_Name.dot +++ b/tests/pyreverse/data/classes_No_Name.dot @@ -8,7 +8,7 @@ charset="utf-8" "data.suppliermodule_test.DoSomething" [color="black", fontcolor="black", label="{DoSomething|my_int : Optional[int]\lmy_int_2 : Optional[int]\lmy_string : str\l|do_it(new_int: int): int\l}", shape="record", style="solid"]; "data.suppliermodule_test.Interface" [color="black", fontcolor="black", label="{Interface|\l|get_value()\lset_value(value)\l}", shape="record", style="solid"]; "data.property_pattern.PropertyPatterns" [color="black", fontcolor="black", label="{PropertyPatterns|prop1\lprop2\l|}", shape="record", style="solid"]; -"data.clientmodule_test.Specialization" [color="black", fontcolor="black", label="{Specialization|TYPE : str\lrelation\lrelation2\ltop : str\l|from_value(value: int)\ltransform_value(value: int): int\l}", shape="record", style="solid"]; +"data.clientmodule_test.Specialization" [color="black", fontcolor="black", label="{Specialization|TYPE : str\lrelation\lrelation2\ltop : str\l|from_value(value: int)\lincrement_value(): None\ltransform_value(value: int): int\l}", shape="record", style="solid"]; "data.clientmodule_test.Specialization" -> "data.clientmodule_test.Ancestor" [arrowhead="empty", arrowtail="none"]; "data.clientmodule_test.Ancestor" -> "data.suppliermodule_test.Interface" [arrowhead="empty", arrowtail="node", style="dashed"]; "data.suppliermodule_test.DoNothing" -> "data.clientmodule_test.Ancestor" [arrowhead="diamond", arrowtail="none", fontcolor="green", label="cls_member", style="solid"]; diff --git a/tests/pyreverse/data/classes_No_Name.html b/tests/pyreverse/data/classes_No_Name.html index 420a869d4f..b4ada04b85 100644 --- a/tests/pyreverse/data/classes_No_Name.html +++ b/tests/pyreverse/data/classes_No_Name.html @@ -36,6 +36,7 @@ relation2 top : str from_value(value: int) + increment_value() -> None transform_value(value: int) -> int } Specialization --|> Ancestor diff --git a/tests/pyreverse/data/classes_No_Name.mmd b/tests/pyreverse/data/classes_No_Name.mmd index 50da7f39cf..efdaacae19 100644 --- a/tests/pyreverse/data/classes_No_Name.mmd +++ b/tests/pyreverse/data/classes_No_Name.mmd @@ -31,6 +31,7 @@ classDiagram relation2 top : str from_value(value: int) + increment_value() -> None transform_value(value: int) -> int } Specialization --|> Ancestor diff --git a/tests/pyreverse/data/classes_No_Name.puml b/tests/pyreverse/data/classes_No_Name.puml index a0f8350d0d..37767b321c 100644 --- a/tests/pyreverse/data/classes_No_Name.puml +++ b/tests/pyreverse/data/classes_No_Name.puml @@ -32,6 +32,7 @@ class "Specialization" as data.clientmodule_test.Specialization { relation2 top : str from_value(value: int) + increment_value() -> None transform_value(value: int) -> int } data.clientmodule_test.Specialization --|> data.clientmodule_test.Ancestor diff --git a/tests/pyreverse/data/classes_No_Name.vcg b/tests/pyreverse/data/classes_No_Name.vcg index 6497f26b4e..4c792db698 100644 --- a/tests/pyreverse/data/classes_No_Name.vcg +++ b/tests/pyreverse/data/classes_No_Name.vcg @@ -25,7 +25,7 @@ graph:{ node: {title:"data.property_pattern.PropertyPatterns" label:"\fbPropertyPatterns\fn\n\f__________________\n\f08prop1\n\f08prop2\n\f__________________" shape:box } - node: {title:"data.clientmodule_test.Specialization" label:"\fbSpecialization\fn\n\f_________________\n\f08TYPE : str\n\f08relation\n\f08relation2\n\f08top : str\n\f_________________\n\f10from_value()\n\f10transform_value()" + node: {title:"data.clientmodule_test.Specialization" label:"\fbSpecialization\fn\n\f_________________\n\f08TYPE : str\n\f08relation\n\f08relation2\n\f08top : str\n\f_________________\n\f10from_value()\n\f10increment_value()\n\f10transform_value()" shape:box } edge: {sourcename:"data.clientmodule_test.Specialization" targetname:"data.clientmodule_test.Ancestor" arrowstyle:solid diff --git a/tests/pyreverse/data/classes_colorized.dot b/tests/pyreverse/data/classes_colorized.dot index 3b68c79336..72f30658db 100644 --- a/tests/pyreverse/data/classes_colorized.dot +++ b/tests/pyreverse/data/classes_colorized.dot @@ -8,7 +8,7 @@ charset="utf-8" "data.suppliermodule_test.DoSomething" [color="aliceblue", fontcolor="black", label="{DoSomething|my_int : Optional[int]\lmy_int_2 : Optional[int]\lmy_string : str\l|do_it(new_int: int): int\l}", shape="record", style="filled"]; "data.suppliermodule_test.Interface" [color="aliceblue", fontcolor="black", label="{Interface|\l|get_value()\lset_value(value)\l}", shape="record", style="filled"]; "data.property_pattern.PropertyPatterns" [color="aliceblue", fontcolor="black", label="{PropertyPatterns|prop1\lprop2\l|}", shape="record", style="filled"]; -"data.clientmodule_test.Specialization" [color="aliceblue", fontcolor="black", label="{Specialization|TYPE : str\lrelation\lrelation2\ltop : str\l|from_value(value: int)\ltransform_value(value: int): int\l}", shape="record", style="filled"]; +"data.clientmodule_test.Specialization" [color="aliceblue", fontcolor="black", label="{Specialization|TYPE : str\lrelation\lrelation2\ltop : str\l|from_value(value: int)\lincrement_value(): None\ltransform_value(value: int): int\l}", shape="record", style="filled"]; "data.clientmodule_test.Specialization" -> "data.clientmodule_test.Ancestor" [arrowhead="empty", arrowtail="none"]; "data.clientmodule_test.Ancestor" -> "data.suppliermodule_test.Interface" [arrowhead="empty", arrowtail="node", style="dashed"]; "data.suppliermodule_test.DoNothing" -> "data.clientmodule_test.Ancestor" [arrowhead="diamond", arrowtail="none", fontcolor="green", label="cls_member", style="solid"]; diff --git a/tests/pyreverse/data/classes_colorized.puml b/tests/pyreverse/data/classes_colorized.puml index 8a37f090f4..1226f7b4e6 100644 --- a/tests/pyreverse/data/classes_colorized.puml +++ b/tests/pyreverse/data/classes_colorized.puml @@ -32,6 +32,7 @@ class "Specialization" as data.clientmodule_test.Specialization #aliceblue { relation2 top : str from_value(value: int) + increment_value() -> None transform_value(value: int) -> int } data.clientmodule_test.Specialization --|> data.clientmodule_test.Ancestor diff --git a/tests/pyreverse/test_utils.py b/tests/pyreverse/test_utils.py index f571b18473..322b5bea24 100644 --- a/tests/pyreverse/test_utils.py +++ b/tests/pyreverse/test_utils.py @@ -17,7 +17,12 @@ import pytest from astroid import nodes -from pylint.pyreverse.utils import get_annotation, get_visibility, infer_node +from pylint.pyreverse.utils import ( + get_annotation, + get_annotation_label, + get_visibility, + infer_node, +) @pytest.mark.parametrize( @@ -81,6 +86,23 @@ class A: assert got == label, f"got {got} instead of {label} for value {node}" +@pytest.mark.parametrize( + "node_text, expected_label", + [ + ("def f() -> None: pass", "None"), + ("def f() -> int: pass", "int"), + ("def f(a) -> Optional[int]: return 1 if a else None", "Optional[int]"), + ("def f() -> 'MyType': pass", "'MyType'"), + ], +) +def test_get_annotation_label_of_return_type( + node_text: str, expected_label: str +) -> None: + func = astroid.extract_node(node_text) + assert isinstance(func, nodes.FunctionDef) + assert get_annotation_label(func.returns) == expected_label + + @patch("pylint.pyreverse.utils.get_annotation") @patch("astroid.node_classes.NodeNG.infer", side_effect=astroid.InferenceError) def test_infer_node_1(mock_infer: Any, mock_get_annotation: Any) -> None: From a03c92ab51d0fe8488352e88465ab5351314ec36 Mon Sep 17 00:00:00 2001 From: Joseph Young <80432516+jpy-git@users.noreply.github.com> Date: Sun, 20 Mar 2022 07:01:01 +0000 Subject: [PATCH 064/473] Update "How to Write a Checker" docs (#5939) Make init arg optional to satisfy mypy. Co-authored-by: Pierre Sassoulas --- doc/how_tos/custom_checkers.rst | 70 ++++++++++++++++----------------- 1 file changed, 33 insertions(+), 37 deletions(-) diff --git a/doc/how_tos/custom_checkers.rst b/doc/how_tos/custom_checkers.rst index 30c70d63a6..bfa623a9d4 100644 --- a/doc/how_tos/custom_checkers.rst +++ b/doc/how_tos/custom_checkers.rst @@ -37,30 +37,36 @@ Firstly we will need to fill in some required boilerplate: import astroid from astroid import nodes + from typing import TYPE_CHECKING, Optional from pylint.checkers import BaseChecker from pylint.interfaces import IAstroidChecker - from pylint.lint import PyLinter + + if TYPE_CHECKING: + from pylint.lint import PyLinter + class UniqueReturnChecker(BaseChecker): __implements__ = IAstroidChecker - name = 'unique-returns' + name = "unique-returns" priority = -1 msgs = { - 'W0001': ( - 'Returns a non-unique constant.', - 'non-unique-returns', - 'All constants returned in a function should be unique.' + "W0001": ( + "Returns a non-unique constant.", + "non-unique-returns", + "All constants returned in a function should be unique.", ), } options = ( ( - 'ignore-ints', + "ignore-ints", { - 'default': False, 'type': 'yn', 'metavar' : '', - 'help': 'Allow returning non-unique integers', - } + "default": False, + "type": "yn", + "metavar": "", + "help": "Allow returning non-unique integers", + }, ), ) @@ -79,20 +85,19 @@ So far we have defined the following required components of our checker: going to emit. It has the following format:: msgs = { - 'message-id': ( - 'displayed-message', 'message-symbol', 'message-help' + "message-id": ( + "displayed-message", "message-symbol", "message-help" ) } + * The ``message-id`` should be a 4-digit number, prefixed with a **message category**. There are multiple message categories, these being ``C``, ``W``, ``E``, ``F``, ``R``, standing for ``Convention``, ``Warning``, ``Error``, ``Fatal`` and ``Refactoring``. - The rest of the 5 digits should not conflict with existing checkers - and they should be consistent across the checker. - For instance, - the first two digits should not be different across the checker. + The 4 digits should not conflict with existing checkers + and the first 2 digits should consistent across the checker. * The ``displayed-message`` is used for displaying the message to the user, once it is emitted. @@ -107,9 +112,10 @@ The options list defines any user configurable options. It has the following format:: options = ( - 'option-symbol': {'argparse-like-kwarg': 'value'}, + ("option-symbol", {"argparse-like-kwarg": "value"}), ) + * The ``option-symbol`` is a unique name for the option. This is used on the command line and in config files. The hyphen is replaced by an underscore when used in the checker, @@ -119,8 +125,8 @@ Next we'll track when we enter and leave a function. .. code-block:: python - def __init__(self, linter: PyLinter =None) -> None: - super(UniqueReturnChecker, self).__init__(linter) + def __init__(self, linter: Optional["PyLinter"] = None) -> None: + super().__init__(linter) self._function_stack = [] def visit_functiondef(self, node: nodes.FunctionDef) -> None: @@ -145,7 +151,7 @@ which is called with an :class:`.astroid.nodes.Return` node. .. _astroid_extract_node: .. TODO We can shorten/remove this bit once astroid has API docs. -We'll need to be able to figure out what attributes a +We'll need to be able to figure out what attributes an :class:`.astroid.nodes.Return` node has available. We can use :func:`astroid.extract_node` for this:: @@ -163,7 +169,7 @@ We could also construct a more complete example:: ... if True: ... return 5 #@ ... return 5 #@ - """) + ... """) >>> node_a.value >>> node_a.value.value @@ -183,13 +189,11 @@ Now we know how to use the astroid node, we can implement our check. def visit_return(self, node: nodes.Return) -> None: if not isinstance(node.value, nodes.Const): return - for other_return in self._function_stack[-1]: - if (node.value.value == other_return.value.value and - not (self.config.ignore_ints and node.value.pytype() == int)): - self.add_message( - 'non-unique-returns', node=node, - ) + if node.value.value == other_return.value.value and not ( + self.config.ignore_ints and node.value.pytype() == int + ): + self.add_message("non-unique-returns", node=node) self._function_stack[-1].append(node) @@ -201,17 +205,8 @@ Add the ``register`` function to the top level of the file. .. code-block:: python - from typing import TYPE_CHECKING - - import astroid - - if TYPE_CHECKING: - from pylint.lint import PyLinter - - def register(linter: "PyLinter") -> None: """This required method auto registers the checker during initialization. - :param linter: The linter to register the checker to. """ linter.register_checker(UniqueReturnChecker(linter)) @@ -269,6 +264,7 @@ We can use the example code that we used for debugging as our test cases. import my_plugin import pylint.testutils + class TestUniqueReturnChecker(pylint.testutils.CheckerTestCase): CHECKER_CLASS = my_plugin.UniqueReturnChecker @@ -284,7 +280,7 @@ We can use the example code that we used for debugging as our test cases. self.checker.visit_return(return_node_a) with self.assertAddsMessages( pylint.testutils.MessageTest( - msg_id='non-unique-returns', + msg_id="non-unique-returns", node=return_node_b, ), ): From d0e9fb1b24370a8a58c53b680340860aaeff7c29 Mon Sep 17 00:00:00 2001 From: Joe Young <80432516+jpy-git@users.noreply.github.com> Date: Mon, 21 Mar 2022 08:46:21 +0000 Subject: [PATCH 065/473] Add missing __magic__ methods to `_SPECIAL_METHODS_PARAMS` (#5941) --- CONTRIBUTORS.txt | 1 + ChangeLog | 2 ++ doc/whatsnew/2.13.rst | 2 ++ pylint/checkers/utils.py | 2 ++ .../u/unexpected_special_method_signature.py | 6 ++++++ .../u/unexpected_special_method_signature.txt | 18 ++++++++++-------- 6 files changed, 23 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 989f9297d0..3232f61cf8 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -356,3 +356,4 @@ contributors: - Téo Bouvard - Konrad Weihmann - Sergey B Kirpichev +- Joseph Young (jpy-git) diff --git a/ChangeLog b/ChangeLog index 49a41526ca..24e7bdbde9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ Release date: TBA .. Put new features here and also in 'doc/whatsnew/2.13.rst' +* Add missing dunder methods to ``unexpected-special-method-signature`` check. + * No longer emit ``no-member`` in for loops that reference ``self`` if the binary operation that started the for loop uses a ``self`` that is encapsulated in tuples or lists. diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 687274a652..c48703c3ff 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -110,6 +110,8 @@ Extensions Other Changes ============= +* Add missing dunder methods to ``unexpected-special-method-signature`` check. + * No longer emit ``no-member`` in for loops that reference ``self`` if the binary operation that started the for loop uses a ``self`` that is encapsulated in tuples or lists. diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py index f8b7b74e30..6966bf16f9 100644 --- a/pylint/checkers/utils.py +++ b/pylint/checkers/utils.py @@ -160,6 +160,8 @@ "__aiter__", "__anext__", "__fspath__", + "__subclasses__", + "__init_subclass__", ), 1: ( "__format__", diff --git a/tests/functional/u/unexpected_special_method_signature.py b/tests/functional/u/unexpected_special_method_signature.py index aba6811b92..e4d14bc489 100644 --- a/tests/functional/u/unexpected_special_method_signature.py +++ b/tests/functional/u/unexpected_special_method_signature.py @@ -30,6 +30,12 @@ def __iter__(): # [no-method-argument] def __getattr__(self, nanana): # [unexpected-special-method-signature] pass + def __subclasses__(self, blabla): # [unexpected-special-method-signature] + pass + + @classmethod + def __init_subclass__(cls, blabla): # [unexpected-special-method-signature] + pass class FirstBadContextManager(object): def __enter__(self): diff --git a/tests/functional/u/unexpected_special_method_signature.txt b/tests/functional/u/unexpected_special_method_signature.txt index dd9297f16d..072e78b83f 100644 --- a/tests/functional/u/unexpected_special_method_signature.txt +++ b/tests/functional/u/unexpected_special_method_signature.txt @@ -6,11 +6,13 @@ unexpected-special-method-signature:20:4:20:17:Invalid.__round__:The special met unexpected-special-method-signature:23:4:23:20:Invalid.__deepcopy__:The special method '__deepcopy__' expects 1 param(s), 2 were given:UNDEFINED no-method-argument:26:4:26:16:Invalid.__iter__:Method has no argument:UNDEFINED unexpected-special-method-signature:30:4:30:19:Invalid.__getattr__:The special method '__getattr__' expects 1 param(s), 2 were given:UNDEFINED -unexpected-special-method-signature:37:4:37:16:FirstBadContextManager.__exit__:The special method '__exit__' expects 3 param(s), 1 was given:UNDEFINED -unexpected-special-method-signature:43:4:43:16:SecondBadContextManager.__exit__:The special method '__exit__' expects 3 param(s), 4 were given:UNDEFINED -unexpected-special-method-signature:51:4:51:16:ThirdBadContextManager.__exit__:The special method '__exit__' expects 3 param(s), 4 were given:UNDEFINED -unexpected-special-method-signature:57:4:57:17:Async.__aiter__:The special method '__aiter__' expects 0 param(s), 1 was given:UNDEFINED -unexpected-special-method-signature:59:4:59:17:Async.__anext__:The special method '__anext__' expects 0 param(s), 2 were given:UNDEFINED -unexpected-special-method-signature:61:4:61:17:Async.__await__:The special method '__await__' expects 0 param(s), 1 was given:UNDEFINED -unexpected-special-method-signature:63:4:63:18:Async.__aenter__:The special method '__aenter__' expects 0 param(s), 1 was given:UNDEFINED -unexpected-special-method-signature:65:4:65:17:Async.__aexit__:The special method '__aexit__' expects 3 param(s), 0 was given:UNDEFINED +unexpected-special-method-signature:33:4:33:22:Invalid.__subclasses__:The special method '__subclasses__' expects 0 param(s), 1 was given:UNDEFINED +unexpected-special-method-signature:37:4:37:25:Invalid.__init_subclass__:The special method '__init_subclass__' expects 0 param(s), 1 was given:UNDEFINED +unexpected-special-method-signature:43:4:43:16:FirstBadContextManager.__exit__:The special method '__exit__' expects 3 param(s), 1 was given:UNDEFINED +unexpected-special-method-signature:49:4:49:16:SecondBadContextManager.__exit__:The special method '__exit__' expects 3 param(s), 4 were given:UNDEFINED +unexpected-special-method-signature:57:4:57:16:ThirdBadContextManager.__exit__:The special method '__exit__' expects 3 param(s), 4 were given:UNDEFINED +unexpected-special-method-signature:63:4:63:17:Async.__aiter__:The special method '__aiter__' expects 0 param(s), 1 was given:UNDEFINED +unexpected-special-method-signature:65:4:65:17:Async.__anext__:The special method '__anext__' expects 0 param(s), 2 were given:UNDEFINED +unexpected-special-method-signature:67:4:67:17:Async.__await__:The special method '__await__' expects 0 param(s), 1 was given:UNDEFINED +unexpected-special-method-signature:69:4:69:18:Async.__aenter__:The special method '__aenter__' expects 0 param(s), 1 was given:UNDEFINED +unexpected-special-method-signature:71:4:71:17:Async.__aexit__:The special method '__aexit__' expects 3 param(s), 0 was given:UNDEFINED From 2cb553658ebb97fb4326ddcb6bbd904efa6e520a Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Mon, 21 Mar 2022 04:49:45 -0400 Subject: [PATCH 066/473] Fix #4590: `used-before-assignment` false positive for class definition in function scope (#5937) --- ChangeLog | 5 ++++ doc/whatsnew/2.13.rst | 5 ++++ pylint/checkers/variables.py | 28 ++++++++++++++----- ..._assignment_class_nested_under_function.py | 13 +++++++++ 4 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 tests/functional/u/used/used_before_assignment_class_nested_under_function.py diff --git a/ChangeLog b/ChangeLog index 24e7bdbde9..c1917c330c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -376,6 +376,11 @@ Release date: TBA Closes #5679 +* Fix false positive for ``used-before-assignment`` from a class definition + nested under a function subclassing a class defined outside the function. + + Closes #4590 + * Fix ``unnecessary_dict_index_lookup`` false positive when deleting a dictionary's entry. Closes #4716 diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index c48703c3ff..7b2f181653 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -267,6 +267,11 @@ Other Changes Closes #5724 +* Fix false positive for ``used-before-assignment`` from a class definition + nested under a function subclassing a class defined outside the function. + + Closes #4590 + * Fix ``unnecessary_dict_index_lookup`` false positive when deleting a dictionary's entry. Closes #4716 diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index d05f578c05..3580e660e9 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -236,27 +236,41 @@ def _get_unpacking_extra_info(node, inferred): def _detect_global_scope(node, frame, defframe): - """Detect that the given frames shares a global - scope. + """Detect that the given frames share a global scope. - Two frames shares a global scope when neither + Two frames share a global scope when neither of them are hidden under a function scope, as well - as any of parent scope of them, until the root scope. + as any parent scope of them, until the root scope. In this case, depending from something defined later on - will not work, because it is still undefined. + will only work if guarded by a nested function definition. Example: class A: # B has the same global scope as `C`, leading to a NameError. + # Return True to indicate a shared scope. class B(C): ... class C: ... + Whereas this does not lead to a NameError: + class A: + def guard(): + # Return False to indicate no scope sharing. + class B(C): ... + class C: ... """ def_scope = scope = None if frame and frame.parent: scope = frame.parent.scope() if defframe and defframe.parent: def_scope = defframe.parent.scope() + if ( + isinstance(frame, nodes.ClassDef) + and scope is not def_scope + and scope is utils.get_node_first_ancestor_of_type(node, nodes.FunctionDef) + ): + # If the current node's scope is a class nested under a function, + # and the def_scope is something else, then they aren't shared. + return False if isinstance(frame, nodes.FunctionDef): # If the parent of the current node is a # function, then it can be under its scope @@ -290,12 +304,12 @@ class C: ... if break_scopes and len(set(break_scopes)) != 1: # Store different scopes than expected. # If the stored scopes are, in fact, the very same, then it means - # that the two frames (frame and defframe) shares the same scope, + # that the two frames (frame and defframe) share the same scope, # and we could apply our lineno analysis over them. # For instance, this works when they are inside a function, the node # that uses a definition and the definition itself. return False - # At this point, we are certain that frame and defframe shares a scope + # At this point, we are certain that frame and defframe share a scope # and the definition of the first depends on the second. return frame.lineno < defframe.lineno diff --git a/tests/functional/u/used/used_before_assignment_class_nested_under_function.py b/tests/functional/u/used/used_before_assignment_class_nested_under_function.py new file mode 100644 index 0000000000..3627ae1e19 --- /dev/null +++ b/tests/functional/u/used/used_before_assignment_class_nested_under_function.py @@ -0,0 +1,13 @@ +"""https://github.com/PyCQA/pylint/issues/4590""" +# pylint: disable=too-few-public-methods + + +def conditional_class_factory(): + """Define a nested class""" + class ConditionalClass(ModuleClass): + """Subclasses a name from the module scope""" + return ConditionalClass + + +class ModuleClass: + """Module-level class""" From 2239270bfe56558b86381bfd86e08fbe58685374 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Mar 2022 15:17:02 +0100 Subject: [PATCH 067/473] Bump mypy from 0.940 to 0.941 (#5945) Bumps [mypy](https://github.com/python/mypy) from 0.940 to 0.941. - [Release notes](https://github.com/python/mypy/releases) - [Commits](https://github.com/python/mypy/compare/v0.940...v0.941) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements_test_pre_commit.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_test_pre_commit.txt b/requirements_test_pre_commit.txt index 31bca7e84c..0f5bf008f8 100644 --- a/requirements_test_pre_commit.txt +++ b/requirements_test_pre_commit.txt @@ -4,4 +4,4 @@ black==22.1.0 flake8==4.0.1 flake8-typing-imports==1.12.0 isort==5.10.1 -mypy==0.940 +mypy==0.941 From ffd23d47c5df1eb1feccfab868a692fb57f1664c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Mar 2022 15:58:36 +0100 Subject: [PATCH 068/473] Bump actions/cache from 2.1.7 to 3 (#5944) * Bump actions/cache from 2.1.7 to 3 Bumps [actions/cache](https://github.com/actions/cache) from 2.1.7 to 3. - [Release notes](https://github.com/actions/cache/releases) - [Commits](https://github.com/actions/cache/compare/v2.1.7...v3) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: Pierre Sassoulas --- .github/workflows/ci.yaml | 26 +++++++++++++------------- .github/workflows/primer-test.yaml | 8 ++++---- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0ead6e5d76..5bf14f0601 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -39,7 +39,7 @@ jobs: }}" - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.0 with: path: venv key: >- @@ -61,7 +61,7 @@ jobs: hashFiles('.pre-commit-config.yaml') }}" - name: Restore pre-commit environment id: cache-precommit - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.0 with: path: ${{ env.PRE_COMMIT_CACHE }} key: >- @@ -89,7 +89,7 @@ jobs: python-version: ${{ env.DEFAULT_PYTHON }} - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.0 with: path: venv key: @@ -102,7 +102,7 @@ jobs: exit 1 - name: Restore pre-commit environment id: cache-precommit - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.0 with: path: ${{ env.PRE_COMMIT_CACHE }} key: ${{ runner.os }}-${{ needs.prepare-base.outputs.pre-commit-key }} @@ -132,7 +132,7 @@ jobs: python-version: ${{ env.DEFAULT_PYTHON }} - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.0 with: path: venv key: @@ -175,7 +175,7 @@ jobs: }}" - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.0 with: path: venv key: >- @@ -210,7 +210,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.0 with: path: venv key: @@ -251,7 +251,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.0 with: path: venv key: @@ -295,7 +295,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.0 with: path: venv key: @@ -356,7 +356,7 @@ jobs: }}" - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.0 with: path: venv key: >- @@ -395,7 +395,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.0 with: path: venv key: @@ -438,7 +438,7 @@ jobs: }}" - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.0 with: path: venv key: >- @@ -473,7 +473,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.0 with: path: venv key: diff --git a/.github/workflows/primer-test.yaml b/.github/workflows/primer-test.yaml index 566fc3ecea..e1c321b38e 100644 --- a/.github/workflows/primer-test.yaml +++ b/.github/workflows/primer-test.yaml @@ -48,7 +48,7 @@ jobs: }}" - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.0 with: path: venv key: >- @@ -82,7 +82,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.0 with: path: venv key: @@ -117,7 +117,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.0 with: path: venv key: @@ -152,7 +152,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.0 with: path: venv key: From fd731589ac56e44434046345e2b39bcc18edbf93 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Mon, 21 Mar 2022 17:57:38 +0100 Subject: [PATCH 069/473] Migrate current copyrite configuration to new format --- .../.contributors_aliases.json | 57 +++++++------------ 1 file changed, 21 insertions(+), 36 deletions(-) rename .copyrite_aliases => script/.contributors_aliases.json (72%) diff --git a/.copyrite_aliases b/script/.contributors_aliases.json similarity index 72% rename from .copyrite_aliases rename to script/.contributors_aliases.json index 0645ec2fa1..2eb3a84f70 100644 --- a/.copyrite_aliases +++ b/script/.contributors_aliases.json @@ -1,19 +1,17 @@ -[ - { +{ + "pcmanticore@gmail.com": { "mails": ["cpopa@cloudbasesolutions.com", "pcmanticore@gmail.com"], - "authoritative_mail": "pcmanticore@gmail.com", "name": "Claudiu Popa" }, - { + "pierre.sassoulas@gmail.com": { "mails": [ "pierre.sassoulas@gmail.com", "pierre.sassoulas@cea.fr", "pierre.sassoulas@wisebim.fr" ], - "authoritative_mail": "pierre.sassoulas@gmail.com", "name": "Pierre Sassoulas" }, - { + "contact@logilab.fr": { "mails": [ "alexandre.fayolle@logilab.fr", "emile.anclin@logilab.fr", @@ -33,15 +31,13 @@ "julien.jehannet@logilab.fr", "lmedioni@logilab.fr" ], - "authoritative_mail": "contact@logilab.fr", "name": "LOGILAB S.A. (Paris, FRANCE)" }, - { + "moylop260@vauxoo.com": { "mails": ["moylop260@vauxoo.com"], - "name": "Moises Lopez", - "authoritative_mail": "moylop260@vauxoo.com" + "name": "Moises Lopez" }, - { + "no-reply@google.com": { "mails": [ "nathaniel@google.com", "mbp@google.com", @@ -52,71 +48,60 @@ ], "name": "Google, Inc." }, - { + "ashley@awhetter.co.uk": { "mails": [ "ashley@awhetter.co.uk", "awhetter.2011@my.bristol.ac.uk", "asw@dneg.com", "AWhetter@users.noreply.github.com" ], - "name": "Ashley Whetter", - "authoritative_mail": "ashley@awhetter.co.uk" + "name": "Ashley Whetter" }, - { + "ville.skytta@iki.fi": { "mails": ["ville.skytta@iki.fi", "ville.skytta@upcloud.com"], - "authoritative_mail": "ville.skytta@iki.fi", "name": "Ville Skyttä" }, - { + "ejfine@gmail.com": { "mails": [ "ubuntu@ip-172-31-89-59.ec2.internal", "eli88fine@gmail.com", "ejfine@gmail.com" ], - "authoritative_mail": "ejfine@gmail.com", "name": "Eli Fine" }, - { + "andi.finkler@gmail.com": { "mails": ["andi.finkler@gmail.com", "3929834+DudeNr33@users.noreply.github.com"], - "authoritative_mail": "andi.finkler@gmail.com", "name": "Andreas Finkler" }, - { + "matusvalo@users.noreply.github.com": { "mails": ["matusvalo@users.noreply.github.com", "matusvalo@gmail.com"], - "authoritative_mail": "matusvalo@users.noreply.github.com", "name": "Matus Valo" }, - { + "nickpesce22@gmail.com": { "mails": ["nickpesce22@gmail.com", "npesce@terpmail.umd.edu"], - "authoritative_mail": "nickpesce22@gmail.com", "name": "Nick Pesce" }, - { + "31762852+mbyrnepr2@users.noreply.github.com": { "mails": ["31762852+mbyrnepr2@users.noreply.github.com", "mbyrnepr2@gmail.com"], - "authoritative_mail": "31762852+mbyrnepr2@users.noreply.github.com", "name": "Mark Byrne" }, - { + "36848472+yushao2@users.noreply.github.com": { "mails": ["36848472+yushao2@users.noreply.github.com", "p.yushao2@gmail.com"], - "authoritative_mail": "36848472+yushao2@users.noreply.github.com", "name": "Yu Shao, Pang" }, - { + "bot@noreply.github.com": { "mails": [ "66853113+pre-commit-ci[bot]@users.noreply.github.com", "49699333+dependabot[bot]@users.noreply.github.com" ], - "authoritative_mail": "bot@noreply.github.com", "name": "bot" }, - { + "tushar.sadhwani000@gmail.com": { "mails": ["tushar.sadhwani000@gmail.com", "tushar@deepsource.io"], - "authoritative_mail": "tushar.sadhwani000@gmail.com", "name": "Tushar Sadhwani" }, - { + "or.ba402@gmail.com": { "mails": ["or.ba402@gmail.com", "orbahari@mail.tau.ac.il"], - "name": "Or Bahari", - "authoritative_mail": "or.ba402@gmail.com" + "name": "Or Bahari" } -] +} From 5a4a7201f8b98b11bdfd557b7b3b1bf4305835ad Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Mon, 21 Mar 2022 17:58:50 +0100 Subject: [PATCH 070/473] Sort the copyrite aliases alphabetically --- script/.contributors_aliases.json | 106 +++++++++++++++--------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/script/.contributors_aliases.json b/script/.contributors_aliases.json index 2eb3a84f70..c015b6f534 100644 --- a/script/.contributors_aliases.json +++ b/script/.contributors_aliases.json @@ -1,15 +1,31 @@ { - "pcmanticore@gmail.com": { - "mails": ["cpopa@cloudbasesolutions.com", "pcmanticore@gmail.com"], - "name": "Claudiu Popa" + "31762852+mbyrnepr2@users.noreply.github.com": { + "mails": ["31762852+mbyrnepr2@users.noreply.github.com", "mbyrnepr2@gmail.com"], + "name": "Mark Byrne" }, - "pierre.sassoulas@gmail.com": { + "36848472+yushao2@users.noreply.github.com": { + "mails": ["36848472+yushao2@users.noreply.github.com", "p.yushao2@gmail.com"], + "name": "Yu Shao, Pang" + }, + "andi.finkler@gmail.com": { + "mails": ["andi.finkler@gmail.com", "3929834+DudeNr33@users.noreply.github.com"], + "name": "Andreas Finkler" + }, + "ashley@awhetter.co.uk": { "mails": [ - "pierre.sassoulas@gmail.com", - "pierre.sassoulas@cea.fr", - "pierre.sassoulas@wisebim.fr" + "ashley@awhetter.co.uk", + "awhetter.2011@my.bristol.ac.uk", + "asw@dneg.com", + "AWhetter@users.noreply.github.com" ], - "name": "Pierre Sassoulas" + "name": "Ashley Whetter" + }, + "bot@noreply.github.com": { + "mails": [ + "66853113+pre-commit-ci[bot]@users.noreply.github.com", + "49699333+dependabot[bot]@users.noreply.github.com" + ], + "name": "bot" }, "contact@logilab.fr": { "mails": [ @@ -33,34 +49,6 @@ ], "name": "LOGILAB S.A. (Paris, FRANCE)" }, - "moylop260@vauxoo.com": { - "mails": ["moylop260@vauxoo.com"], - "name": "Moises Lopez" - }, - "no-reply@google.com": { - "mails": [ - "nathaniel@google.com", - "mbp@google.com", - "tmarek@google.com", - "shlomme@gmail.com", - "balparda@google.com", - "dlindquist@google.com" - ], - "name": "Google, Inc." - }, - "ashley@awhetter.co.uk": { - "mails": [ - "ashley@awhetter.co.uk", - "awhetter.2011@my.bristol.ac.uk", - "asw@dneg.com", - "AWhetter@users.noreply.github.com" - ], - "name": "Ashley Whetter" - }, - "ville.skytta@iki.fi": { - "mails": ["ville.skytta@iki.fi", "ville.skytta@upcloud.com"], - "name": "Ville Skyttä" - }, "ejfine@gmail.com": { "mails": [ "ubuntu@ip-172-31-89-59.ec2.internal", @@ -69,39 +57,51 @@ ], "name": "Eli Fine" }, - "andi.finkler@gmail.com": { - "mails": ["andi.finkler@gmail.com", "3929834+DudeNr33@users.noreply.github.com"], - "name": "Andreas Finkler" - }, "matusvalo@users.noreply.github.com": { "mails": ["matusvalo@users.noreply.github.com", "matusvalo@gmail.com"], "name": "Matus Valo" }, + "moylop260@vauxoo.com": { + "mails": ["moylop260@vauxoo.com"], + "name": "Moises Lopez" + }, "nickpesce22@gmail.com": { "mails": ["nickpesce22@gmail.com", "npesce@terpmail.umd.edu"], "name": "Nick Pesce" }, - "31762852+mbyrnepr2@users.noreply.github.com": { - "mails": ["31762852+mbyrnepr2@users.noreply.github.com", "mbyrnepr2@gmail.com"], - "name": "Mark Byrne" + "no-reply@google.com": { + "mails": [ + "nathaniel@google.com", + "mbp@google.com", + "tmarek@google.com", + "shlomme@gmail.com", + "balparda@google.com", + "dlindquist@google.com" + ], + "name": "Google, Inc." }, - "36848472+yushao2@users.noreply.github.com": { - "mails": ["36848472+yushao2@users.noreply.github.com", "p.yushao2@gmail.com"], - "name": "Yu Shao, Pang" + "or.ba402@gmail.com": { + "mails": ["or.ba402@gmail.com", "orbahari@mail.tau.ac.il"], + "name": "Or Bahari" }, - "bot@noreply.github.com": { + "pcmanticore@gmail.com": { + "mails": ["cpopa@cloudbasesolutions.com", "pcmanticore@gmail.com"], + "name": "Claudiu Popa" + }, + "pierre.sassoulas@gmail.com": { "mails": [ - "66853113+pre-commit-ci[bot]@users.noreply.github.com", - "49699333+dependabot[bot]@users.noreply.github.com" + "pierre.sassoulas@gmail.com", + "pierre.sassoulas@cea.fr", + "pierre.sassoulas@wisebim.fr" ], - "name": "bot" + "name": "Pierre Sassoulas" }, "tushar.sadhwani000@gmail.com": { "mails": ["tushar.sadhwani000@gmail.com", "tushar@deepsource.io"], "name": "Tushar Sadhwani" }, - "or.ba402@gmail.com": { - "mails": ["or.ba402@gmail.com", "orbahari@mail.tau.ac.il"], - "name": "Or Bahari" + "ville.skytta@iki.fi": { + "mails": ["ville.skytta@iki.fi", "ville.skytta@upcloud.com"], + "name": "Ville Skyttä" } } From 6de7100e4bed8641f898cef160e1874ec788ab96 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Mar 2022 09:04:35 +0100 Subject: [PATCH 071/473] [pre-commit.ci] pre-commit autoupdate (#5949) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.940 → v0.941](https://github.com/pre-commit/mirrors-mypy/compare/v0.940...v0.941) - [github.com/pre-commit/mirrors-prettier: v2.5.1 → v2.6.0](https://github.com/pre-commit/mirrors-prettier/compare/v2.5.1...v2.6.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6df441d822..d6b2226db0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -77,7 +77,7 @@ repos: types: [text] # necessary to include ChangeLog file files: ^(ChangeLog|doc/(.*/)*.*\.rst) - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.940 + rev: v0.941 hooks: - id: mypy name: mypy @@ -89,7 +89,7 @@ repos: additional_dependencies: ["platformdirs==2.2.0", "types-pkg_resources==0.1.3"] exclude: tests/functional/|tests/input|tests(/.*)*/data|tests/regrtest_data/|tests/data/|tests(/.*)+/conftest.py|doc/|bin/ - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.5.1 + rev: v2.6.0 hooks: - id: prettier args: [--prose-wrap=always, --print-width=88] From 9c90db16a860d5e33b4916feb232a0a6fe9f420d Mon Sep 17 00:00:00 2001 From: Andreas Finkler <3929834+DudeNr33@users.noreply.github.com> Date: Tue, 22 Mar 2022 20:00:26 +0100 Subject: [PATCH 072/473] ``pyreverse``: better error messages for unsupported file formats (#5951) * Pyreverse: better error messages for unsupported file formats * Apply suggestions from code review. --- ChangeLog | 4 ++ doc/whatsnew/2.13.rst | 4 ++ pylint/pyreverse/dot_printer.py | 3 +- pylint/pyreverse/main.py | 33 +++++++++---- pylint/pyreverse/utils.py | 31 ++++++++++-- tests/pyreverse/test_main.py | 85 +++++++++++++++++++++++++++++++++ 6 files changed, 145 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index c1917c330c..b82e345bb0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,10 @@ Release date: TBA Ref PyCQA/astroid#1360 Closes #4826 +* Output better error message if unsupported file formats are used with ``pyreverse``. + + Closes #5950 + * Fix pyreverse diagrams type hinting for classmethods and staticmethods. * Fix pyreverse diagrams type hinting for methods returning None. diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index 7b2f181653..a47516e528 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -515,3 +515,7 @@ Other Changes Closes #5333 * Fix type hints in class diagrams generated by pyreverse for class methods and methods returning None. + +* Output better error message if unsupported file formats are used with ``pyreverse``. + + Closes #5950 diff --git a/pylint/pyreverse/dot_printer.py b/pylint/pyreverse/dot_printer.py index fccdcf5579..21f41d765c 100644 --- a/pylint/pyreverse/dot_printer.py +++ b/pylint/pyreverse/dot_printer.py @@ -19,7 +19,7 @@ from astroid import nodes from pylint.pyreverse.printer import EdgeType, Layout, NodeProperties, NodeType, Printer -from pylint.pyreverse.utils import check_graphviz_availability, get_annotation_label +from pylint.pyreverse.utils import get_annotation_label ALLOWED_CHARSETS: FrozenSet[str] = frozenset(("utf-8", "iso-8859-1", "latin1")) SHAPES: Dict[NodeType, str] = { @@ -152,7 +152,6 @@ def generate(self, outputfile: str) -> None: with open(dot_sourcepath, "w", encoding="utf8") as outfile: outfile.writelines(self.lines) if target not in graphviz_extensions: - check_graphviz_availability() use_shell = sys.platform == "win32" subprocess.call( ["dot", "-T", target, dot_sourcepath, "-o", outputfile], diff --git a/pylint/pyreverse/main.py b/pylint/pyreverse/main.py index e955388cb0..aefffb315d 100644 --- a/pylint/pyreverse/main.py +++ b/pylint/pyreverse/main.py @@ -32,7 +32,20 @@ from pylint.pyreverse import writer from pylint.pyreverse.diadefslib import DiadefsHandler from pylint.pyreverse.inspector import Linker, project_from_files -from pylint.pyreverse.utils import check_graphviz_availability, insert_default_options +from pylint.pyreverse.utils import ( + check_graphviz_availability, + check_if_graphviz_supports_format, + insert_default_options, +) + +DIRECTLY_SUPPORTED_FORMATS = ( + "dot", + "vcg", + "puml", + "plantuml", + "mmd", + "html", +) OPTIONS = ( ( @@ -139,7 +152,10 @@ action="store", default="dot", metavar="", - help="create a *. output file if format available.", + help=( + f"create a *. output file if format is available. Available formats are: {', '.join(DIRECTLY_SUPPORTED_FORMATS)}. " + f"Any other format will be tried to create by means of the 'dot' command line tool, which requires a graphviz installation." + ), ), ), ( @@ -205,15 +221,12 @@ def __init__(self, args: Iterable[str]): super().__init__(usage=__doc__) insert_default_options() args = self.load_command_line_configuration(args) - if self.config.output_format not in ( - "dot", - "vcg", - "puml", - "plantuml", - "mmd", - "html", - ): + if self.config.output_format not in DIRECTLY_SUPPORTED_FORMATS: check_graphviz_availability() + print( + f"Format {self.config.output_format} is not supported natively. Pyreverse will try to generate it using Graphviz..." + ) + check_if_graphviz_supports_format(self.config.output_format) sys.exit(self.run(args)) diff --git a/pylint/pyreverse/utils.py b/pylint/pyreverse/utils.py index 7fde44225b..f7eff0ee0b 100644 --- a/pylint/pyreverse/utils.py +++ b/pylint/pyreverse/utils.py @@ -23,6 +23,7 @@ import os import re import shutil +import subprocess import sys from typing import Optional, Union @@ -290,9 +291,33 @@ def check_graphviz_availability(): from *.dot or *.gv into the final output format. """ if shutil.which("dot") is None: + print("'Graphviz' needs to be installed for your chosen output format.") + sys.exit(32) + + +def check_if_graphviz_supports_format(output_format: str) -> None: + """Check if the ``dot`` command supports the requested output format. + + This is needed if image output is desired and ``dot`` is used to convert + from *.gv into the final output format. + """ + dot_output = subprocess.run( + ["dot", "-T?"], capture_output=True, check=False, encoding="utf-8" + ) + match = re.match( + pattern=r".*Use one of: (?P(\S*\s?)+)", + string=dot_output.stderr.strip(), + ) + if not match: + print( + "Unable to determine Graphviz supported output formats. " + "Pyreverse will continue, but subsequent error messages " + "regarding the output format may come from Graphviz directly." + ) + return + supported_formats = match.group("formats") + if output_format not in supported_formats.split(): print( - "The requested output format is currently not available.\n" - "Please install 'Graphviz' to have other output formats " - "than 'dot' or 'vcg'." + f"Format {output_format} is not supported by Graphviz. It supports: {supported_formats}" ) sys.exit(32) diff --git a/tests/pyreverse/test_main.py b/tests/pyreverse/test_main.py index 01f3ccc099..2cc422c4ac 100644 --- a/tests/pyreverse/test_main.py +++ b/tests/pyreverse/test_main.py @@ -2,15 +2,39 @@ import os import sys from typing import Iterator +from unittest import mock import pytest from pylint.lint import fix_import_path +from pylint.pyreverse import main TEST_DATA_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "data")) PROJECT_ROOT_DIR = os.path.abspath(os.path.join(TEST_DATA_DIR, "..")) +@pytest.fixture(name="mock_subprocess") +def mock_utils_subprocess(): + with mock.patch("pylint.pyreverse.utils.subprocess") as mock_subprocess: + yield mock_subprocess + + +@pytest.fixture +def mock_graphviz(mock_subprocess): + mock_subprocess.run.return_value = mock.Mock( + stderr=( + 'Format: "XYZ" not recognized. Use one of: ' + "bmp canon cgimage cmap cmapx cmapx_np dot dot_json eps exr fig gd " + "gd2 gif gv icns ico imap imap_np ismap jp2 jpe jpeg jpg json json0 " + "mp pct pdf pic pict plain plain-ext png pov ps ps2 psd sgi svg svgz " + "tga tif tiff tk vdx vml vmlz vrml wbmp webp xdot xdot1.2 xdot1.4 xdot_json" + ) + ) + with mock.patch("pylint.pyreverse.utils.shutil") as mock_shutil: + mock_shutil.which.return_value = "/usr/bin/dot" + yield + + @pytest.fixture(params=[PROJECT_ROOT_DIR, TEST_DATA_DIR]) def setup_path(request) -> Iterator: current_sys_path = list(sys.path) @@ -29,3 +53,64 @@ def test_project_root_in_sys_path(): """ with fix_import_path([TEST_DATA_DIR]): assert sys.path == [PROJECT_ROOT_DIR] + + +@mock.patch("pylint.pyreverse.main.Linker", new=mock.MagicMock()) +@mock.patch("pylint.pyreverse.main.DiadefsHandler", new=mock.MagicMock()) +@mock.patch("pylint.pyreverse.main.writer") +@pytest.mark.usefixtures("mock_graphviz") +def test_graphviz_supported_image_format(mock_writer, capsys): + """Test that Graphviz is used if the image format is supported.""" + with pytest.raises(SystemExit) as wrapped_sysexit: + # we have to catch the SystemExit so the test execution does not stop + main.Run(["-o", "png", TEST_DATA_DIR]) + # Check that the right info message is shown to the user + assert ( + "Format png is not supported natively. Pyreverse will try to generate it using Graphviz..." + in capsys.readouterr().out + ) + # Check that pyreverse actually made the call to create the diagram and we exit cleanly + mock_writer.DiagramWriter().write.assert_called_once() + assert wrapped_sysexit.value.code == 0 + + +@mock.patch("pylint.pyreverse.main.Linker", new=mock.MagicMock()) +@mock.patch("pylint.pyreverse.main.DiadefsHandler", new=mock.MagicMock()) +@mock.patch("pylint.pyreverse.main.writer") +@pytest.mark.usefixtures("mock_graphviz") +def test_graphviz_cant_determine_supported_formats( + mock_writer, mock_subprocess, capsys +): + """Test that Graphviz is used if the image format is supported.""" + mock_subprocess.run.return_value.stderr = "..." + with pytest.raises(SystemExit) as wrapped_sysexit: + # we have to catch the SystemExit so the test execution does not stop + main.Run(["-o", "png", TEST_DATA_DIR]) + # Check that the right info message is shown to the user + assert ( + "Unable to determine Graphviz supported output formats." + in capsys.readouterr().out + ) + # Check that pyreverse actually made the call to create the diagram and we exit cleanly + mock_writer.DiagramWriter().write.assert_called_once() + assert wrapped_sysexit.value.code == 0 + + +@mock.patch("pylint.pyreverse.main.Linker", new=mock.MagicMock()) +@mock.patch("pylint.pyreverse.main.DiadefsHandler", new=mock.MagicMock()) +@mock.patch("pylint.pyreverse.main.writer", new=mock.MagicMock()) +@pytest.mark.usefixtures("mock_graphviz") +def test_graphviz_unsupported_image_format(capsys): + """Test that Graphviz is used if the image format is supported.""" + with pytest.raises(SystemExit) as wrapped_sysexit: + # we have to catch the SystemExit so the test execution does not stop + main.Run(["-o", "somethingElse", TEST_DATA_DIR]) + # Check that the right info messages are shown to the user + stdout = capsys.readouterr().out + assert ( + "Format somethingElse is not supported natively. Pyreverse will try to generate it using Graphviz..." + in stdout + ) + assert "Format somethingElse is not supported by Graphviz. It supports:" in stdout + # Check that we exited with the expected error code + assert wrapped_sysexit.value.code == 32 From 536087e448f9204ddbaea10a55ca5eab7d64de0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Wed, 23 Mar 2022 19:35:33 +0100 Subject: [PATCH 073/473] Set up system of code examples and details for message documentation (#5934) --- .pre-commit-config.yaml | 2 +- doc/conf.py | 2 +- doc/data/messages/e/empty-docstring/bad.py | 2 + doc/data/messages/e/empty-docstring/good.py | 2 + .../y/yield-inside-async-function/bad.py | 2 + .../y/yield-inside-async-function/details.rst | 1 + .../y/yield-inside-async-function/good.py | 7 ++ .../y/yield-inside-async-function/related.rst | 1 + doc/exts/pylint_messages.py | 73 ++++++++++++++++++- 9 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 doc/data/messages/e/empty-docstring/bad.py create mode 100644 doc/data/messages/e/empty-docstring/good.py create mode 100644 doc/data/messages/y/yield-inside-async-function/bad.py create mode 100644 doc/data/messages/y/yield-inside-async-function/details.rst create mode 100644 doc/data/messages/y/yield-inside-async-function/good.py create mode 100644 doc/data/messages/y/yield-inside-async-function/related.rst diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d6b2226db0..f19027503c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: rev: v1.4 hooks: - id: autoflake - exclude: &fixtures tests/functional/|tests/input|tests/regrtest_data/|tests/data/ + exclude: &fixtures tests/functional/|tests/input|tests/regrtest_data/|tests/data/|doc/data/messages args: - --in-place - --remove-all-unused-imports diff --git a/doc/conf.py b/doc/conf.py index 1c44c89c67..0f15ffd91c 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -73,7 +73,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ["_build"] +exclude_patterns = ["_build", "data/**"] # The reST default role (used for this markup: `text`) to use for all documents. # default_role = None diff --git a/doc/data/messages/e/empty-docstring/bad.py b/doc/data/messages/e/empty-docstring/bad.py new file mode 100644 index 0000000000..83d3601251 --- /dev/null +++ b/doc/data/messages/e/empty-docstring/bad.py @@ -0,0 +1,2 @@ +def foo(): + pass # [emtpy-docstring] diff --git a/doc/data/messages/e/empty-docstring/good.py b/doc/data/messages/e/empty-docstring/good.py new file mode 100644 index 0000000000..b587ca4c6c --- /dev/null +++ b/doc/data/messages/e/empty-docstring/good.py @@ -0,0 +1,2 @@ +def foo(): + """A dummy description.""" diff --git a/doc/data/messages/y/yield-inside-async-function/bad.py b/doc/data/messages/y/yield-inside-async-function/bad.py new file mode 100644 index 0000000000..6e1d6bd28b --- /dev/null +++ b/doc/data/messages/y/yield-inside-async-function/bad.py @@ -0,0 +1,2 @@ +async def foo(): + yield from [1, 2, 3] # [yield-inside-async-function] diff --git a/doc/data/messages/y/yield-inside-async-function/details.rst b/doc/data/messages/y/yield-inside-async-function/details.rst new file mode 100644 index 0000000000..7d05701aeb --- /dev/null +++ b/doc/data/messages/y/yield-inside-async-function/details.rst @@ -0,0 +1 @@ +The message can't be emitted when using Python < 3.5. diff --git a/doc/data/messages/y/yield-inside-async-function/good.py b/doc/data/messages/y/yield-inside-async-function/good.py new file mode 100644 index 0000000000..1af96506b5 --- /dev/null +++ b/doc/data/messages/y/yield-inside-async-function/good.py @@ -0,0 +1,7 @@ +async def foo(): + def _inner_foo(): + yield from [1, 2, 3] + + +async def foo(): + yield 42 diff --git a/doc/data/messages/y/yield-inside-async-function/related.rst b/doc/data/messages/y/yield-inside-async-function/related.rst new file mode 100644 index 0000000000..98cb4e3a92 --- /dev/null +++ b/doc/data/messages/y/yield-inside-async-function/related.rst @@ -0,0 +1 @@ +- `PEP 525 `_ diff --git a/doc/exts/pylint_messages.py b/doc/exts/pylint_messages.py index 7f910918f4..0f9ac35de9 100644 --- a/doc/exts/pylint_messages.py +++ b/doc/exts/pylint_messages.py @@ -23,6 +23,8 @@ PYLINT_MESSAGES_PATH = PYLINT_BASE_PATH / "doc" / "messages" """Path to the messages documentation folder.""" +PYLINT_MESSAGES_DATA_PATH = PYLINT_BASE_PATH / "doc" / "data" / "messages" +"""Path to the folder with data for the messages documentation.""" MSG_TYPES_DOC = {k: v if v != "info" else "information" for k, v in MSG_TYPES.items()} @@ -32,6 +34,10 @@ class MessageData(NamedTuple): id: str name: str definition: MessageDefinition + good_code: str + bad_code: str + details: str + related_links: str MessagesDict = Dict[str, List[MessageData]] @@ -47,6 +53,54 @@ def _register_all_checkers_and_extensions(linter: PyLinter) -> None: initialize_extensions(linter) +def _get_message_data(data_path: Path) -> Tuple[str, str, str, str]: + """Get the message data from the specified path.""" + good_code, bad_code, details, related = "", "", "", "" + + if not data_path.exists(): + return good_code, bad_code, details, related + + if (data_path / "good.py").exists(): + with open(data_path / "good.py", encoding="utf-8") as file: + file_content = file.readlines() + indented_file_content = "".join(" " + i for i in file_content) + good_code = f""" +**Correct code:** + +.. code-block:: python + +{indented_file_content}""" + + if (data_path / "bad.py").exists(): + with open(data_path / "bad.py", encoding="utf-8") as file: + file_content = file.readlines() + indented_file_content = "".join(" " + i for i in file_content) + bad_code = f""" +**Problematic code:** + +.. code-block:: python + +{indented_file_content}""" + + if (data_path / "details.rst").exists(): + with open(data_path / "details.rst", encoding="utf-8") as file: + file_content_string = file.read() + details = f""" +**Additional details:** + +{file_content_string}""" + + if (data_path / "related.rst").exists(): + with open(data_path / "related.rst", encoding="utf-8") as file: + file_content_string = file.read() + related = f""" +**Related links:** + +{file_content_string}""" + + return good_code, bad_code, details, related + + def _get_all_messages( linter: PyLinter, ) -> Tuple[MessagesDict, OldMessagesDict]: @@ -72,8 +126,20 @@ def _get_all_messages( "information": defaultdict(list), } for message in linter.msgs_store.messages: + message_data_path = ( + PYLINT_MESSAGES_DATA_PATH / message.symbol[0] / message.symbol + ) + good_code, bad_code, details, related = _get_message_data(message_data_path) + message_data = MessageData( - message.checker_name, message.msgid, message.symbol, message + message.checker_name, + message.msgid, + message.symbol, + message, + good_code, + bad_code, + details, + related, ) messages_dict[MSG_TYPES_DOC[message.msgid[0]]].append(message_data) @@ -108,6 +174,11 @@ def _write_message_page(messages_dict: MessagesDict) -> None: *{message.definition.description}* +{message.good_code} +{message.bad_code} +{message.details} +{message.related_links} + Created by ``{message.checker}`` checker """ ) From bdeb7e5f0cdafab92efc3fe52b4d1e94ee3344e5 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Mon, 21 Mar 2022 17:48:20 +0100 Subject: [PATCH 074/473] Add a script to update the CONTRIBUTORS.txt --- requirements_test.txt | 1 + script/__init__.py | 3 +++ script/bump_changelog.py | 4 ++++ script/copyright.txt | 3 +++ script/create_contributor_list.py | 21 +++++++++++++++++++++ script/fix_documentation.py | 4 ++++ script/get_unused_message_id_category.py | 1 + setup.cfg | 3 +++ tbump.toml | 8 ++++++++ 9 files changed, 48 insertions(+) create mode 100644 script/copyright.txt create mode 100644 script/create_contributor_list.py diff --git a/requirements_test.txt b/requirements_test.txt index bcc6311fc2..2e35f584d2 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -4,6 +4,7 @@ coveralls~=3.3 coverage~=6.2 pre-commit~=2.17;python_full_version>="3.6.2" tbump~=6.6.0 +contributors-txt>=0.7.3 pyenchant~=3.2 pytest-cov~=3.0 pytest-profiling~=1.7 diff --git a/script/__init__.py b/script/__init__.py index e69de29bb2..e8a8ff79fd 100644 --- a/script/__init__.py +++ b/script/__init__.py @@ -0,0 +1,3 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt diff --git a/script/bump_changelog.py b/script/bump_changelog.py index 6e25719d4c..f1edcdbb0f 100644 --- a/script/bump_changelog.py +++ b/script/bump_changelog.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + # ORIGINAL here: https://github.com/PyCQA/astroid/blob/main/script/bump_changelog.py # DO NOT MODIFY DIRECTLY diff --git a/script/copyright.txt b/script/copyright.txt new file mode 100644 index 0000000000..e8a8ff79fd --- /dev/null +++ b/script/copyright.txt @@ -0,0 +1,3 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt diff --git a/script/create_contributor_list.py b/script/create_contributor_list.py new file mode 100644 index 0000000000..9b336a01b1 --- /dev/null +++ b/script/create_contributor_list.py @@ -0,0 +1,21 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + +from pathlib import Path + +from contributors_txt import create_contributors_txt + +BASE_DIRECTORY = Path(__file__).parent.parent +ALIASES_FILE = BASE_DIRECTORY / "script/.contributors_aliases.json" +DEFAULT_CONTRIBUTOR_PATH = BASE_DIRECTORY / "CONTRIBUTORS.txt" + + +def main(): + create_contributors_txt( + aliases_file=ALIASES_FILE, output=DEFAULT_CONTRIBUTOR_PATH, verbose=True + ) + + +if __name__ == "__main__": + main() diff --git a/script/fix_documentation.py b/script/fix_documentation.py index 0fc4e347e2..24dd0097e2 100644 --- a/script/fix_documentation.py +++ b/script/fix_documentation.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + """Small script to fix various issues with the documentation. Used by pre-commit.""" import argparse import re diff --git a/script/get_unused_message_id_category.py b/script/get_unused_message_id_category.py index 95d7ac3e30..7bf1a1343c 100644 --- a/script/get_unused_message_id_category.py +++ b/script/get_unused_message_id_category.py @@ -1,6 +1,7 @@ """Small script to get a new unused message id category.""" # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from typing import List diff --git a/setup.cfg b/setup.cfg index 31de3b711a..42b349e380 100644 --- a/setup.cfg +++ b/setup.cfg @@ -102,6 +102,9 @@ ignore_missing_imports = True [mypy-tests.*] ignore_missing_imports = True +[mypy-contributors_txt] +ignore_missing_imports = True + [mypy-coverage] ignore_missing_imports = True diff --git a/tbump.toml b/tbump.toml index 0429cbd3a7..6744a745ed 100644 --- a/tbump.toml +++ b/tbump.toml @@ -32,6 +32,14 @@ cmd = "python3 script/bump_changelog.py {new_version}" name = "Upgrade and check doc" cmd = "tox -e docs||echo 'Hack so this command does not fail'" +[[before_commit]] +name = "Normalize the contributors-txt configuration" +cmd = "contributors-txt-normalize-configuration -a script/.contributors_aliases.json -o script/.contributors_aliases.json" + +[[before_commit]] +name = "Upgrade the contributors list" +cmd = "python3 script/create_contributor_list.py" + [[before_commit]] name = "Upgrade copyrights" cmd = "pip3 install copyrite;copyrite --contribution-threshold 1 --change-threshold 3 --backend-type git --aliases=.copyrite_aliases . --jobs=8" From 47d37870565dd49de74f7e97bd8655b6673d189e Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Mon, 21 Mar 2022 18:25:31 +0100 Subject: [PATCH 075/473] Add more aliases to the contributors.txt configuration --- script/.contributors_aliases.json | 534 +++++++++++++++++++++++++++--- 1 file changed, 495 insertions(+), 39 deletions(-) diff --git a/script/.contributors_aliases.json b/script/.contributors_aliases.json index c015b6f534..9b77661efd 100644 --- a/script/.contributors_aliases.json +++ b/script/.contributors_aliases.json @@ -1,24 +1,177 @@ { + "13665637+DanielNoord@users.noreply.github.com": { + "mails": ["13665637+DanielNoord@users.noreply.github.com"], + "name": "Daniël van Noord", + "team": "Maintainers" + }, + "15907922+kasium@users.noreply.github.com": { + "mails": ["15907922+kasium@users.noreply.github.com"], + "name": "Kai Mueller" + }, + "16359131+jiajunsu@users.noreply.github.com": { + "mails": ["16359131+jiajunsu@users.noreply.github.com"], + "name": "Victor Jiajunsu" + }, + "17108752+mattlbeck@users.noreply.github.com": { + "mails": ["17108752+mattlbeck@users.noreply.github.com"], + "name": "Matthew Beckers" + }, + "30130371+cdce8p@users.noreply.github.com": { + "mails": ["30130371+cdce8p@users.noreply.github.com"], + "name": "Marc Mueller", + "team": "Maintainers" + }, + "30827238+thernstig@users.noreply.github.com": { + "mails": ["30827238+thernstig@users.noreply.github.com"], + "name": "Tobias Hernstig" + }, + "31448155+melvio@users.noreply.github.com": { + "mails": ["31448155+melvio@users.noreply.github.com"], + "name": "Melvin Hazeleger" + }, "31762852+mbyrnepr2@users.noreply.github.com": { "mails": ["31762852+mbyrnepr2@users.noreply.github.com", "mbyrnepr2@gmail.com"], "name": "Mark Byrne" }, + "31987769+sushobhit27@users.noreply.github.com": { + "mails": [ + "sushobhitsolanki@gmail.com", + "31987769+sushobhit27@users.noreply.github.com" + ], + "name": "Sushobhit" + }, + "35621759+anubh-v@users.noreply.github.com": { + "mails": ["35621759+anubh-v@users.noreply.github.com", "anubhav@u.nus.edu"], + "name": "Anubhav" + }, "36848472+yushao2@users.noreply.github.com": { "mails": ["36848472+yushao2@users.noreply.github.com", "p.yushao2@gmail.com"], - "name": "Yu Shao, Pang" + "name": "Yu Shao, Pang", + "team": "Maintainers" + }, + "37377066+harshil21@users.noreply.github.com": { + "mails": ["37377066+harshil21@users.noreply.github.com"], + "name": "Harshil" }, - "andi.finkler@gmail.com": { + "3929834+DudeNr33@users.noreply.github.com": { "mails": ["andi.finkler@gmail.com", "3929834+DudeNr33@users.noreply.github.com"], - "name": "Andreas Finkler" + "name": "Andreas Finkler", + "team": "Maintainers" + }, + "39745367+yory8@users.noreply.github.com": { + "mails": ["39745367+yory8@users.noreply.github.com"], + "name": "Yory" + }, + "44787650+haasea@users.noreply.github.com": { + "mails": ["44787650+haasea@users.noreply.github.com"], + "name": "Aidan Haase" + }, + "46202743+lorena-b@users.noreply.github.com": { + "mails": ["46202743+lorena-b@users.noreply.github.com"], + "name": "Lorena Buciu" + }, + "53625739+dbrookman@users.noreply.github.com": { + "mails": ["53625739+dbrookman@users.noreply.github.com"], + "name": "Daniel Brookman" + }, + "61059243+tiagohonorato@users.noreply.github.com": { + "mails": [ + "tiagohonorato1@gmail.com", + "61059243+tiagohonorato@users.noreply.github.com" + ], + "name": "Tiago Honorato" + }, + "62866982+SupImDos@users.noreply.github.com": { + "mails": ["62866982+SupImDos@users.noreply.github.com"], + "name": "Hayden Richards" + }, + "80432516+jpy-git@users.noreply.github.com": { + "mails": ["80432516+jpy-git@users.noreply.github.com"], + "name": "Joseph Young" + }, + "88253337+PaaEl@users.noreply.github.com": { + "mails": ["88253337+PaaEl@users.noreply.github.com"], + "name": "Sam Vermeiren" + }, + "95424144+allanc65@users.noreply.github.com": { + "mails": ["95424144+allanc65@users.noreply.github.com"], + "name": "Allan Chandler" + }, + "Adrien.DiMascio@logilab.fr": { + "mails": ["Adrien.DiMascio@logilab.fr"], + "name": "Adrien Di Mascio" + }, + "Github@pheanex.de": { + "mails": ["Github@pheanex.de"], + "name": "Konstantin" + }, + "Mariatta@users.noreply.github.com": { + "mails": ["Mariatta@users.noreply.github.com", "mariatta@python.org"], + "name": "Mariatta Wijaya" + }, + "MartinBasti@users.noreply.github.com": { + "mails": ["MartinBasti@users.noreply.github.com"], + "name": "Martin Bašti" + }, + "Pablogsal@gmail.com": { + "mails": ["Pablogsal@gmail.com"], + "name": "Pablo Galindo Salgado" + }, + "PaulRenvoise@users.noreply.github.com": { + "mails": ["renvoisepaul@gmail.com", "PaulRenvoise@users.noreply.github.com"], + "name": "Paul Renvoisé" + }, + "ahirnish@gmail.com": { + "mails": ["ahirnish@gmail.com"], + "name": "Ahirnish Pareek" + }, + "alexandre.fayolle@logilab.fr": { + "mails": ["alexandre.fayolle@logilab.fr", "afayolle.ml@free.fr"], + "name": "Alexandre Fayolle" + }, + "anjsimmo@gmail.com": { + "mails": ["anjsimmo@gmail.com", "a.simmons@deakin.edu.au"], + "name": "Andrew J. Simmons" + }, + "areveny@protonmail.com": { + "mails": [ + "areveny@protonmail.com", + "self@areveny.com", + "92831762+areveny@users.noreply.github.com" + ], + "name": "Arianna Yang", + "team": "Maintainers" + }, + "arusahni@gmail.com": { + "mails": ["arusahni@gmail.com", "aru@thehumangeo.com"], + "name": "Aru Sahni" }, "ashley@awhetter.co.uk": { "mails": [ + "ashleyw@activestate.com", "ashley@awhetter.co.uk", "awhetter.2011@my.bristol.ac.uk", "asw@dneg.com", "AWhetter@users.noreply.github.com" ], - "name": "Ashley Whetter" + "name": "Ashley Whetter", + "team": "Maintainers" + }, + "balint.mihai@gmail.com": { + "mails": ["balint.mihai@gmail.com", "mihai@cs.upt.ro"], + "name": "Mihai Balint" + }, + "bastien.vallet@gmail.com": { + "mails": ["bastien.vallet@gmail.com"], + "name": "Bastien Vallet" + }, + "benny.mueller91@gmail.com": { + "mails": ["benny.mueller91@gmail.com"], + "name": "Benny Mueller" + }, + "bitbucket@carlcrowder.com": { + "mails": ["bitbucket@carlcrowder.com"], + "name": "Carl Crowder" }, "bot@noreply.github.com": { "mails": [ @@ -27,27 +180,76 @@ ], "name": "bot" }, - "contact@logilab.fr": { - "mails": [ - "alexandre.fayolle@logilab.fr", - "emile.anclin@logilab.fr", - "david.douard@logilab.fr", - "laura.medioni@logilab.fr", - "anthony.truchet@logilab.fr", - "alain.leufroy@logilab.fr", - "julien.cristau@logilab.fr", - "Adrien.DiMascio@logilab.fr", - "emile@crater.logilab.fr", - "sylvain.thenault@logilab.fr", - "pierre-yves.david@logilab.fr", - "nicolas.chauvat@logilab.fr", - "afayolle.ml@free.fr", - "aurelien.campeas@logilab.fr", - "charles.hebert@logilab.fr", - "julien.jehannet@logilab.fr", - "lmedioni@logilab.fr" - ], - "name": "LOGILAB S.A. (Paris, FRANCE)" + "bruno.daniel@blue-yonder.com": { + "mails": ["Bruno.Daniel@blue-yonder.com", "bruno.daniel@blue-yonder.com"], + "name": "Bruno Daniel" + }, + "bryce.paul.guinta@gmail.com": { + "mails": ["bryce.paul.guinta@gmail.com", "bryce.guinta@protonmail.com"], + "name": "Bryce Guinta", + "team": "Maintainers" + }, + "buck@yelp.com": { + "mails": ["buck@yelp.com", "buck.2019@gmail.com"], + "name": "Buck (Yelp)" + }, + "calen.pennington@gmail.com": { + "mails": ["cale@edx.org", "calen.pennington@gmail.com"], + "name": "Calen Pennington" + }, + "carli.freudenberg@energymeteo.de": { + "mails": ["carli.freudenberg@energymeteo.de"], + "name": "Carli Freudenberg" + }, + "ceridwenv@gmail.com": { + "mails": ["ceridwenv@gmail.com"], + "name": "Ceridwen", + "team": "Maintainers" + }, + "cezar.elnazli2@gmail.com": { + "mails": ["celnazli@bitdefender.com", "cezar.elnazli2@gmail.com"], + "name": "Cezar Elnazli" + }, + "cmin@ropython.org": { + "mails": ["cmin@ropython.org"], + "name": "Cosmin Poieană" + }, + "contact@ionelmc.ro": { + "mails": ["contact@ionelmc.ro"], + "name": "Ionel Maries Cristian" + }, + "dan.r.neal@gmail.com": { + "mails": ["dan.r.neal@gmail.com"], + "name": "Daniel R. Neal" + }, + "david.douard@sdfa3.org": { + "mails": ["david.douard@sdfa3.org", "david.douard@logilab.fr"], + "name": "David Douard" + }, + "david.pursehouse@gmail.com": { + "mails": ["david.pursehouse@gmail.com", "david.pursehouse@sonymobile.com"], + "name": "David Pursehouse" + }, + "ddandd@gmail.com": { + "mails": ["ddandd@gmail.com"], + "name": "Daniel Dorani" + }, + "dharding@gmail.com": { + "mails": ["dharding@gmail.com", "dharding@living180.net"], + "name": "Daniel Harding" + }, + "djgoldsmith@googlemail.com": { + "mails": ["djgoldsmith@googlemail.com"], + "name": "Dan Goldsmith" + }, + "dmand@yandex.ru": { + "mails": ["dmand@yandex.ru"], + "name": "Dimitri Prybysh", + "team": "Maintainers" + }, + "drewrisinger@users.noreply.github.com": { + "mails": ["drewrisinger@users.noreply.github.com"], + "name": "Drew Risinger" }, "ejfine@gmail.com": { "mails": [ @@ -57,28 +259,196 @@ ], "name": "Eli Fine" }, + "email@holger-peters.de": { + "mails": ["email@holger-peters.de", "holger.peters@blue-yonder.com"], + "name": "Holger Peters" + }, + "emile.anclin@logilab.fr": { + "mails": ["emile.anclin@logilab.fr", ""], + "name": "Emile Anclin" + }, + "emile@crater.logilab.fr": { + "mails": ["emile@crater.logilab.fr"], + "name": "Émile Crater" + }, + "ethanleba5@gmail.com": { + "mails": ["ethanleba5@gmail.com"], + "name": "Ethan Leba" + }, + "flying-sheep@web.de": { + "mails": ["flying-sheep@web.de", "palbrecht@mailbox.org"], + "name": "Philipp Albrecht" + }, + "fortemarco.irl@gmail.com": { + "mails": ["fortemarco.irl@gmail.com", "marcoyolos"], + "name": "Marco Forte" + }, + "frank@doublethefish.com": { + "mails": ["frank@doublethefish.com", "doublethefish@gmail.com"], + "name": "Frank Harrison" + }, + "frost.nzcr4@jagmort.com": { + "mails": ["frost.nzcr4@jagmort.com"], + "name": "Alexander Pervakov" + }, + "frostming@tencent.com": { + "mails": ["frostming@tencent.com", "mianghong@gmail.com"], + "name": "Frost Ming" + }, + "g@briel.dev": { + "mails": ["g@briel.dev", "gabriel@sezefredo.com.br"], + "name": "Gabriel R. Sezefredo" + }, + "gergely.kalmar@logikal.jp": { + "mails": ["gergely.kalmar@logikal.jp"], + "name": "Gergely Kalmár" + }, + "github@euresti.com": { + "mails": ["david@dropbox.com", "github@euresti.com"], + "name": "David Euresti" + }, + "github@hornwitser.no": { + "mails": ["github@hornwitser.no"], + "name": "Hornwitser" + }, + "glenn@e-dad.net": { + "mails": ["glenn@e-dad.net", "glmatthe@cisco.com"], + "name": "Glenn Matthews" + }, + "guillaume.peillex@gmail.com": { + "mails": ["guillaume.peillex@gmail.com", "guillaume.peillex@gmail.col"], + "name": "Hippo91", + "team": "Maintainers" + }, + "hg@stevenmyint.com": { + "mails": ["hg@stevenmyint.com", "git@stevenmyint.com"], + "name": "Steven Myint" + }, + "hugovk@users.noreply.github.com": { + "mails": ["hugovk@users.noreply.github.com"], + "name": "Hugo van Kemenade" + }, + "hugues.bruant@affirm.com": { + "mails": ["hugues.bruant@affirm.com"], + "name": "Hugues Bruant" + }, + "iilei@users.noreply.github.com": { + "mails": ["iilei@users.noreply.github.com"], + "name": "Jochen Preusche" + }, + "jacob@bogdanov.dev": { + "mails": ["jacob@bogdanov.dev", "jbogdanov@128technology.com"], + "name": "Jacob Bogdanov" + }, + "jacobtylerwalls@gmail.com": { + "mails": ["jacobtylerwalls@gmail.com"], + "name": "Jacob Walls", + "team": "Maintainers" + }, + "joffrey.mander+pro@gmail.com": { + "mails": ["joffrey.mander+pro@gmail.com"], + "name": "Joffrey Mander" + }, + "joshdcannon@gmail.com": { + "mails": ["joshdcannon@gmail.com", "joshua.cannon@ni.com"], + "name": "Joshua Cannon" + }, + "josselin@trailofbits.com": { + "mails": ["josselin@trailofbits.com"], + "name": "Josselin Feist" + }, + "justinnhli@gmail.com": { + "mails": ["justinnhli@gmail.com", "justinnhli@users.noreply.github.com"], + "name": "Justin Li" + }, + "kapsh@kap.sh": { + "mails": ["kapsh@kap.sh"], + "name": "Alexander Kapshuna" + }, + "kavinsingh@hotmail.com": { + "mails": ["kavin.singh@mail.utoronto.ca", "kavinsingh@hotmail.com"], + "name": "Kavins Singh" + }, + "keichi.t@me.com": { + "mails": ["hello@keichi.dev", "keichi.t@me.com"], + "name": "Keichi Takahashi" + }, + "laike9m@users.noreply.github.com": { + "mails": ["laike9m@users.noreply.github.com"], + "name": "laike9m" + }, + "laura.medioni@logilab.fr": { + "mails": ["laura.medioni@logilab.fr", "lmedioni@logilab.fr"], + "name": "Laura Médioni" + }, + "liyt@ios.ac.cn": { + "mails": ["liyt@ios.ac.cn"], + "name": "Yeting Li" + }, + "lothiraldan@gmail.com": { + "mails": ["lothiraldan@gmail.com"], + "name": "Boris Feld" + }, + "lucristofolini@gmail.com": { + "mails": ["luigi.cristofolini@q-ctrl.com", "lucristofolini@gmail.com"], + "name": "Luigi Bertaco Cristofolini" + }, + "m.fesenko@corp.vk.com": { + "mails": ["m.fesenko@corp.vk.com", "proggga@gmail.com"], + "name": "Mikhail Fesenko" + }, + "mariocj89@gmail.com": { + "mails": ["mcorcherojim@bloomberg.net", "mariocj89@gmail.com"], + "name": "Mario Corchero" + }, + "mark00bell@googlemail.com": { + "mails": ["mark00bell@googlemail.com", "MarkCBell@users.noreply.github.com"], + "name": "Mark Bell" + }, + "martin@vielsmaier.net": { + "mails": ["martin@vielsmaier.net", "martin.vielsmaier@gmail.com"], + "name": "Martin Vielsmaier" + }, "matusvalo@users.noreply.github.com": { "mails": ["matusvalo@users.noreply.github.com", "matusvalo@gmail.com"], "name": "Matus Valo" }, + "me@the-compiler.org": { + "mails": [ + "me@the-compiler.org", + "git@the-compiler.org", + "bitbucket.org@the-compiler.org" + ], + "name": "Florian Bruhin", + "team": "Maintainers" + }, + "mitchelly@gmail.com": { + "mails": ["mitchelly@gmail.com"], + "name": "Mitchell Young" + }, + "molobrakos@users.noreply.github.com": { + "mails": ["molobrakos@users.noreply.github.com", "erik.eriksson@yahoo.com"], + "name": "Erik Eriksson" + }, "moylop260@vauxoo.com": { "mails": ["moylop260@vauxoo.com"], - "name": "Moises Lopez" + "name": "Moisés López" + }, + "mtmiller@users.noreply.github.com": { + "mails": ["725mrm@gmail.com", "mtmiller@users.noreply.github.com"], + "name": "Mark Roman Miller" + }, + "nelfin@gmail.com": { + "mails": ["nelfin@gmail.com", "hello@nelf.in"], + "name": "Andrew Haigh" }, "nickpesce22@gmail.com": { "mails": ["nickpesce22@gmail.com", "npesce@terpmail.umd.edu"], "name": "Nick Pesce" }, - "no-reply@google.com": { - "mails": [ - "nathaniel@google.com", - "mbp@google.com", - "tmarek@google.com", - "shlomme@gmail.com", - "balparda@google.com", - "dlindquist@google.com" - ], - "name": "Google, Inc." + "nozzy123nozzy@gmail.com": { + "mails": ["nozzy123nozzy@gmail.com"], + "name": "Takahide Nojima" }, "or.ba402@gmail.com": { "mails": ["or.ba402@gmail.com", "orbahari@mail.tau.ac.il"], @@ -86,7 +456,12 @@ }, "pcmanticore@gmail.com": { "mails": ["cpopa@cloudbasesolutions.com", "pcmanticore@gmail.com"], - "name": "Claudiu Popa" + "name": "Claudiu Popa", + "team": "Ex-maintainers" + }, + "peter.kolbus@gmail.com": { + "mails": ["peter.kolbus@gmail.com", "peter.kolbus@garmin.com"], + "name": "Peter Kolbus" }, "pierre.sassoulas@gmail.com": { "mails": [ @@ -94,14 +469,95 @@ "pierre.sassoulas@cea.fr", "pierre.sassoulas@wisebim.fr" ], - "name": "Pierre Sassoulas" + "name": "Pierre Sassoulas", + "team": "Maintainers" + }, + "raphael@makeleaps.com": { + "mails": ["raphael@rtpg.co", "raphael@makeleaps.com"], + "name": "Raphael Gaschignard" + }, + "reverbc@users.noreply.github.com": { + "mails": ["reverbc@users.noreply.github.com"], + "name": "Reverb Chu" + }, + "rhys.fureigh@gsa.gov": { + "mails": ["rhys.fureigh@gsa.gov", "fureigh@users.noreply.github.com"], + "name": "Fureigh" + }, + "rogalski.91@gmail.com": { + "mails": ["rogalski.91@gmail.com", "lukasz.rogalski@intel.com"], + "name": "Łukasz Rogalski", + "team": "Maintainers" + }, + "roy.williams.iii@gmail.com": { + "mails": ["roy.williams.iii@gmail.com", "rwilliams@lyft.com"], + "name": "Roy Williams", + "team": "Maintainers" + }, + "ruro.ruro@ya.ru": { + "mails": ["ruro.ruro@ya.ru"], + "name": "Ruro" + }, + "sergeykosarchuk@gmail.com": { + "mails": ["sergeykosarchuk@gmail.com"], + "name": "Kosarchuk Sergey" + }, + "shlomme@gmail.com": { + "mails": ["shlomme@gmail.com", "tmarek@google.com"], + "name": "Torsten Marek", + "team": "Ex-maintainers" + }, + "slavfoxman@gmail.com": { + "mails": ["slavfoxman@gmail.com"], + "name": "Slavfox" + }, + "sneakypete81@gmail.com": { + "mails": ["sneakypete81@gmail.com"], + "name": "Sneaky Pete" + }, + "stefan@sofa-rockers.org": { + "mails": ["stefan.scherfke@energymeteo.de", "stefan@sofa-rockers.org"], + "name": "Stefan Scherfke" + }, + "stephane@wirtel.be": { + "mails": ["stephane@wirtel.be"], + "name": "Stéphane Wirtel" + }, + "svet@hyperscience.com": { + "mails": ["svet@hyperscience.com"], + "name": "Svetoslav Neykov" + }, + "tanant@users.noreply.github.com": { + "mails": ["tanant@users.noreply.github.com"], + "name": "Anthony" + }, + "thenault@gmail.com": { + "mails": ["thenault@gmail.com", "sylvain.thenault@logilab.fr"], + "name": "Sylvain Thénault", + "team": "Ex-maintainers" }, "tushar.sadhwani000@gmail.com": { - "mails": ["tushar.sadhwani000@gmail.com", "tushar@deepsource.io"], + "mails": [ + "tushar.sadhwani000@gmail.com", + "tushar@deepsource.io", + "86737547+tushar-deepsource@users.noreply.github.com" + ], "name": "Tushar Sadhwani" }, + "vapier@gmail.com": { + "mails": ["vapier@gmail.com", "vapier@gentoo.org"], + "name": "Mike Frysinger" + }, "ville.skytta@iki.fi": { "mails": ["ville.skytta@iki.fi", "ville.skytta@upcloud.com"], "name": "Ville Skyttä" + }, + "viorels@gmail.com": { + "mails": ["viorels@gmail.com"], + "name": "Viorel Știrbu" + }, + "vladtemian@gmail.com": { + "mails": ["vladtemian@gmail.com"], + "name": "Vlad Temian" } } From 6120c20a25b51e23cb08bedb37847196b8b3b84f Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Mon, 21 Mar 2022 20:56:56 +0100 Subject: [PATCH 076/473] Add the email when easily available I.E. the used name in git is the same that was already existing in the contributors.txt. --- CONTRIBUTORS.txt | 629 +++++++++++++++++++++++++++++++---------------- 1 file changed, 416 insertions(+), 213 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 3232f61cf8..e1c772d45e 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -1,6 +1,19 @@ +# This file is autocompleted by 'contributors-txt', +# using the configuration in 'script/.contributors_aliases.json'. +# Do not add new persons manually and only add information without +# using '-' as the line first character. +# Please verify that your change are stable if you modify manually. + +Ex-maintainers +-------------- +- Claudiu Popa +- Sylvain Thénault : main author / maintainer +- Torsten Marek + + Maintainers ----------- -- Claudiu Popa + - Pierre Sassoulas - Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> - Marc Mueller <30130371+cdce8p@users.noreply.github.com> @@ -24,10 +37,6 @@ Maintainers - Yu Shao, Pang <36848472+yushao2@users.noreply.github.com> - Arianna Yang -Ex-maintainers --------------- -- Sylvain Thénault : main author / maintainer -- Torsten Marek Contributors ------------ @@ -36,45 +45,45 @@ We would not be here without folks that contributed patches, pull requests, issues and their time to pylint. We're incredibly grateful to all of these contributors: -- Daniel Balparda (Google): GPyLint maintainer (Google's pylint variant) -- Martin Pool (Google): +- Daniel Balparda (Google): GPyLint maintainer (Google's pylint variant) +- Martin Pool (Google): * warnings for anomalous backslashes * symbolic names for messages (like 'unused') * etc. -- Alexandre Fayolle (Logilab): TkInter gui, documentation, debian support -- Julien Cristau (Logilab): python 3 support -- Emile Anclin (Logilab): python 3 support -- Sandro Tosi: Debian packaging -- Mads Kiilerich -- Boris Feld +- Alexandre Fayolle (Logilab): TkInter gui, documentation, debian support +- Julien Cristau (Logilab): python 3 support +- Emile Anclin (Logilab): python 3 support +- Sandro Tosi : Debian packaging +- Mads Kiilerich +- Boris Feld - Bill Wendling - Sebastian Ulrich - Brian van den Broek: windows installation documentation - Amaury Forgeot d'Arc: check names imported from a module exists in the module - Benjamin Niemann: allow block level enabling/disabling of messages -- Nathaniel Manista: suspicious lambda checking -- David Shea: invalid sequence and slice index -- Carl Crowder: don't evaluate the value of arguments for 'dangerous-default-value' -- Michal Nowikowski: +- Nathaniel Manista : suspicious lambda checking +- David Shea : invalid sequence and slice index +- Carl Crowder : don't evaluate the value of arguments for 'dangerous-default-value' +- Michal Nowikowski : * wrong-spelling-in-comment * wrong-spelling-in-docstring * parallel execution on multiple CPUs -- David Lindquist: logging-format-interpolation warning. -- Brett Cannon: +- David Lindquist : logging-format-interpolation warning. +- Brett Cannon : * Port source code to be Python 2/3 compatible * Python 3 checker -- Vlad Temian: redundant-unittest-assert and the JSON reporter. -- Cosmin Poieană: unichr-builtin and improvements to bad-open-mode. -- Viorel Știrbu: intern-builtin warning. -- Dan Goldsmith: support for msg-template in HTML reporter. -- Chris Rebert: unidiomatic-typecheck. -- Steven Myint: duplicate-except. -- Radu Ciorba: not-context-manager and confusing-with-statement warnings. -- Bruno Daniel: check_docs extension. -- James Morgensen: ignored-modules option applies to import errors. -- Cezar Elnazli: deprecated-method -- Stéphane Wirtel: nonlocal-without-binding -- Laura Medioni (Logilab, on behalf of the CNES): +- Vlad Temian : redundant-unittest-assert and the JSON reporter. +- Cosmin Poieană : unichr-builtin and improvements to bad-open-mode. +- Viorel Știrbu : intern-builtin warning. +- Dan Goldsmith : support for msg-template in HTML reporter. +- Chris Rebert : unidiomatic-typecheck. +- Steven Myint : duplicate-except. +- Radu Ciorba : not-context-manager and confusing-with-statement warnings. +- Bruno Daniel : check_docs extension. +- James Morgensen : ignored-modules option applies to import errors. +- Cezar Elnazli : deprecated-method +- Stéphane Wirtel : nonlocal-without-binding +- Laura Médioni (Logilab, on behalf of the CNES): * misplaced-comparison-constant * no-classmethod-decorator * no-staticmethod-decorator @@ -85,56 +94,56 @@ contributors: * ungrouped-imports, * wrong-import-position * redefined-variable-type -- Aru Sahni: Git ignoring, regex-based ignores -- Mike Frysinger -- Moisés López (Vauxoo): +- Aru Sahni : Git ignoring, regex-based ignores +- Mike Frysinger +- Moisés López (Vauxoo): * Support for deprecated-modules in modules not installed, * Refactor wrong-import-order to integrate it with `isort` library * Add check too-complex with mccabe for cyclomatic complexity * Refactor wrong-import-position to skip try-import and nested cases * Add consider-merging-isinstance, superfluous-else-return * Fix consider-using-ternary for 'True and True and True or True' case -- Luis Escobar (Vauxoo): Add bad-docstring-quotes and docstring-first-line-empty -- Moisés López (Vauxoo): Add bad-docstring-quotes and docstring-first-line-empty + * Add bad-docstring-quotes and docstring-first-line-empty +- Luis Escobar (Vauxoo): Add bad-docstring-quotes and docstring-first-line-empty - Yannick Brehon -- Glenn Matthews: +- Glenn Matthews : * autogenerated documentation for optional extensions, * bug fixes and enhancements for docparams (née check_docs) extension -- Elias Dorneles: minor adjust to config defaults and docs -- Yuri Bochkarev: Added epytext support to docparams extension. -- Alexander Todorov: +- Elias Dorneles : minor adjust to config defaults and docs +- Yuri Bochkarev : Added epytext support to docparams extension. +- Alexander Todorov : * added new error conditions to 'bad-super-call', * Added new check for incorrect len(SEQUENCE) usage, * Added new extension for comparison against empty string constants, * Added new extension which detects comparing integers to zero, * Added new useless-return checker, * Added new try-except-raise checker -- Erik Eriksson: Added overlapping-except error check. -- Anthony Foglia (Google): Added simple string slots check. -- Derek Gustafson -- Petr Pulc: require whitespace around annotations -- John Paraskevopoulos: add 'differing-param-doc' and 'differing-type-doc' -- Martin von Gagern (Google): Added 'raising-format-tuple' warning. -- Ahirnish Pareek: 'keyword-arg-before-var-arg' check -- Daniel Miller -- Martin Bašti +- Erik Eriksson : Added overlapping-except error check. +- Anthony Foglia (Google): Added simple string slots check. +- Derek Gustafson +- Petr Pulc : require whitespace around annotations +- John Paraskevopoulos : add 'differing-param-doc' and 'differing-type-doc' +- Martin von Gagern (Google): Added 'raising-format-tuple' warning. +- Ahirnish Pareek : 'keyword-arg-before-var-arg' check +- Daniel Miller +- Martin Bašti * Added new check for shallow copy of os.environ * Added new check for useless `with threading.Lock():` statement -- Jacques Kvam -- Brian Shaginaw: prevent error on exception check for functions -- Ioana Tagirta: fix bad thread instantiation check -- Reverb Chu -- Tobias Hernstig -- Konstantin Manna -- Andreas Freimuth: fix indentation checking with tabs -- Renat Galimov +- Jacques Kvam +- Brian Shaginaw : prevent error on exception check for functions +- Ioana Tagirta : fix bad thread instantiation check +- Reverb Chu +- Tobias Hernstig <30827238+thernstig@users.noreply.github.com> +- Konstantin Manna +- Andreas Freimuth : fix indentation checking with tabs +- Renat Galimov - Thomas Snowden: fix missing-docstring for inner functions -- Mitchell Young: minor adjustment to docparams -- Marianna Polatoglou: minor contribution for wildcard import check -- Ben Green +- Mitchell Young : minor adjustment to docparams +- Marianna Polatoglou : minor contribution for wildcard import check +- Ben Green - Benjamin Freeman - Fureigh -- Jace Browning: updated default report format with clickable paths +- Jace Browning : updated default report format with clickable paths - Sushobhit (sushobhit27) * Added new check 'comparison-with-itself'. * Added new check 'useless-import-alias'. @@ -143,217 +152,411 @@ contributors: * Removed six package dependency. * Added new check 'chained-comparison'. * Added new check 'useless-object-inheritance'. -- Mariatta Wijaya +- Mariatta Wijaya * Added new check `logging-fstring-interpolation` * Documentation typo fixes -- Jason Owen +- Jason Owen - Mark Roman Miller: fix inline defs in too-many-statements -- Adam Dangoor -- Gary Tyler McLeod +- Adam Dangoor +- Gary Tyler McLeod - Wolfgang Grafen - Axel Muller - Fabio Zadrozny - Pierre Rouleau, -- Maarten ter Huurne +- Maarten ter Huurne - Mirko Friedenhagen - Matej Marusak -- Nick Drozd: performance improvements to astroid -- Kosarchuk Sergey -- Kurian Benoy -- Carey Metcalfe: demoted `try-except-raise` from error to warning -- Marcus Näslund (naslundx) -- Natalie Serebryakova -- Caio Carrara -- Roberto Leinardi: PyCharm plugin maintainer -- Aivar Annamaa +- Nick Drozd : performance improvements to astroid +- Kosarchuk Sergey +- Kurian Benoy <70306694+kurianbenoy-aot@users.noreply.github.com> +- Carey Metcalfe : demoted `try-except-raise` from error to warning +- Marcus Näslund (naslundx) +- Natalie Serebryakova +- Caio Carrara +- Roberto Leinardi : PyCharm plugin maintainer +- Aivar Annamaa - Hornwitser: fix import graph - Yuri Gribov -- Drew Risinger -- Ben James -- Tomer Chachamu: simplifiable-if-expression +- Drew Risinger +- Ben James +- Tomer Chachamu : simplifiable-if-expression - Richard Goodman: simplifiable-if-expression -- Alan Chan -- Benjamin Drung: contributing Debian Developer -- Scott Worley -- Michael Hudson-Doyle -- Lucas Cimon -- Mike Miller -- Sergei Lebedev +- Alan Chan +- Benjamin Drung : contributing Debian Developer +- Scott Worley +- Michael Hudson-Doyle +- Lucas Cimon +- Mike Miller +- Sergei Lebedev <185856+superbobry@users.noreply.github.com> (superbobry) - Sasha Bagan -- Pablo Galindo Salgado +- Pablo Galindo Salgado * Fix false positive 'Non-iterable value' with async comprehensions. -- Matus Valo -- Sardorbek Imomaliev -- Justin Li (justinnhli) -- Nicolas Dickreuter -- Pascal Corpet -- Svetoslav Neykov -- Federico Bond -- Fantix King (UChicago) +- Matus Valo +- Sardorbek Imomaliev +- Justin Li (justinnhli) +- Nicolas Dickreuter +- Pascal Corpet +- Svetoslav Neykov +- Federico Bond +- Fantix King (UChicago) - Yory (yory8) -- Thomas Hisch -- Clément Pit-Claudel +- Thomas Hisch +- Clément Pit-Claudel - Goudcode - Paul Renvoise - Bluesheeptoken -- Michael Scott Cuthbert -- Nathan Marrow +- Michael Scott Cuthbert +- Nathan Marrow - Taewon Kim - Daniil Kharkov - Tyler N. Thieding -- Zeb Nicholls +- Zeb Nicholls * Made W9011 compatible with 'of' syntax in return types -- Martin Vielsmaier +- Martin Vielsmaier - Agustin Toledo - Nicholas Smith -- Peter Kolbus (Garmin) +- Peter Kolbus (Garmin) - Oisin Moran -- Andrzej Klajnert +- Andrzej Klajnert - Andrés Pérez Hortal -- Niko Wenselowski -- Danny Hermes -- Eric Froemling -- Robert Schweizer -- Hugo van Kemenade -- Mikhail Fesenko -- Trevor Bekolay +- Niko Wenselowski +- Danny Hermes +- Eric Froemling +- Robert Schweizer +- Hugo van Kemenade +- Mikhail Fesenko +- Trevor Bekolay * Added --list-msgs-enabled command -- Rémi Cardona -- Daniel Draper -- Gabriel R. Sezefredo: Fixed "exception-escape" false positive with generators +- Rémi Cardona +- Daniel Draper +- Gabriel R. Sezefredo : Fixed "exception-escape" false positive with generators - laike9m -- Janne Rönkkö -- Hugues Bruant -- Tim Gates -- Enji Cooper -- Bastien Vallet +- Janne Rönkkö +- Hugues Bruant +- Tim Gates +- Enji Cooper +- Bastien Vallet - Pek Chhan - Craig Henriques -- Matthijs Blom -- Andy Palmer -- Wes Turner (Google): added new check 'inconsistent-quotes' -- Athos Ribeiro: Fixed dict-keys-not-iterating false positive for inverse containment checks -- Anubhav +- Matthijs Blom <19817960+MatthijsBlom@users.noreply.github.com> +- Andy Palmer <25123779+ninezerozeronine@users.noreply.github.com> +- Wes Turner (Google): added new check 'inconsistent-quotes' +- Athos Ribeiro : Fixed dict-keys-not-iterating false positive for inverse containment checks +- Anubhav <35621759+anubh-v@users.noreply.github.com> - Ben Graham - Anthony Tan - Benny Müller - Bernie Gray - Slavfox -- Matthew Beckers (mattlbeck) -- Yang Yang -- Andrew J. Simmons (anjsimmo) -- Damien Baty -- Daniel R. Neal (danrneal) -- Jeremy Fleischman (jfly) -- Shiv Venkatasubrahmanyam -- Jochen Preusche (iilei) -- Ram Rachum (cool-RR) +- Matthew Beckers <17108752+mattlbeck@users.noreply.github.com> (mattlbeck) +- Yang Yang +- Andrew J. Simmons (anjsimmo) +- Damien Baty +- Daniel R. Neal (danrneal) +- Jeremy Fleischman (jfly) +- Shiv Venkatasubrahmanyam +- Jochen Preusche (iilei) +- Ram Rachum (cool-RR) - D. Alphus (Alphadelta14) -- Pieter Engelbrecht -- Ethan Leba -- Matěj Grabovský -- Yeting Li (yetingli) -- Frost Ming (frostming) -- Luigi Bertaco Cristofolini (luigibertaco) -- Eli Fine (eli88fine): Fixed false positive duplicate code warning for lines with symbols only -- Ganden Schaffner -- Josselin Feist -- David Cain -- Pedro Algarvio (s0undt3ch) -- Luigi Bertaco Cristofolini (luigibertaco) -- Or Bahari -- Joshua Cannon -- Giuseppe Valente +- Pieter Engelbrecht +- Ethan Leba +- Matěj Grabovský +- Yeting Li (yetingli) +- Frost Ming (frostming) +- Luigi Bertaco Cristofolini (luigibertaco) +- Eli Fine (eli88fine): Fixed false positive duplicate code warning for lines with symbols only +- Ganden Schaffner +- Josselin Feist +- David Cain +- Pedro Algarvio (s0undt3ch) +- Or Bahari +- Joshua Cannon +- Giuseppe Valente - Takashi Hirashima -- Joffrey Mander -- Julien Palard -- Raphael Gaschignard -- Sorin Sbarnea -- Gergely Kalmár -- Batuhan Taskaya -- Frank Harrison (doublethefish) +- Joffrey Mander +- Julien Palard +- Raphael Gaschignard +- Sorin Sbarnea +- Gergely Kalmár +- Batuhan Taskaya +- Frank Harrison (doublethefish) - Gauthier Sebaux -- Logan Miller (komodo472) -- Matthew Suozzo -- David Gilman -- Ikraduya Edian: Added new checks 'consider-using-generator' and 'use-a-generator'. -- Tiago Honorato -- Lefteris Karapetsas -- Louis Sautier -- Quentin Young -- Alexander Kapshuna -- Mark Byrne -- Konstantina Saketou -- Andrew Howe -- James Sinclair (irgeek) -- Aidan Haase -- Elizabeth Bott -- Sebastian Müller -- Ramiro Leal-Cavazos (ramiro050): Fixed bug preventing pylint from working with emacs tramp +- Logan Miller <14319179+komodo472@users.noreply.github.com> (komodo472) +- Matthew Suozzo +- David Gilman +- Ikraduya Edian : Added new checks 'consider-using-generator' and 'use-a-generator'. +- Tiago Honorato <61059243+tiagohonorato@users.noreply.github.com> +- Lefteris Karapetsas +- Louis Sautier +- Quentin Young +- Alexander Kapshuna +- Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> +- Konstantina Saketou <56515303+ksaketou@users.noreply.github.com> +- Andrew Howe +- James Sinclair (irgeek) +- Aidan Haase <44787650+haasea@users.noreply.github.com> +- Elizabeth Bott <52465744+elizabethbott@users.noreply.github.com> +- Sebastian Müller +- Ramiro Leal-Cavazos (ramiro050): Fixed bug preventing pylint from working with emacs tramp - manderj - qwiddle - das-intensity - Jiajunsu (victor) -- Andrew Haigh (nelfin) -- Aditya Gupta (adityagupta1089) +- Andrew Haigh (nelfin) +- Aditya Gupta (adityagupta1089) * Added ignore_signatures to duplicate checker - ruro -- David Liu (david-yz-liu) +- David Liu (david-yz-liu) - Bernard Nauwelaerts -- Fabian Damken -- Markus Siebenhaar -- Lorena Buciu (lorena-b) -- Sergei Lebedev (superbobry) -- Maksym Humetskyi (mhumetskyi) +- Fabian Damken +- Markus Siebenhaar <41283549+siehar@users.noreply.github.com> +- Lorena Buciu <46202743+lorena-b@users.noreply.github.com> (lorena-b) +- Maksym Humetskyi (mhumetskyi) * Fixed ignored empty functions by similarities checker with "ignore-signatures" option enabled * Ignore function decorators signatures as well by similarities checker with "ignore-signatures" option enabled * Ignore class methods and nested functions signatures as well by similarities checker with "ignore-signatures" option enabled -- Daniel Dorani (doranid) -- Will Shanks -- Mark Bell +- Daniel Dorani (doranid) +- Will Shanks +- Mark Bell - Marco Gorelli: Documented Jupyter integration -- Rebecca Turner (9999years) +- Rebecca Turner (9999years) - Yilei Yang -- Marcin Kurczewski (rr-) -- Tanvi Moharir: Fix for invalid toml config -- Eisuke Kawashima (e-kwsm) -- Michal Vasilek -- Kai Mueller (kasium) -- Sam Vermeiren (PaaEl) -- Phil A. (flying-sheep) -- Melvin Hazeleger (melvio) -- Hayden Richards (SupImDos) +- Marcin Kurczewski (rr-) +- Tanvi Moharir <74228962+tanvimoharir@users.noreply.github.com>: Fix for invalid toml config +- Eisuke Kawashima (e-kwsm) +- Michal Vasilek +- Kai Mueller <15907922+kasium@users.noreply.github.com> (kasium) +- Sam Vermeiren <88253337+PaaEl@users.noreply.github.com> (PaaEl) +- Philipp Albrecht (pylbrecht) +- Melvin Hazeleger <31448155+melvio@users.noreply.github.com> (melvio) +- Hayden Richards <62866982+SupImDos@users.noreply.github.com> (SupImDos) * Fixed "no-self-use" for async methods * Fixed "docparams" extension for async functions and methods -- Jeroen Seegers (jeroenseegers) +- Jeroen Seegers (jeroenseegers) * Fixed `toml` dependency issue -- Tim Martin -- Jaehoon Hwang (jaehoonhwang) +- Tim Martin +- Jaehoon Hwang (jaehoonhwang) - Samuel Forestier -- Nick Pesce +- Nick Pesce - James DesLauriers -- Youngsoo Sung -- Samuel Freilich (sfreilich) -- Mike Fiedler (miketheman) -- Takahide Nojima -- Tushar Sadhwani (tusharsadhwani) -- Ikraduya Edian -- Antonio Quarta (sgheppy) +- Youngsoo Sung +- Samuel Freilich (sfreilich) +- Mike Fiedler (miketheman) +- Takahide Nojima +- Tushar Sadhwani (tusharsadhwani) +- Antonio Quarta (sgheppy) - Harshil (harshil21) -- Jérome Perrin (perrinjerome) -- Felix von Drigalski (felixvd) -- Jake Lishman (jakelishman) -- Philipp Albrecht (pylbrecht) -- Allan Chandler (allanc65) +- Jérome Perrin (perrinjerome) +- Felix von Drigalski (felixvd) +- Jake Lishman (jakelishman) +- Allan Chandler <95424144+allanc65@users.noreply.github.com> (allanc65) * Fixed issue 5452, false positive missing-param-doc for multi-line Google-style params - Eero Vuojolahti - Kian-Meng, Ang - Nuzula H. Yudaka (Nuzhuka) -- Carli Freudenberg (CarliJoy) +- Carli Freudenberg (CarliJoy) * Fixed issue 5281, added Unicode checker * Improve non-ascii-name checker -- Daniel Brookman -- Téo Bouvard -- Konrad Weihmann -- Sergey B Kirpichev -- Joseph Young (jpy-git) +- Daniel Brookman <53625739+dbrookman@users.noreply.github.com> +- Téo Bouvard +- Konrad Weihmann <46938494+priv-kweihmann@users.noreply.github.com> +- Sergey B Kirpichev +- Joseph Young <80432516+jpy-git@users.noreply.github.com> (jpy-git) +- Adrien Di Mascio +- Ville Skyttä +- Pierre-Yves David +- Nicolas Chauvat +- Holger Peters +- Julien Jehannet +- Anthony Sottile +- Jakub Wilk +- Émile Crater +- Pavel Roskin +- へーさん +- Manuel Vázquez Acosta +- Jim Robertson +- Anthony Truchet +- orSolocate <38433858+orSolocate@users.noreply.github.com> +- Buck (Yelp) +- Mihai Balint +- David Douard +- Alexandru Coman +- Taewon D. Kim +- Sneaky Pete +- Rene Zhang +- Mr. Senko +- Marco Forte +- Ionel Maries Cristian +- Daniel Harding +- wtracy +- jpkotta +- chohner +- Steven M. Vascellaro +- Ricardo Gemignani +- Nick Bastin +- Kylian +- John Leach +- Erik Wright +- Dan Hemberger <846186+hemberger@users.noreply.github.com> +- Aurelien Campeas +- Alexander Pervakov +- Alain Leufroy +- xmo-odoo +- root@clnstor.am.local +- grizzly.nyo@gmail.com +- craig-sh +- bernie gray +- Yilei "Dolee" Yang +- Tyler Thieding +- Thomas Grainger +- Simu Toni +- Radostin Stoyanov +- Paul Renvoisé +- PHeanEX +- Omega Weapon +- Nikolai Kristiansen +- LCD 47 +- John Kirkham +- Jens H. Nielsen +- Harut +- Grygorii Iermolenko +- Filipe Brandenburger +- Derek Harland +- David Pursehouse +- Chris Murray +- Chris Lamb +- Charles Hebert +- Buck Golemon +- Benny Mueller +- Adam Parkin +- 谭九鼎 <109224573@qq.com> +- Łukasz Sznuk +- y2kbugger +- vinnyrose +- ttenhoeve-aa +- thinwybk +- syutbai +- sdet_liang +- sbagan +- pyves@crater.logilab.fr +- paschich +- oittaa <8972248+oittaa@users.noreply.github.com> +- moxian +- mar-chi-pan +- ludal@logilab.fr +- lrjball <50599110+lrjball@users.noreply.github.com> +- jpkotta@shannon +- jaydesl <35102795+jaydesl@users.noreply.github.com> +- jab +- glmdgrielson <32415403+glmdgrielson@users.noreply.github.com> +- glegoux +- gaurikholkar +- flyingbot91 +- fahhem +- fadedDexofan +- danields +- cosven +- cordis-dev +- bluesheeptoken +- anatoly techtonik +- amdev@AMDEV-WS01.cisco.com +- agutole +- Zeckie <49095968+Zeckie@users.noreply.github.com> +- Yuval Langer +- Yury Gribov +- Yoichi Nakayama +- Yannack +- Yann Dirson +- Xi Shen +- Victor Jiajunsu <16359131+jiajunsu@users.noreply.github.com> +- Tomasz Magulski +- Tim Hatch +- T.Rzepka +- Stephen Longofono <8992396+SLongofono@users.noreply.github.com> +- Stanislav Levin +- Skip Montanaro +- Santiago Castro +- Samuel FORESTIER +- Ryan McGuire +- Ry4an Brase +- Ruro +- Roman Ivanov +- Robin Tweedie <70587124+robin-wayve@users.noreply.github.com> +- Randall Leeds +- Qwiddle13 <32040075+Qwiddle13@users.noreply.github.com> +- Peter Dawyndt +- Peter Bittner +- Peter Aronoff +- Paul Cochrane +- Patrik +- Oisín Moran +- Obscuron +- Noam Yorav-Raphael +- Nir Soffer +- Nikita Sobolev +- Nick Smith +- Ned Batchelder +- Mitar +- Mike Bryant +- Michka Popoff +- Michael Kefeder +- Michael Giuffrida +- Matej Marušák +- Marco Edward Gorelli +- Maik Röder +- Kári Tristan Helgason +- Krzysztof Czapla +- Kraig Brockschmidt +- Kound +- Kian Meng, Ang +- Kevin Phillips +- Kevin Jing Qiu +- Kayran Schmidt <59456929+yumasheta@users.noreply.github.com> +- Jürgen Hermann +- Jonathan Kotta +- John McGehee +- John Gabriele +- John Belmonte +- Jared Garst +- Jared Deckard +- James M. Allen +- James Lingard +- James Broadhead +- Jakob Normark +- JT Olds +- Grant Welch +- Fabrice Douchant +- Fabio Natali +- Emmanuel Chaudron +- Edgemaster +- Dr. Nick +- Don Jayamanne +- Dmytro Kyrychuk +- Denis Laxalde +- Daniele Procida +- Daniela Plascencia +- Dan Garrette +- Damien Nozay +- Craig Citro +- Christopher Zurcher +- Cameron Olechowski +- Calin Don +- C.A.M. Gerlach +- Bruno P. Kinoshita +- Brian C. Lane +- Brandon W Maister +- BioGeek +- Benjamin Graham +- Benedikt Morbach +- Banjamin Freeman +- Arun Persaud +- Arthur Lutz +- Antonio Ossa +- Anthony VEREZ +- Anentropic +- Andres Perez Hortal +- Alok Singh <8325708+alok@users.noreply.github.com> +- Alex Jurkiewicz +- Alex Hearn +- Alan Evangelista +- Adrian Chirieac From 5bd082a30886386ff30c900d377b695a3fbfe257 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Wed, 23 Mar 2022 16:16:46 +0100 Subject: [PATCH 077/473] Separate contributors without email from others --- CONTRIBUTORS.txt | 121 +++++++++++++++++++++++++---------------------- 1 file changed, 64 insertions(+), 57 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index e1c772d45e..3a59d7336f 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -56,11 +56,6 @@ contributors: - Sandro Tosi : Debian packaging - Mads Kiilerich - Boris Feld -- Bill Wendling -- Sebastian Ulrich -- Brian van den Broek: windows installation documentation -- Amaury Forgeot d'Arc: check names imported from a module exists in the module -- Benjamin Niemann: allow block level enabling/disabling of messages - Nathaniel Manista : suspicious lambda checking - David Shea : invalid sequence and slice index - Carl Crowder : don't evaluate the value of arguments for 'dangerous-default-value' @@ -105,7 +100,6 @@ contributors: * Fix consider-using-ternary for 'True and True and True or True' case * Add bad-docstring-quotes and docstring-first-line-empty - Luis Escobar (Vauxoo): Add bad-docstring-quotes and docstring-first-line-empty -- Yannick Brehon - Glenn Matthews : * autogenerated documentation for optional extensions, * bug fixes and enhancements for docparams (née check_docs) extension @@ -137,14 +131,11 @@ contributors: - Konstantin Manna - Andreas Freimuth : fix indentation checking with tabs - Renat Galimov -- Thomas Snowden: fix missing-docstring for inner functions - Mitchell Young : minor adjustment to docparams - Marianna Polatoglou : minor contribution for wildcard import check - Ben Green -- Benjamin Freeman -- Fureigh - Jace Browning : updated default report format with clickable paths -- Sushobhit (sushobhit27) +- Sushobhit <31987769+sushobhit27@users.noreply.github.com> (sushobhit27) * Added new check 'comparison-with-itself'. * Added new check 'useless-import-alias'. * Added support of annotations in missing-type-doc and missing-return-type-doc. @@ -156,16 +147,9 @@ contributors: * Added new check `logging-fstring-interpolation` * Documentation typo fixes - Jason Owen -- Mark Roman Miller: fix inline defs in too-many-statements - Adam Dangoor - Gary Tyler McLeod -- Wolfgang Grafen -- Axel Muller -- Fabio Zadrozny -- Pierre Rouleau, - Maarten ter Huurne -- Mirko Friedenhagen -- Matej Marusak - Nick Drozd : performance improvements to astroid - Kosarchuk Sergey - Kurian Benoy <70306694+kurianbenoy-aot@users.noreply.github.com> @@ -175,12 +159,9 @@ contributors: - Caio Carrara - Roberto Leinardi : PyCharm plugin maintainer - Aivar Annamaa -- Hornwitser: fix import graph -- Yuri Gribov - Drew Risinger - Ben James - Tomer Chachamu : simplifiable-if-expression -- Richard Goodman: simplifiable-if-expression - Alan Chan - Benjamin Drung : contributing Debian Developer - Scott Worley @@ -188,7 +169,6 @@ contributors: - Lucas Cimon - Mike Miller - Sergei Lebedev <185856+superbobry@users.noreply.github.com> (superbobry) -- Sasha Bagan - Pablo Galindo Salgado * Fix false positive 'Non-iterable value' with async comprehensions. - Matus Valo @@ -199,26 +179,15 @@ contributors: - Svetoslav Neykov - Federico Bond - Fantix King (UChicago) -- Yory (yory8) - Thomas Hisch - Clément Pit-Claudel -- Goudcode -- Paul Renvoise -- Bluesheeptoken - Michael Scott Cuthbert - Nathan Marrow -- Taewon Kim -- Daniil Kharkov -- Tyler N. Thieding - Zeb Nicholls * Made W9011 compatible with 'of' syntax in return types - Martin Vielsmaier -- Agustin Toledo -- Nicholas Smith - Peter Kolbus (Garmin) -- Oisin Moran - Andrzej Klajnert -- Andrés Pérez Hortal - Niko Wenselowski - Danny Hermes - Eric Froemling @@ -230,24 +199,16 @@ contributors: - Rémi Cardona - Daniel Draper - Gabriel R. Sezefredo : Fixed "exception-escape" false positive with generators -- laike9m - Janne Rönkkö - Hugues Bruant - Tim Gates - Enji Cooper - Bastien Vallet -- Pek Chhan -- Craig Henriques - Matthijs Blom <19817960+MatthijsBlom@users.noreply.github.com> - Andy Palmer <25123779+ninezerozeronine@users.noreply.github.com> - Wes Turner (Google): added new check 'inconsistent-quotes' - Athos Ribeiro : Fixed dict-keys-not-iterating false positive for inverse containment checks - Anubhav <35621759+anubh-v@users.noreply.github.com> -- Ben Graham -- Anthony Tan -- Benny Müller -- Bernie Gray -- Slavfox - Matthew Beckers <17108752+mattlbeck@users.noreply.github.com> (mattlbeck) - Yang Yang - Andrew J. Simmons (anjsimmo) @@ -257,7 +218,6 @@ contributors: - Shiv Venkatasubrahmanyam - Jochen Preusche (iilei) - Ram Rachum (cool-RR) -- D. Alphus (Alphadelta14) - Pieter Engelbrecht - Ethan Leba - Matěj Grabovský @@ -272,7 +232,6 @@ contributors: - Or Bahari - Joshua Cannon - Giuseppe Valente -- Takashi Hirashima - Joffrey Mander - Julien Palard - Raphael Gaschignard @@ -280,7 +239,6 @@ contributors: - Gergely Kalmár - Batuhan Taskaya - Frank Harrison (doublethefish) -- Gauthier Sebaux - Logan Miller <14319179+komodo472@users.noreply.github.com> (komodo472) - Matthew Suozzo - David Gilman @@ -298,16 +256,10 @@ contributors: - Elizabeth Bott <52465744+elizabethbott@users.noreply.github.com> - Sebastian Müller - Ramiro Leal-Cavazos (ramiro050): Fixed bug preventing pylint from working with emacs tramp -- manderj -- qwiddle -- das-intensity -- Jiajunsu (victor) - Andrew Haigh (nelfin) - Aditya Gupta (adityagupta1089) * Added ignore_signatures to duplicate checker -- ruro - David Liu (david-yz-liu) -- Bernard Nauwelaerts - Fabian Damken - Markus Siebenhaar <41283549+siehar@users.noreply.github.com> - Lorena Buciu <46202743+lorena-b@users.noreply.github.com> (lorena-b) @@ -318,9 +270,7 @@ contributors: - Daniel Dorani (doranid) - Will Shanks - Mark Bell -- Marco Gorelli: Documented Jupyter integration - Rebecca Turner (9999years) -- Yilei Yang - Marcin Kurczewski (rr-) - Tanvi Moharir <74228962+tanvimoharir@users.noreply.github.com>: Fix for invalid toml config - Eisuke Kawashima (e-kwsm) @@ -336,24 +286,18 @@ contributors: * Fixed `toml` dependency issue - Tim Martin - Jaehoon Hwang (jaehoonhwang) -- Samuel Forestier - Nick Pesce -- James DesLauriers - Youngsoo Sung - Samuel Freilich (sfreilich) - Mike Fiedler (miketheman) - Takahide Nojima - Tushar Sadhwani (tusharsadhwani) - Antonio Quarta (sgheppy) -- Harshil (harshil21) - Jérome Perrin (perrinjerome) - Felix von Drigalski (felixvd) - Jake Lishman (jakelishman) - Allan Chandler <95424144+allanc65@users.noreply.github.com> (allanc65) * Fixed issue 5452, false positive missing-param-doc for multi-line Google-style params -- Eero Vuojolahti -- Kian-Meng, Ang -- Nuzula H. Yudaka (Nuzhuka) - Carli Freudenberg (CarliJoy) * Fixed issue 5281, added Unicode checker * Improve non-ascii-name checker @@ -560,3 +504,66 @@ contributors: - Alex Hearn - Alan Evangelista - Adrian Chirieac + + +Co-Author +--------- +The following persons were credited manually but did not commit themselves +under this name, or we did not manage to find their commits in the history. + +- Agustin Toledo +- Amaury Forgeot d'Arc: check names imported from a module exists in the module +- Anthony Tan +- Axel Muller +- Ben Graham +- Benjamin Freeman +- Benjamin Niemann: allow block level enabling/disabling of messages +- Benny Müller +- Bernard Nauwelaerts +- Bernie Gray +- Bill Wendling +- Bluesheeptoken +- Brian van den Broek: windows installation documentation +- Craig Henriques +- D. Alphus (Alphadelta14) +- Daniil Kharkov +- das-intensity +- Eero Vuojolahti +- Fabio Zadrozny +- Fureigh +- Gauthier Sebaux +- Goudcode +- Harshil (harshil21) +- Hornwitser: fix import graph +- James DesLauriers +- Jiajunsu (victor) +- Kian-Meng, Ang +- laike9m +- manderj +- Marco Gorelli: Documented Jupyter integration +- Mark Roman Miller: fix inline defs in too-many-statements +- Matej Marusak +- Mirko Friedenhagen +- Nicholas Smith +- Nuzula H. Yudaka (Nuzhuka) +- Oisin Moran +- Paul Renvoise +- Pek Chhan +- Peter Hammond +- Pierre Rouleau +- qwiddle +- Richard Goodman: simplifiable-if-expression (with Tomer Chachamu) +- ruro +- Samuel Forestier +- Sasha Bagan +- Sebastian Ulrich +- Slavfox +- Taewon Kim +- Takashi Hirashima +- Thomas Snowden: fix missing-docstring for inner functions +- Tyler N. Thieding +- Wolfgang Grafen +- Yannick Brehon +- Yilei Yang +- Yory (yory8) +- Yuri Gribov From 3a5600af11b9850345470c5ac4883d1209d7e7fb Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Wed, 23 Mar 2022 12:52:44 +0100 Subject: [PATCH 078/473] Sort contributors according to their number of commits --- CONTRIBUTORS.txt | 480 +++++++++++++++++++++++------------------------ 1 file changed, 240 insertions(+), 240 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 3a59d7336f..67a7e5d9bf 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -19,9 +19,11 @@ Maintainers - Marc Mueller <30130371+cdce8p@users.noreply.github.com> - Hippo91 - Łukasz Rogalski +- Jacob Walls - Ashley Whetter - Bryce Guinta -- Jacob Walls +- Yu Shao, Pang <36848472+yushao2@users.noreply.github.com> +- Andreas Finkler <3929834+DudeNr33@users.noreply.github.com> - Dimitri Prybysh * multiple-imports, not-iterable, not-a-mapping, various patches. - Roy Williams (Lyft) @@ -33,8 +35,6 @@ Maintainers * Added Python 3 check for accessing deprecated methods on the 'string' module, various patches. - Florian Bruhin -- Andreas Finkler <3929834+DudeNr33@users.noreply.github.com> -- Yu Shao, Pang <36848472+yushao2@users.noreply.github.com> - Arianna Yang @@ -45,39 +45,23 @@ We would not be here without folks that contributed patches, pull requests, issues and their time to pylint. We're incredibly grateful to all of these contributors: -- Daniel Balparda (Google): GPyLint maintainer (Google's pylint variant) -- Martin Pool (Google): - * warnings for anomalous backslashes - * symbolic names for messages (like 'unused') - * etc. -- Alexandre Fayolle (Logilab): TkInter gui, documentation, debian support -- Julien Cristau (Logilab): python 3 support - Emile Anclin (Logilab): python 3 support -- Sandro Tosi : Debian packaging -- Mads Kiilerich -- Boris Feld -- Nathaniel Manista : suspicious lambda checking -- David Shea : invalid sequence and slice index -- Carl Crowder : don't evaluate the value of arguments for 'dangerous-default-value' - Michal Nowikowski : * wrong-spelling-in-comment * wrong-spelling-in-docstring * parallel execution on multiple CPUs -- David Lindquist : logging-format-interpolation warning. +- Bruno Daniel : check_docs extension. +- Sushobhit <31987769+sushobhit27@users.noreply.github.com> (sushobhit27) + * Added new check 'comparison-with-itself'. + * Added new check 'useless-import-alias'. + * Added support of annotations in missing-type-doc and missing-return-type-doc. + * Added new check 'comparison-with-callable'. + * Removed six package dependency. + * Added new check 'chained-comparison'. + * Added new check 'useless-object-inheritance'. - Brett Cannon : * Port source code to be Python 2/3 compatible * Python 3 checker -- Vlad Temian : redundant-unittest-assert and the JSON reporter. -- Cosmin Poieană : unichr-builtin and improvements to bad-open-mode. -- Viorel Știrbu : intern-builtin warning. -- Dan Goldsmith : support for msg-template in HTML reporter. -- Chris Rebert : unidiomatic-typecheck. -- Steven Myint : duplicate-except. -- Radu Ciorba : not-context-manager and confusing-with-statement warnings. -- Bruno Daniel : check_docs extension. -- James Morgensen : ignored-modules option applies to import errors. -- Cezar Elnazli : deprecated-method -- Stéphane Wirtel : nonlocal-without-binding - Laura Médioni (Logilab, on behalf of the CNES): * misplaced-comparison-constant * no-classmethod-decorator @@ -89,8 +73,11 @@ contributors: * ungrouped-imports, * wrong-import-position * redefined-variable-type -- Aru Sahni : Git ignoring, regex-based ignores -- Mike Frysinger +- Alexandre Fayolle (Logilab): TkInter gui, documentation, debian support +- Nick Drozd : performance improvements to astroid +- Julien Cristau (Logilab): python 3 support +- Adrien Di Mascio +- Frank Harrison (doublethefish) - Moisés López (Vauxoo): * Support for deprecated-modules in modules not installed, * Refactor wrong-import-order to integrate it with `isort` library @@ -99,249 +86,129 @@ contributors: * Add consider-merging-isinstance, superfluous-else-return * Fix consider-using-ternary for 'True and True and True or True' case * Add bad-docstring-quotes and docstring-first-line-empty -- Luis Escobar (Vauxoo): Add bad-docstring-quotes and docstring-first-line-empty -- Glenn Matthews : - * autogenerated documentation for optional extensions, - * bug fixes and enhancements for docparams (née check_docs) extension -- Elias Dorneles : minor adjust to config defaults and docs -- Yuri Bochkarev : Added epytext support to docparams extension. -- Alexander Todorov : - * added new error conditions to 'bad-super-call', - * Added new check for incorrect len(SEQUENCE) usage, - * Added new extension for comparison against empty string constants, - * Added new extension which detects comparing integers to zero, - * Added new useless-return checker, - * Added new try-except-raise checker -- Erik Eriksson : Added overlapping-except error check. -- Anthony Foglia (Google): Added simple string slots check. -- Derek Gustafson -- Petr Pulc : require whitespace around annotations -- John Paraskevopoulos : add 'differing-param-doc' and 'differing-type-doc' -- Martin von Gagern (Google): Added 'raising-format-tuple' warning. -- Ahirnish Pareek : 'keyword-arg-before-var-arg' check -- Daniel Miller -- Martin Bašti - * Added new check for shallow copy of os.environ - * Added new check for useless `with threading.Lock():` statement -- Jacques Kvam -- Brian Shaginaw : prevent error on exception check for functions -- Ioana Tagirta : fix bad thread instantiation check -- Reverb Chu -- Tobias Hernstig <30827238+thernstig@users.noreply.github.com> -- Konstantin Manna -- Andreas Freimuth : fix indentation checking with tabs -- Renat Galimov -- Mitchell Young : minor adjustment to docparams -- Marianna Polatoglou : minor contribution for wildcard import check -- Ben Green -- Jace Browning : updated default report format with clickable paths -- Sushobhit <31987769+sushobhit27@users.noreply.github.com> (sushobhit27) - * Added new check 'comparison-with-itself'. - * Added new check 'useless-import-alias'. - * Added support of annotations in missing-type-doc and missing-return-type-doc. - * Added new check 'comparison-with-callable'. - * Removed six package dependency. - * Added new check 'chained-comparison'. - * Added new check 'useless-object-inheritance'. -- Mariatta Wijaya - * Added new check `logging-fstring-interpolation` - * Documentation typo fixes -- Jason Owen -- Adam Dangoor -- Gary Tyler McLeod -- Maarten ter Huurne -- Nick Drozd : performance improvements to astroid -- Kosarchuk Sergey -- Kurian Benoy <70306694+kurianbenoy-aot@users.noreply.github.com> -- Carey Metcalfe : demoted `try-except-raise` from error to warning -- Marcus Näslund (naslundx) -- Natalie Serebryakova -- Caio Carrara -- Roberto Leinardi : PyCharm plugin maintainer -- Aivar Annamaa -- Drew Risinger -- Ben James -- Tomer Chachamu : simplifiable-if-expression -- Alan Chan -- Benjamin Drung : contributing Debian Developer -- Scott Worley -- Michael Hudson-Doyle -- Lucas Cimon -- Mike Miller -- Sergei Lebedev <185856+superbobry@users.noreply.github.com> (superbobry) -- Pablo Galindo Salgado - * Fix false positive 'Non-iterable value' with async comprehensions. -- Matus Valo -- Sardorbek Imomaliev -- Justin Li (justinnhli) -- Nicolas Dickreuter -- Pascal Corpet -- Svetoslav Neykov -- Federico Bond -- Fantix King (UChicago) -- Thomas Hisch -- Clément Pit-Claudel -- Michael Scott Cuthbert -- Nathan Marrow -- Zeb Nicholls - * Made W9011 compatible with 'of' syntax in return types -- Martin Vielsmaier -- Peter Kolbus (Garmin) -- Andrzej Klajnert -- Niko Wenselowski -- Danny Hermes -- Eric Froemling -- Robert Schweizer -- Hugo van Kemenade -- Mikhail Fesenko -- Trevor Bekolay - * Added --list-msgs-enabled command -- Rémi Cardona -- Daniel Draper -- Gabriel R. Sezefredo : Fixed "exception-escape" false positive with generators -- Janne Rönkkö -- Hugues Bruant -- Tim Gates -- Enji Cooper -- Bastien Vallet -- Matthijs Blom <19817960+MatthijsBlom@users.noreply.github.com> -- Andy Palmer <25123779+ninezerozeronine@users.noreply.github.com> -- Wes Turner (Google): added new check 'inconsistent-quotes' -- Athos Ribeiro : Fixed dict-keys-not-iterating false positive for inverse containment checks -- Anubhav <35621759+anubh-v@users.noreply.github.com> -- Matthew Beckers <17108752+mattlbeck@users.noreply.github.com> (mattlbeck) -- Yang Yang -- Andrew J. Simmons (anjsimmo) -- Damien Baty -- Daniel R. Neal (danrneal) -- Jeremy Fleischman (jfly) -- Shiv Venkatasubrahmanyam -- Jochen Preusche (iilei) -- Ram Rachum (cool-RR) -- Pieter Engelbrecht -- Ethan Leba -- Matěj Grabovský -- Yeting Li (yetingli) -- Frost Ming (frostming) -- Luigi Bertaco Cristofolini (luigibertaco) -- Eli Fine (eli88fine): Fixed false positive duplicate code warning for lines with symbols only -- Ganden Schaffner -- Josselin Feist -- David Cain -- Pedro Algarvio (s0undt3ch) -- Or Bahari -- Joshua Cannon -- Giuseppe Valente -- Joffrey Mander -- Julien Palard -- Raphael Gaschignard -- Sorin Sbarnea -- Gergely Kalmár -- Batuhan Taskaya -- Frank Harrison (doublethefish) -- Logan Miller <14319179+komodo472@users.noreply.github.com> (komodo472) -- Matthew Suozzo -- David Gilman -- Ikraduya Edian : Added new checks 'consider-using-generator' and 'use-a-generator'. -- Tiago Honorato <61059243+tiagohonorato@users.noreply.github.com> -- Lefteris Karapetsas -- Louis Sautier -- Quentin Young -- Alexander Kapshuna -- Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> -- Konstantina Saketou <56515303+ksaketou@users.noreply.github.com> -- Andrew Howe -- James Sinclair (irgeek) -- Aidan Haase <44787650+haasea@users.noreply.github.com> -- Elizabeth Bott <52465744+elizabethbott@users.noreply.github.com> -- Sebastian Müller -- Ramiro Leal-Cavazos (ramiro050): Fixed bug preventing pylint from working with emacs tramp -- Andrew Haigh (nelfin) -- Aditya Gupta (adityagupta1089) - * Added ignore_signatures to duplicate checker -- David Liu (david-yz-liu) -- Fabian Damken -- Markus Siebenhaar <41283549+siehar@users.noreply.github.com> -- Lorena Buciu <46202743+lorena-b@users.noreply.github.com> (lorena-b) -- Maksym Humetskyi (mhumetskyi) - * Fixed ignored empty functions by similarities checker with "ignore-signatures" option enabled - * Ignore function decorators signatures as well by similarities checker with "ignore-signatures" option enabled - * Ignore class methods and nested functions signatures as well by similarities checker with "ignore-signatures" option enabled -- Daniel Dorani (doranid) -- Will Shanks -- Mark Bell -- Rebecca Turner (9999years) -- Marcin Kurczewski (rr-) -- Tanvi Moharir <74228962+tanvimoharir@users.noreply.github.com>: Fix for invalid toml config -- Eisuke Kawashima (e-kwsm) -- Michal Vasilek -- Kai Mueller <15907922+kasium@users.noreply.github.com> (kasium) -- Sam Vermeiren <88253337+PaaEl@users.noreply.github.com> (PaaEl) -- Philipp Albrecht (pylbrecht) -- Melvin Hazeleger <31448155+melvio@users.noreply.github.com> (melvio) -- Hayden Richards <62866982+SupImDos@users.noreply.github.com> (SupImDos) - * Fixed "no-self-use" for async methods - * Fixed "docparams" extension for async functions and methods -- Jeroen Seegers (jeroenseegers) - * Fixed `toml` dependency issue -- Tim Martin -- Jaehoon Hwang (jaehoonhwang) -- Nick Pesce -- Youngsoo Sung -- Samuel Freilich (sfreilich) -- Mike Fiedler (miketheman) -- Takahide Nojima -- Tushar Sadhwani (tusharsadhwani) -- Antonio Quarta (sgheppy) -- Jérome Perrin (perrinjerome) -- Felix von Drigalski (felixvd) -- Jake Lishman (jakelishman) -- Allan Chandler <95424144+allanc65@users.noreply.github.com> (allanc65) - * Fixed issue 5452, false positive missing-param-doc for multi-line Google-style params -- Carli Freudenberg (CarliJoy) - * Fixed issue 5281, added Unicode checker - * Improve non-ascii-name checker -- Daniel Brookman <53625739+dbrookman@users.noreply.github.com> -- Téo Bouvard -- Konrad Weihmann <46938494+priv-kweihmann@users.noreply.github.com> -- Sergey B Kirpichev -- Joseph Young <80432516+jpy-git@users.noreply.github.com> (jpy-git) -- Adrien Di Mascio - Ville Skyttä +- Matus Valo - Pierre-Yves David +- David Shea : invalid sequence and slice index +- Derek Gustafson +- Cezar Elnazli : deprecated-method +- Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> - Nicolas Chauvat +- Radu Ciorba : not-context-manager and confusing-with-statement warnings. - Holger Peters +- Cosmin Poieană : unichr-builtin and improvements to bad-open-mode. +- Steven Myint : duplicate-except. +- Peter Kolbus (Garmin) +- Luigi Bertaco Cristofolini (luigibertaco) +- Glenn Matthews : + * autogenerated documentation for optional extensions, + * bug fixes and enhancements for docparams (née check_docs) extension +- Vlad Temian : redundant-unittest-assert and the JSON reporter. - Julien Jehannet +- Boris Feld - Anthony Sottile +- Pedro Algarvio (s0undt3ch) +- Julien Palard +- David Liu (david-yz-liu) +- Dan Goldsmith : support for msg-template in HTML reporter. +- Mariatta Wijaya + * Added new check `logging-fstring-interpolation` + * Documentation typo fixes - Jakub Wilk - Émile Crater - Pavel Roskin +- Eli Fine (eli88fine): Fixed false positive duplicate code warning for lines with symbols only +- David Gilman +- Andrew Haigh (nelfin) - へーさん +- Thomas Hisch +- Marianna Polatoglou : minor contribution for wildcard import check - Manuel Vázquez Acosta +- Luis Escobar (Vauxoo): Add bad-docstring-quotes and docstring-first-line-empty - Jim Robertson +- Ethan Leba +- Enji Cooper +- David Lindquist : logging-format-interpolation warning. +- Buck (Yelp) - Anthony Truchet +- Alexander Todorov : + * added new error conditions to 'bad-super-call', + * Added new check for incorrect len(SEQUENCE) usage, + * Added new extension for comparison against empty string constants, + * Added new extension which detects comparing integers to zero, + * Added new useless-return checker, + * Added new try-except-raise checker - orSolocate <38433858+orSolocate@users.noreply.github.com> -- Buck (Yelp) +- Téo Bouvard +- Tushar Sadhwani (tusharsadhwani) - Mihai Balint +- Mark Bell +- Konstantina Saketou <56515303+ksaketou@users.noreply.github.com> +- Hugo van Kemenade - David Douard +- Daniel Balparda (Google): GPyLint maintainer (Google's pylint variant) +- Bastien Vallet +- Aru Sahni : Git ignoring, regex-based ignores +- Andreas Freimuth : fix indentation checking with tabs - Alexandru Coman +- Takahide Nojima - Taewon D. Kim - Sneaky Pete - Rene Zhang +- Or Bahari - Mr. Senko +- Martin von Gagern (Google): Added 'raising-format-tuple' warning. +- Martin Vielsmaier +- Martin Pool (Google): + * warnings for anomalous backslashes + * symbolic names for messages (like 'unused') + * etc. +- Martin Bašti + * Added new check for shallow copy of os.environ + * Added new check for useless `with threading.Lock():` statement +- Marcus Näslund (naslundx) - Marco Forte - Ionel Maries Cristian +- Gergely Kalmár - Daniel Harding +- Damien Baty +- Benjamin Drung : contributing Debian Developer +- Anubhav <35621759+anubh-v@users.noreply.github.com> +- Antonio Quarta (sgheppy) +- Andrew J. Simmons (anjsimmo) - wtracy - jpkotta - chohner +- Tim Martin +- Tiago Honorato <61059243+tiagohonorato@users.noreply.github.com> - Steven M. Vascellaro +- Roberto Leinardi : PyCharm plugin maintainer - Ricardo Gemignani +- Pieter Engelbrecht +- Philipp Albrecht (pylbrecht) +- Nicolas Dickreuter - Nick Bastin +- Nathaniel Manista : suspicious lambda checking +- Mike Frysinger +- Maksym Humetskyi (mhumetskyi) + * Fixed ignored empty functions by similarities checker with "ignore-signatures" option enabled + * Ignore function decorators signatures as well by similarities checker with "ignore-signatures" option enabled + * Ignore class methods and nested functions signatures as well by similarities checker with "ignore-signatures" option enabled +- Lucas Cimon - Kylian +- Konstantin Manna +- Kai Mueller <15907922+kasium@users.noreply.github.com> (kasium) +- Joshua Cannon - John Leach +- James Morgensen : ignored-modules option applies to import errors. +- Jaehoon Hwang (jaehoonhwang) +- Ganden Schaffner +- Frost Ming (frostming) +- Federico Bond - Erik Wright +- Erik Eriksson : Added overlapping-except error check. - Dan Hemberger <846186+hemberger@users.noreply.github.com> +- Chris Rebert : unidiomatic-typecheck. - Aurelien Campeas - Alexander Pervakov - Alain Leufroy @@ -351,27 +218,61 @@ contributors: - craig-sh - bernie gray - Yilei "Dolee" Yang +- Wes Turner (Google): added new check 'inconsistent-quotes' - Tyler Thieding +- Tobias Hernstig <30827238+thernstig@users.noreply.github.com> - Thomas Grainger - Simu Toni +- Sergey B Kirpichev +- Sergei Lebedev <185856+superbobry@users.noreply.github.com> (superbobry) +- Scott Worley +- Rémi Cardona +- Raphael Gaschignard +- Ram Rachum (cool-RR) - Radostin Stoyanov - Paul Renvoisé - PHeanEX - Omega Weapon - Nikolai Kristiansen +- Nick Pesce +- Nathan Marrow +- Mikhail Fesenko +- Matthew Suozzo +- Matthew Beckers <17108752+mattlbeck@users.noreply.github.com> (mattlbeck) +- Mike Miller +- Mads Kiilerich +- Maarten ter Huurne +- Lefteris Karapetsas - LCD 47 +- Justin Li (justinnhli) +- Joseph Young <80432516+jpy-git@users.noreply.github.com> (jpy-git) - John Kirkham - Jens H. Nielsen +- Ioana Tagirta : fix bad thread instantiation check +- Ikraduya Edian : Added new checks 'consider-using-generator' and 'use-a-generator'. +- Hugues Bruant - Harut - Grygorii Iermolenko +- Gabriel R. Sezefredo : Fixed "exception-escape" false positive with generators - Filipe Brandenburger +- Fantix King (UChicago) +- Elias Dorneles : minor adjust to config defaults and docs - Derek Harland - David Pursehouse +- Daniel Miller - Chris Murray - Chris Lamb - Charles Hebert +- Carli Freudenberg (CarliJoy) + * Fixed issue 5281, added Unicode checker + * Improve non-ascii-name checker - Buck Golemon +- Brian Shaginaw : prevent error on exception check for functions - Benny Mueller +- Ben James +- Ben Green +- Batuhan Taskaya +- Alexander Kapshuna - Adam Parkin - 谭九鼎 <109224573@qq.com> - Łukasz Sznuk @@ -406,85 +307,171 @@ contributors: - amdev@AMDEV-WS01.cisco.com - agutole - Zeckie <49095968+Zeckie@users.noreply.github.com> +- Zeb Nicholls + * Made W9011 compatible with 'of' syntax in return types - Yuval Langer - Yury Gribov +- Yuri Bochkarev : Added epytext support to docparams extension. +- Youngsoo Sung - Yoichi Nakayama +- Yeting Li (yetingli) - Yannack - Yann Dirson +- Yang Yang - Xi Shen +- Will Shanks +- Viorel Știrbu : intern-builtin warning. - Victor Jiajunsu <16359131+jiajunsu@users.noreply.github.com> +- Trevor Bekolay + * Added --list-msgs-enabled command +- Tomer Chachamu : simplifiable-if-expression - Tomasz Magulski - Tim Hatch +- Tim Gates +- Tanvi Moharir <74228962+tanvimoharir@users.noreply.github.com>: Fix for invalid toml config - T.Rzepka +- Svetoslav Neykov +- Stéphane Wirtel : nonlocal-without-binding - Stephen Longofono <8992396+SLongofono@users.noreply.github.com> - Stanislav Levin +- Sorin Sbarnea - Skip Montanaro +- Shiv Venkatasubrahmanyam +- Sebastian Müller +- Sardorbek Imomaliev - Santiago Castro +- Sandro Tosi : Debian packaging +- Samuel Freilich (sfreilich) - Samuel FORESTIER +- Sam Vermeiren <88253337+PaaEl@users.noreply.github.com> (PaaEl) - Ryan McGuire - Ry4an Brase - Ruro - Roman Ivanov - Robin Tweedie <70587124+robin-wayve@users.noreply.github.com> +- Robert Schweizer +- Reverb Chu +- Renat Galimov +- Rebecca Turner (9999years) - Randall Leeds +- Ramiro Leal-Cavazos (ramiro050): Fixed bug preventing pylint from working with emacs tramp - Qwiddle13 <32040075+Qwiddle13@users.noreply.github.com> +- Quentin Young +- Petr Pulc : require whitespace around annotations +- Peter Hammond - Peter Dawyndt - Peter Bittner - Peter Aronoff - Paul Cochrane - Patrik +- Pascal Corpet +- Pablo Galindo Salgado + * Fix false positive 'Non-iterable value' with async comprehensions. - Oisín Moran - Obscuron - Noam Yorav-Raphael - Nir Soffer +- Niko Wenselowski - Nikita Sobolev - Nick Smith - Ned Batchelder +- Natalie Serebryakova +- Mitchell Young : minor adjustment to docparams - Mitar +- Mike Fiedler (miketheman) - Mike Bryant - Michka Popoff +- Michal Vasilek +- Michael Scott Cuthbert - Michael Kefeder +- Michael Hudson-Doyle - Michael Giuffrida +- Melvin Hazeleger <31448155+melvio@users.noreply.github.com> (melvio) +- Matěj Grabovský +- Matthijs Blom <19817960+MatthijsBlom@users.noreply.github.com> - Matej Marušák +- Markus Siebenhaar <41283549+siehar@users.noreply.github.com> - Marco Edward Gorelli +- Marcin Kurczewski (rr-) - Maik Röder +- Louis Sautier +- Lorena Buciu <46202743+lorena-b@users.noreply.github.com> (lorena-b) +- Logan Miller <14319179+komodo472@users.noreply.github.com> (komodo472) - Kári Tristan Helgason +- Kurian Benoy <70306694+kurianbenoy-aot@users.noreply.github.com> - Krzysztof Czapla - Kraig Brockschmidt - Kound +- Kosarchuk Sergey +- Konrad Weihmann <46938494+priv-kweihmann@users.noreply.github.com> - Kian Meng, Ang - Kevin Phillips - Kevin Jing Qiu - Kayran Schmidt <59456929+yumasheta@users.noreply.github.com> - Jürgen Hermann +- Jérome Perrin (perrinjerome) +- Josselin Feist - Jonathan Kotta +- John Paraskevopoulos : add 'differing-param-doc' and 'differing-type-doc' - John McGehee - John Gabriele - John Belmonte +- Joffrey Mander +- Jochen Preusche (iilei) +- Jeroen Seegers (jeroenseegers) + * Fixed `toml` dependency issue +- Jeremy Fleischman (jfly) +- Jason Owen - Jared Garst - Jared Deckard +- Janne Rönkkö +- James Sinclair (irgeek) - James M. Allen - James Lingard - James Broadhead - Jakob Normark +- Jake Lishman (jakelishman) +- Jacques Kvam +- Jace Browning : updated default report format with clickable paths - JT Olds +- Hayden Richards <62866982+SupImDos@users.noreply.github.com> (SupImDos) + * Fixed "no-self-use" for async methods + * Fixed "docparams" extension for async functions and methods - Grant Welch +- Giuseppe Valente +- Gary Tyler McLeod +- Felix von Drigalski (felixvd) - Fabrice Douchant - Fabio Natali +- Fabian Damken +- Eric Froemling - Emmanuel Chaudron +- Elizabeth Bott <52465744+elizabethbott@users.noreply.github.com> +- Eisuke Kawashima (e-kwsm) - Edgemaster +- Drew Risinger - Dr. Nick - Don Jayamanne - Dmytro Kyrychuk - Denis Laxalde +- David Cain +- Danny Hermes - Daniele Procida - Daniela Plascencia +- Daniel R. Neal (danrneal) +- Daniel Draper +- Daniel Dorani (doranid) +- Daniel Brookman <53625739+dbrookman@users.noreply.github.com> - Dan Garrette - Damien Nozay - Craig Citro +- Clément Pit-Claudel - Christopher Zurcher +- Carl Crowder : don't evaluate the value of arguments for 'dangerous-default-value' +- Carey Metcalfe : demoted `try-except-raise` from error to warning - Cameron Olechowski - Calin Don +- Caio Carrara - C.A.M. Gerlach - Bruno P. Kinoshita - Brian C. Lane @@ -493,18 +480,31 @@ contributors: - Benjamin Graham - Benedikt Morbach - Banjamin Freeman +- Athos Ribeiro : Fixed dict-keys-not-iterating false positive for inverse containment checks - Arun Persaud - Arthur Lutz - Antonio Ossa - Anthony VEREZ +- Anthony Foglia (Google): Added simple string slots check. - Anentropic +- Andy Palmer <25123779+ninezerozeronine@users.noreply.github.com> +- Andrzej Klajnert +- Andrew Howe - Andres Perez Hortal - Alok Singh <8325708+alok@users.noreply.github.com> +- Allan Chandler <95424144+allanc65@users.noreply.github.com> (allanc65) + * Fixed issue 5452, false positive missing-param-doc for multi-line Google-style params - Alex Jurkiewicz - Alex Hearn - Alan Evangelista +- Alan Chan +- Aivar Annamaa +- Aidan Haase <44787650+haasea@users.noreply.github.com> +- Ahirnish Pareek : 'keyword-arg-before-var-arg' check - Adrian Chirieac - +- Aditya Gupta (adityagupta1089) + * Added ignore_signatures to duplicate checker +- Adam Dangoor Co-Author --------- From 80838744c6f739fbf2f49bd1bfb70c98a84531aa Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Wed, 23 Mar 2022 17:56:09 +0100 Subject: [PATCH 079/473] Cleanup after finding emails and duplicates --- CONTRIBUTORS.txt | 48 +++++++++---------------------- script/.contributors_aliases.json | 6 +++- 2 files changed, 18 insertions(+), 36 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 67a7e5d9bf..9a86723b36 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -99,7 +99,7 @@ contributors: - Cosmin Poieană : unichr-builtin and improvements to bad-open-mode. - Steven Myint : duplicate-except. - Peter Kolbus (Garmin) -- Luigi Bertaco Cristofolini (luigibertaco) +- Luigi Bertaco Cristofolini (luigibertaco) - Glenn Matthews : * autogenerated documentation for optional extensions, * bug fixes and enhancements for docparams (née check_docs) extension @@ -145,9 +145,11 @@ contributors: - Mark Bell - Konstantina Saketou <56515303+ksaketou@users.noreply.github.com> - Hugo van Kemenade +- Hornwitser : fix import graph +- Fureigh - David Douard - Daniel Balparda (Google): GPyLint maintainer (Google's pylint variant) -- Bastien Vallet +- Bastien Vallet (Djailla) - Aru Sahni : Git ignoring, regex-based ignores - Andreas Freimuth : fix indentation checking with tabs - Alexandru Coman @@ -239,7 +241,7 @@ contributors: - Mikhail Fesenko - Matthew Suozzo - Matthew Beckers <17108752+mattlbeck@users.noreply.github.com> (mattlbeck) -- Mike Miller +- Mark Roman Miller : fix inline defs in too-many-statements - Mads Kiilerich - Maarten ter Huurne - Lefteris Karapetsas @@ -282,7 +284,6 @@ contributors: - thinwybk - syutbai - sdet_liang -- sbagan - pyves@crater.logilab.fr - paschich - oittaa <8972248+oittaa@users.noreply.github.com> @@ -290,6 +291,7 @@ contributors: - mar-chi-pan - ludal@logilab.fr - lrjball <50599110+lrjball@users.noreply.github.com> +- laike9m - jpkotta@shannon - jaydesl <35102795+jaydesl@users.noreply.github.com> - jab @@ -313,6 +315,7 @@ contributors: - Yury Gribov - Yuri Bochkarev : Added epytext support to docparams extension. - Youngsoo Sung +- Yory <39745367+yory8@users.noreply.github.com> (yory8) - Yoichi Nakayama - Yeting Li (yetingli) - Yannack @@ -335,9 +338,11 @@ contributors: - Stephen Longofono <8992396+SLongofono@users.noreply.github.com> - Stanislav Levin - Sorin Sbarnea +- Slavfox - Skip Montanaro - Shiv Venkatasubrahmanyam - Sebastian Müller +- Sasha Bagan - Sardorbek Imomaliev - Santiago Castro - Sandro Tosi : Debian packaging @@ -358,7 +363,6 @@ contributors: - Qwiddle13 <32040075+Qwiddle13@users.noreply.github.com> - Quentin Young - Petr Pulc : require whitespace around annotations -- Peter Hammond - Peter Dawyndt - Peter Bittner - Peter Aronoff @@ -391,11 +395,11 @@ contributors: - Matthijs Blom <19817960+MatthijsBlom@users.noreply.github.com> - Matej Marušák - Markus Siebenhaar <41283549+siehar@users.noreply.github.com> -- Marco Edward Gorelli +- Marco Edward Gorelli : Documented Jupyter integration - Marcin Kurczewski (rr-) - Maik Röder - Louis Sautier -- Lorena Buciu <46202743+lorena-b@users.noreply.github.com> (lorena-b) +- Lorena Buciu <46202743+lorena-b@users.noreply.github.com> (lorena-b) - Logan Miller <14319179+komodo472@users.noreply.github.com> (komodo472) - Kári Tristan Helgason - Kurian Benoy <70306694+kurianbenoy-aot@users.noreply.github.com> @@ -437,6 +441,7 @@ contributors: - Hayden Richards <62866982+SupImDos@users.noreply.github.com> (SupImDos) * Fixed "no-self-use" for async methods * Fixed "docparams" extension for async functions and methods +- Harshil <37377066+harshil21@users.noreply.github.com> (harshil21) - Grant Welch - Giuseppe Valente - Gary Tyler McLeod @@ -485,6 +490,7 @@ contributors: - Arthur Lutz - Antonio Ossa - Anthony VEREZ +- Anthony Tan - Anthony Foglia (Google): Added simple string slots check. - Anentropic - Andy Palmer <25123779+ninezerozeronine@users.noreply.github.com> @@ -515,55 +521,27 @@ under this name, or we did not manage to find their commits in the history. - Amaury Forgeot d'Arc: check names imported from a module exists in the module - Anthony Tan - Axel Muller -- Ben Graham -- Benjamin Freeman - Benjamin Niemann: allow block level enabling/disabling of messages -- Benny Müller - Bernard Nauwelaerts -- Bernie Gray - Bill Wendling -- Bluesheeptoken - Brian van den Broek: windows installation documentation - Craig Henriques - D. Alphus (Alphadelta14) - Daniil Kharkov -- das-intensity - Eero Vuojolahti - Fabio Zadrozny -- Fureigh - Gauthier Sebaux -- Goudcode -- Harshil (harshil21) -- Hornwitser: fix import graph - James DesLauriers -- Jiajunsu (victor) -- Kian-Meng, Ang -- laike9m - manderj -- Marco Gorelli: Documented Jupyter integration -- Mark Roman Miller: fix inline defs in too-many-statements -- Matej Marusak - Mirko Friedenhagen - Nicholas Smith - Nuzula H. Yudaka (Nuzhuka) -- Oisin Moran -- Paul Renvoise - Pek Chhan - Peter Hammond - Pierre Rouleau -- qwiddle - Richard Goodman: simplifiable-if-expression (with Tomer Chachamu) -- ruro -- Samuel Forestier -- Sasha Bagan - Sebastian Ulrich -- Slavfox -- Taewon Kim - Takashi Hirashima - Thomas Snowden: fix missing-docstring for inner functions -- Tyler N. Thieding - Wolfgang Grafen - Yannick Brehon -- Yilei Yang -- Yory (yory8) -- Yuri Gribov diff --git a/script/.contributors_aliases.json b/script/.contributors_aliases.json index 9b77661efd..50f879ed06 100644 --- a/script/.contributors_aliases.json +++ b/script/.contributors_aliases.json @@ -472,6 +472,10 @@ "name": "Pierre Sassoulas", "team": "Maintainers" }, + "pnlbagan@gmail.com": { + "mails": ["pnlbagan@gmail.com"], + "name": "Sasha Bagan" + }, "raphael@makeleaps.com": { "mails": ["raphael@rtpg.co", "raphael@makeleaps.com"], "name": "Raphael Gaschignard" @@ -529,7 +533,7 @@ }, "tanant@users.noreply.github.com": { "mails": ["tanant@users.noreply.github.com"], - "name": "Anthony" + "name": "Anthony Tan" }, "thenault@gmail.com": { "mails": ["thenault@gmail.com", "sylvain.thenault@logilab.fr"], From 9e0baf370a15fecf3360996a6a2ead688fc61894 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sat, 12 Mar 2022 12:39:52 +0100 Subject: [PATCH 080/473] Simplify hard to maintain copyright notice git is the source of truth for the copyright, copyrite (the tool) was taking exponentially longer with each release, and it's polluting the code with sometime as much as 50 lines of names. --- doc/exts/pylint_extensions.py | 1 + doc/exts/pylint_features.py | 1 + doc/exts/pylint_messages.py | 1 + doc/release.md | 2 +- pylint/__init__.py | 9 +-- pylint/__main__.py | 1 + pylint/__pkginfo__.py | 1 + pylint/checkers/__init__.py | 19 +----- pylint/checkers/async.py | 8 +-- pylint/checkers/base.py | 68 +------------------ pylint/checkers/base_checker.py | 18 +---- pylint/checkers/classes/__init__.py | 1 + pylint/checkers/classes/class_checker.py | 49 +------------ .../classes/special_methods_checker.py | 1 + pylint/checkers/deprecated.py | 1 + pylint/checkers/design_analysis.py | 28 +------- pylint/checkers/exceptions.py | 33 +-------- pylint/checkers/format.py | 45 +----------- pylint/checkers/imports.py | 45 +----------- pylint/checkers/logging.py | 23 +------ pylint/checkers/mapreduce_checker.py | 5 +- pylint/checkers/misc.py | 24 +------ pylint/checkers/modified_iterating_checker.py | 1 + pylint/checkers/newstyle.py | 20 +----- pylint/checkers/non_ascii_names.py | 4 +- pylint/checkers/raw_metrics.py | 16 +---- pylint/checkers/refactoring/__init__.py | 35 +--------- .../implicit_booleaness_checker.py | 1 + pylint/checkers/refactoring/not_checker.py | 1 + .../refactoring/recommendation_checker.py | 1 + .../refactoring/refactoring_checker.py | 1 + pylint/checkers/similar.py | 27 +------- pylint/checkers/spelling.py | 28 +------- pylint/checkers/stdlib.py | 35 +--------- pylint/checkers/strings.py | 34 +--------- pylint/checkers/threading_checker.py | 1 + pylint/checkers/typecheck.py | 55 +-------------- pylint/checkers/unicode.py | 4 +- pylint/checkers/unsupported_version.py | 5 +- pylint/checkers/utils.py | 57 +--------------- pylint/checkers/variables.py | 54 +-------------- pylint/config/__init__.py | 34 +--------- pylint/config/config_initialization.py | 1 + pylint/config/configuration_mixin.py | 1 + pylint/config/find_default_config_files.py | 1 + pylint/config/man_help_formatter.py | 1 + pylint/config/option.py | 1 + pylint/config/option_manager_mixin.py | 1 + pylint/config/option_parser.py | 1 + pylint/config/options_provider_mixin.py | 1 + pylint/constants.py | 1 + pylint/epylint.py | 25 +------ pylint/exceptions.py | 12 +--- pylint/extensions/__init__.py | 1 + pylint/extensions/_check_docs_utils.py | 22 +----- pylint/extensions/bad_builtin.py | 10 +-- pylint/extensions/broad_try_clause.py | 9 +-- pylint/extensions/check_elif.py | 12 +--- pylint/extensions/comparetozero.py | 10 +-- pylint/extensions/comparison_placement.py | 1 + pylint/extensions/confusing_elif.py | 7 +- pylint/extensions/docparams.py | 24 +------ pylint/extensions/docstyle.py | 10 +-- pylint/extensions/emptystring.py | 10 +-- pylint/extensions/mccabe.py | 11 +-- pylint/extensions/overlapping_exceptions.py | 1 + pylint/extensions/redefined_variable_type.py | 11 +-- pylint/graph.py | 16 +---- pylint/interfaces.py | 17 +---- pylint/lint/__init__.py | 59 +--------------- pylint/lint/parallel.py | 1 + pylint/lint/pylinter.py | 1 + pylint/lint/report_functions.py | 1 + pylint/lint/run.py | 1 + pylint/lint/utils.py | 1 + pylint/message/__init__.py | 38 +---------- pylint/message/message.py | 1 + pylint/message/message_definition.py | 1 + pylint/message/message_definition_store.py | 1 + pylint/message/message_id_store.py | 1 + pylint/pyreverse/__init__.py | 1 + pylint/pyreverse/diadefslib.py | 19 +----- pylint/pyreverse/diagrams.py | 16 +---- pylint/pyreverse/dot_printer.py | 8 +-- pylint/pyreverse/inspector.py | 14 +--- pylint/pyreverse/main.py | 20 +----- pylint/pyreverse/mermaidjs_printer.py | 3 +- pylint/pyreverse/plantuml_printer.py | 3 +- pylint/pyreverse/printer.py | 7 +- pylint/pyreverse/printer_factory.py | 5 +- pylint/pyreverse/utils.py | 19 +----- pylint/pyreverse/vcg_printer.py | 13 +--- pylint/pyreverse/writer.py | 16 +---- pylint/reporters/__init__.py | 21 +----- pylint/reporters/base_reporter.py | 1 + pylint/reporters/collecting_reporter.py | 1 + pylint/reporters/json_reporter.py | 12 +--- pylint/reporters/multi_reporter.py | 1 + pylint/reporters/reports_handler_mix_in.py | 1 + pylint/reporters/text.py | 19 +----- pylint/reporters/ureports/__init__.py | 1 + pylint/reporters/ureports/base_writer.py | 11 +-- pylint/reporters/ureports/nodes.py | 11 +-- pylint/reporters/ureports/text_writer.py | 10 +-- pylint/testutils/__init__.py | 28 +------- pylint/testutils/checker_test_case.py | 1 + pylint/testutils/configuration_test.py | 1 + pylint/testutils/constants.py | 1 + pylint/testutils/decorator.py | 1 + pylint/testutils/functional/__init__.py | 1 + .../functional/find_functional_tests.py | 1 + .../functional/lint_module_output_update.py | 1 + pylint/testutils/functional/test_file.py | 1 + pylint/testutils/functional_test_file.py | 1 + pylint/testutils/get_test_info.py | 1 + pylint/testutils/global_test_linter.py | 1 + pylint/testutils/lint_module_test.py | 1 + pylint/testutils/output_line.py | 1 + pylint/testutils/pyreverse.py | 1 + pylint/testutils/reporter_for_tests.py | 1 + pylint/testutils/tokenize_str.py | 1 + pylint/testutils/unittest_linter.py | 1 + pylint/typing.py | 1 + pylint/utils/__init__.py | 40 +---------- pylint/utils/ast_walker.py | 1 + pylint/utils/docs.py | 1 + pylint/utils/file_state.py | 1 + pylint/utils/linterstats.py | 1 + pylint/utils/pragma_parser.py | 1 + pylint/utils/utils.py | 1 + tbump.toml | 4 -- tests/benchmark/test_baseline_benchmarks.py | 8 +-- tests/checkers/unittest_base.py | 25 +------ tests/checkers/unittest_base_checker.py | 1 + tests/checkers/unittest_design.py | 7 +- tests/checkers/unittest_format.py | 26 +------ tests/checkers/unittest_imports.py | 17 +---- tests/checkers/unittest_misc.py | 16 +---- tests/checkers/unittest_refactoring.py | 1 + tests/checkers/unittest_similar.py | 20 +----- tests/checkers/unittest_spelling.py | 18 +---- tests/checkers/unittest_stdlib.py | 11 +-- tests/checkers/unittest_strings.py | 11 +-- tests/checkers/unittest_typecheck.py | 25 +------ tests/checkers/unittest_utils.py | 18 +---- tests/checkers/unittest_variables.py | 20 +----- .../config/test_functional_config_loading.py | 1 + tests/config/unittest_config.py | 12 +--- tests/extensions/test_check_docs_utils.py | 12 +--- tests/input/similar_lines_a.py | 1 - tests/input/similar_lines_b.py | 1 - tests/lint/unittest_expand_modules.py | 1 + tests/lint/unittest_lint.py | 38 +---------- tests/message/conftest.py | 1 + .../test_no_removed_msgid_or_symbol_used.py | 1 + tests/message/unittest_message.py | 1 + tests/message/unittest_message_definition.py | 1 + .../unittest_message_definition_store.py | 1 + tests/message/unittest_message_id_store.py | 1 + tests/primer/test_primer_external.py | 1 + tests/primer/test_primer_stdlib.py | 1 + .../profile/test_profile_against_externals.py | 5 +- tests/pyreverse/test_diadefs.py | 21 +----- tests/pyreverse/test_diagrams.py | 5 +- tests/pyreverse/test_inspector.py | 13 +--- tests/pyreverse/test_printer.py | 5 +- tests/pyreverse/test_printer_factory.py | 3 +- tests/pyreverse/test_utils.py | 10 +-- tests/pyreverse/test_writer.py | 17 +---- tests/test_check_parallel.py | 11 +-- tests/test_func.py | 18 +---- tests/test_functional.py | 21 +----- tests/test_import_graph.py | 18 +---- tests/test_numversion.py | 1 + tests/test_regr.py | 17 +---- tests/test_self.py | 35 +--------- tests/testutils/test_decorator.py | 1 + tests/testutils/test_functional_testutils.py | 1 + .../test_lint_module_output_update.py | 1 + tests/testutils/test_output_line.py | 1 + tests/testutils/test_package_to_lint.py | 1 + tests/unittest_reporters_json.py | 13 +--- tests/unittest_reporting.py | 17 +---- tests/utils/unittest_ast_walker.py | 1 + tests/utils/unittest_utils.py | 19 +----- 185 files changed, 190 insertions(+), 1814 deletions(-) diff --git a/doc/exts/pylint_extensions.py b/doc/exts/pylint_extensions.py index d8f8dfeca5..921db904df 100755 --- a/doc/exts/pylint_extensions.py +++ b/doc/exts/pylint_extensions.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Script used to generate the extensions file before building the actual documentation.""" diff --git a/doc/exts/pylint_features.py b/doc/exts/pylint_features.py index a867dd05fe..b4e5e2df2f 100755 --- a/doc/exts/pylint_features.py +++ b/doc/exts/pylint_features.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Script used to generate the features file before building the actual documentation.""" diff --git a/doc/exts/pylint_messages.py b/doc/exts/pylint_messages.py index 0f9ac35de9..51b10482f0 100644 --- a/doc/exts/pylint_messages.py +++ b/doc/exts/pylint_messages.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Script used to generate the messages files.""" diff --git a/doc/release.md b/doc/release.md index e2196859e4..22194cd9b7 100644 --- a/doc/release.md +++ b/doc/release.md @@ -12,7 +12,7 @@ So, you want to release the `X.Y.Z` version of pylint ? 5. Move back to a dev version for pylint with `tbump`: ```bash -tbump X.Y.Z+1-dev0 --no-tag --no-push # You can interrupt during copyrite +tbump X.Y.Z+1-dev0 --no-tag --no-push # You can interrupt after the first step git commit -am "Move back to a dev version following X.Y.Z release" ``` diff --git a/pylint/__init__.py b/pylint/__init__.py index 02df46054e..cb5468eb5a 100644 --- a/pylint/__init__.py +++ b/pylint/__init__.py @@ -1,13 +1,6 @@ -# Copyright (c) 2008, 2012 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2014, 2016-2020 Claudiu Popa -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2018 Nick Drozd -# Copyright (c) 2020-2021 Pierre Sassoulas -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import os import sys diff --git a/pylint/__main__.py b/pylint/__main__.py index 278570f619..267adb9eb0 100644 --- a/pylint/__main__.py +++ b/pylint/__main__.py @@ -2,6 +2,7 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import pylint diff --git a/pylint/__pkginfo__.py b/pylint/__pkginfo__.py index 9e0f1edaa2..24bc31e99c 100644 --- a/pylint/__pkginfo__.py +++ b/pylint/__pkginfo__.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from typing import Tuple __version__ = "2.13.0-dev0" diff --git a/pylint/checkers/__init__.py b/pylint/checkers/__init__.py index 61ce67ffef..1f7f8fd38d 100644 --- a/pylint/checkers/__init__.py +++ b/pylint/checkers/__init__.py @@ -1,23 +1,6 @@ -# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2013-2014 Google, Inc. -# Copyright (c) 2013 buck@yelp.com -# Copyright (c) 2014-2018, 2020 Claudiu Popa -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Moises Lopez -# Copyright (c) 2017-2018 Bryce Guinta -# Copyright (c) 2018-2021 Pierre Sassoulas -# Copyright (c) 2018 ssolanki -# Copyright (c) 2019 Bruno P. Kinoshita -# Copyright (c) 2020-2021 hippo91 -# Copyright (c) 2020 Frank Harrison -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Matus Valo - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Utilities methods and classes for checkers. diff --git a/pylint/checkers/async.py b/pylint/checkers/async.py index 4a5c6abf25..58fe8a5d8f 100644 --- a/pylint/checkers/async.py +++ b/pylint/checkers/async.py @@ -1,12 +1,6 @@ -# Copyright (c) 2015-2018, 2020 Claudiu Popa -# Copyright (c) 2017 Derek Gustafson -# Copyright (c) 2019, 2021 Pierre Sassoulas -# Copyright (c) 2020 hippo91 -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Checker for anything related to the async protocol (PEP 492).""" diff --git a/pylint/checkers/base.py b/pylint/checkers/base.py index faacee9984..7f2d9da7b3 100644 --- a/pylint/checkers/base.py +++ b/pylint/checkers/base.py @@ -1,72 +1,6 @@ -# Copyright (c) 2006-2016 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2010 Daniel Harding -# Copyright (c) 2012-2014 Google, Inc. -# Copyright (c) 2013-2020 Claudiu Popa -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Nick Bastin -# Copyright (c) 2015 Michael Kefeder -# Copyright (c) 2015 Dmitry Pribysh -# Copyright (c) 2015 Stephane Wirtel -# Copyright (c) 2015 Cosmin Poieana -# Copyright (c) 2015 Florian Bruhin -# Copyright (c) 2015 Radu Ciorba -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016, 2019 Ashley Whetter -# Copyright (c) 2016, 2018 Jakub Wilk -# Copyright (c) 2016-2017 Łukasz Rogalski -# Copyright (c) 2016 Glenn Matthews -# Copyright (c) 2016 Elias Dorneles -# Copyright (c) 2016 Yannack -# Copyright (c) 2016 Alex Jurkiewicz -# Copyright (c) 2017, 2019-2021 Pierre Sassoulas -# Copyright (c) 2017, 2019-2021 hippo91 -# Copyright (c) 2017 danields -# Copyright (c) 2017 Jacques Kvam -# Copyright (c) 2017 ttenhoeve-aa -# Copyright (c) 2018-2019, 2021 Nick Drozd -# Copyright (c) 2018-2019, 2021 Ville Skyttä -# Copyright (c) 2018 Sergei Lebedev <185856+superbobry@users.noreply.github.com> -# Copyright (c) 2018 Lucas Cimon -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Natalie Serebryakova -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 SergeyKosarchuk -# Copyright (c) 2018 Steven M. Vascellaro -# Copyright (c) 2018 Mike Frysinger -# Copyright (c) 2018 Chris Lamb -# Copyright (c) 2018 glmdgrielson <32415403+glmdgrielson@users.noreply.github.com> -# Copyright (c) 2019 Daniel Draper -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2019 Niko Wenselowski -# Copyright (c) 2019 Nikita Sobolev -# Copyright (c) 2019 Oisín Moran -# Copyright (c) 2019 Fantix King -# Copyright (c) 2020 Peter Kolbus -# Copyright (c) 2020 ethan-leba -# Copyright (c) 2020 へーさん -# Copyright (c) 2020 Damien Baty -# Copyright (c) 2020 Ram Rachum -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2020 bernie gray -# Copyright (c) 2020 Gabriel R Sezefredo -# Copyright (c) 2020 Benny -# Copyright (c) 2020 Anubhav <35621759+anubh-v@users.noreply.github.com> -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Tushar Sadhwani -# Copyright (c) 2021 Tim Martin -# Copyright (c) 2021 Jaehoon Hwang -# Copyright (c) 2021 jaydesl <35102795+jaydesl@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 bot -# Copyright (c) 2021 Yilei "Dolee" Yang -# Copyright (c) 2021 Lorena B <46202743+lorena-b@users.noreply.github.com> -# Copyright (c) 2021 David Liu -# Copyright (c) 2021 Andreas Finkler -# Copyright (c) 2021-2022 Or Bahari - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Basic checker for Python code.""" import collections diff --git a/pylint/checkers/base_checker.py b/pylint/checkers/base_checker.py index 376e785450..e0e3c03f30 100644 --- a/pylint/checkers/base_checker.py +++ b/pylint/checkers/base_checker.py @@ -1,22 +1,6 @@ -# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2013-2014 Google, Inc. -# Copyright (c) 2013 buck@yelp.com -# Copyright (c) 2014-2020 Claudiu Popa -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Moises Lopez -# Copyright (c) 2017-2018 Bryce Guinta -# Copyright (c) 2018-2021 Pierre Sassoulas -# Copyright (c) 2018 ssolanki -# Copyright (c) 2019 Bruno P. Kinoshita -# Copyright (c) 2020 hippo91 -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 bot -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import functools from inspect import cleandoc from typing import Any, Optional diff --git a/pylint/checkers/classes/__init__.py b/pylint/checkers/classes/__init__.py index 2b0e595e64..ac1641fdf4 100644 --- a/pylint/checkers/classes/__init__.py +++ b/pylint/checkers/classes/__init__.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from typing import TYPE_CHECKING diff --git a/pylint/checkers/classes/class_checker.py b/pylint/checkers/classes/class_checker.py index ab954f2e83..42fc83ea70 100644 --- a/pylint/checkers/classes/class_checker.py +++ b/pylint/checkers/classes/class_checker.py @@ -1,53 +1,6 @@ -# Copyright (c) 2006-2016 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2010 Maarten ter Huurne -# Copyright (c) 2012-2014 Google, Inc. -# Copyright (c) 2012 FELD Boris -# Copyright (c) 2013-2020 Claudiu Popa -# Copyright (c) 2014 Michal Nowikowski -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2014 David Pursehouse -# Copyright (c) 2015 Dmitry Pribysh -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016-2017 Łukasz Rogalski -# Copyright (c) 2016 Alexander Todorov -# Copyright (c) 2016 Anthony Foglia -# Copyright (c) 2016 Florian Bruhin -# Copyright (c) 2016 Moises Lopez -# Copyright (c) 2016 Jakub Wilk -# Copyright (c) 2017, 2019-2020 hippo91 -# Copyright (c) 2018, 2021 Ville Skyttä -# Copyright (c) 2018, 2020 Anthony Sottile -# Copyright (c) 2018-2019 Nick Drozd -# Copyright (c) 2018-2019 Ashley Whetter -# Copyright (c) 2018 Lucas Cimon -# Copyright (c) 2018 Bryce Guinta -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Ben Green -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 mattlbeck <17108752+mattlbeck@users.noreply.github.com> -# Copyright (c) 2019-2020 craig-sh -# Copyright (c) 2019 Janne Rönkkö -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2019 Grygorii Iermolenko -# Copyright (c) 2019 Andrzej Klajnert -# Copyright (c) 2019 Pascal Corpet -# Copyright (c) 2020 GergelyKalmar -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> -# Copyright (c) 2021 Samuel Freilich -# Copyright (c) 2021 Nick Pesce -# Copyright (c) 2021 bot -# Copyright (c) 2021 Yu Shao, Pang <36848472+yushao2@users.noreply.github.com> -# Copyright (c) 2021 SupImDos <62866982+SupImDos@users.noreply.github.com> -# Copyright (c) 2021 Kayran Schmidt <59456929+yumasheta@users.noreply.github.com> -# Copyright (c) 2021 Konstantina Saketou <56515303+ksaketou@users.noreply.github.com> -# Copyright (c) 2021 James Sinclair -# Copyright (c) 2021 tiagohonorato <61059243+tiagohonorato@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Classes checker for Python code.""" import collections diff --git a/pylint/checkers/classes/special_methods_checker.py b/pylint/checkers/classes/special_methods_checker.py index d3d2b0935e..e85150f082 100644 --- a/pylint/checkers/classes/special_methods_checker.py +++ b/pylint/checkers/classes/special_methods_checker.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Special methods checker and helper function's module.""" diff --git a/pylint/checkers/deprecated.py b/pylint/checkers/deprecated.py index dd75547b95..0edbac4a98 100644 --- a/pylint/checkers/deprecated.py +++ b/pylint/checkers/deprecated.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Checker mixin for deprecated functionality.""" from itertools import chain diff --git a/pylint/checkers/design_analysis.py b/pylint/checkers/design_analysis.py index d2ad84539e..ad600fc2fd 100644 --- a/pylint/checkers/design_analysis.py +++ b/pylint/checkers/design_analysis.py @@ -1,32 +1,6 @@ -# Copyright (c) 2006, 2009-2010, 2012-2015 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2012, 2014 Google, Inc. -# Copyright (c) 2014-2020 Claudiu Popa -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Łukasz Rogalski -# Copyright (c) 2017 ahirnish -# Copyright (c) 2018 Lucas Cimon -# Copyright (c) 2018 Mike Frysinger -# Copyright (c) 2018 Mark Miller <725mrm@gmail.com> -# Copyright (c) 2018 Ashley Whetter -# Copyright (c) 2018 Ville Skyttä -# Copyright (c) 2018 Jakub Wilk -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Michael Scott Cuthbert -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Mike Fiedler -# Copyright (c) 2021 Youngsoo Sung -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 bot -# Copyright (c) 2021 Andrew Haigh -# Copyright (c) 2021 Melvin <31448155+melvio@users.noreply.github.com> -# Copyright (c) 2021 Rebecca Turner -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Yu Shao, Pang <36848472+yushao2@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Check for signs of poor design.""" diff --git a/pylint/checkers/exceptions.py b/pylint/checkers/exceptions.py index 58d273ca2e..1020e7c183 100644 --- a/pylint/checkers/exceptions.py +++ b/pylint/checkers/exceptions.py @@ -1,37 +1,6 @@ -# Copyright (c) 2006-2011, 2013-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2011-2014 Google, Inc. -# Copyright (c) 2012 Tim Hatch -# Copyright (c) 2013-2020 Claudiu Popa -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Rene Zhang -# Copyright (c) 2015 Florian Bruhin -# Copyright (c) 2015 Steven Myint -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Erik -# Copyright (c) 2016 Jakub Wilk -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2017 Martin von Gagern -# Copyright (c) 2018 Lucas Cimon -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Natalie Serebryakova -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Carey Metcalfe -# Copyright (c) 2018 Mike Frysinger -# Copyright (c) 2018 Alexander Todorov -# Copyright (c) 2018 Ville Skyttä -# Copyright (c) 2019, 2021 Pierre Sassoulas -# Copyright (c) 2019 Djailla -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Ram Rachum -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Nick Drozd -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Checks for various exception related errors.""" import builtins diff --git a/pylint/checkers/format.py b/pylint/checkers/format.py index 716dce4cba..9f125b5681 100644 --- a/pylint/checkers/format.py +++ b/pylint/checkers/format.py @@ -1,49 +1,6 @@ -# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2012-2015 Google, Inc. -# Copyright (c) 2013 moxian -# Copyright (c) 2014-2020 Claudiu Popa -# Copyright (c) 2014 frost-nzcr4 -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Michal Nowikowski -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Mike Frysinger -# Copyright (c) 2015 Fabio Natali -# Copyright (c) 2015 Harut -# Copyright (c) 2015 Mihai Balint -# Copyright (c) 2015 Pavel Roskin -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Petr Pulc -# Copyright (c) 2016 Moises Lopez -# Copyright (c) 2016 Ashley Whetter -# Copyright (c) 2017, 2019-2020 hippo91 -# Copyright (c) 2017-2018 Bryce Guinta -# Copyright (c) 2017 Krzysztof Czapla -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2017 James M. Allen -# Copyright (c) 2017 vinnyrose -# Copyright (c) 2018-2021 Pierre Sassoulas -# Copyright (c) 2018, 2020 Bryce Guinta -# Copyright (c) 2018, 2020 Anthony Sottile -# Copyright (c) 2018 Lucas Cimon -# Copyright (c) 2018 Michael Hudson-Doyle -# Copyright (c) 2018 Natalie Serebryakova -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Marcus Näslund -# Copyright (c) 2018 Mike Frysinger -# Copyright (c) 2018 Fureigh -# Copyright (c) 2018 Andreas Freimuth -# Copyright (c) 2018 Jakub Wilk -# Copyright (c) 2019 Nick Drozd -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2020 Raphael Gaschignard -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Tushar Sadhwani -# Copyright (c) 2021 bot -# Copyright (c) 2021 Ville Skyttä -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Python code format's checker. diff --git a/pylint/checkers/imports.py b/pylint/checkers/imports.py index f9422f9b32..4e8f64ccf0 100644 --- a/pylint/checkers/imports.py +++ b/pylint/checkers/imports.py @@ -1,49 +1,6 @@ -# Copyright (c) 2006-2015 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2012-2014 Google, Inc. -# Copyright (c) 2013 buck@yelp.com -# Copyright (c) 2014-2020 Claudiu Popa -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015-2016 Moises Lopez -# Copyright (c) 2015 Dmitry Pribysh -# Copyright (c) 2015 Cezar -# Copyright (c) 2015 Florian Bruhin -# Copyright (c) 2015 Noam Yorav-Raphael -# Copyright (c) 2015 James Morgensen -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016, 2021 Ashley Whetter -# Copyright (c) 2016 Jared Garst -# Copyright (c) 2016 Maik Röder -# Copyright (c) 2016 Glenn Matthews -# Copyright (c) 2017, 2020 hippo91 -# Copyright (c) 2017 Michka Popoff -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2017 Erik Wright -# Copyright (c) 2018 Lucas Cimon -# Copyright (c) 2018 Hornwitser -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Natalie Serebryakova -# Copyright (c) 2018 Mike Frysinger -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Marianna Polatoglou -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019, 2021 Nick Drozd -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2019 Nick Smith -# Copyright (c) 2019 Paul Renvoisé -# Copyright (c) 2020 Peter Kolbus -# Copyright (c) 2020 Damien Baty -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Tushar Sadhwani -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Will Shanks -# Copyright (c) 2021 Matus Valo -# Copyright (c) 2021 Yu Shao, Pang <36848472+yushao2@users.noreply.github.com> -# Copyright (c) 2021 Andrew Howe - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Imports checkers for Python code.""" diff --git a/pylint/checkers/logging.py b/pylint/checkers/logging.py index aedaf62415..084aeebeec 100644 --- a/pylint/checkers/logging.py +++ b/pylint/checkers/logging.py @@ -1,27 +1,6 @@ -# Copyright (c) 2009-2011, 2013-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2009, 2012, 2014 Google, Inc. -# Copyright (c) 2012 Mike Bryant -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015-2020 Claudiu Popa -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016, 2019-2020 Ashley Whetter -# Copyright (c) 2016 Chris Murray -# Copyright (c) 2017 guillaume2 -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2018 Alan Chan -# Copyright (c) 2018 Yury Gribov -# Copyright (c) 2018 Mike Frysinger -# Copyright (c) 2018 Mariatta Wijaya -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Djailla -# Copyright (c) 2019 Svet -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Nick Drozd -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Checker for use of Python logging.""" import string diff --git a/pylint/checkers/mapreduce_checker.py b/pylint/checkers/mapreduce_checker.py index a4a2c605c4..3078b6872e 100644 --- a/pylint/checkers/mapreduce_checker.py +++ b/pylint/checkers/mapreduce_checker.py @@ -1,9 +1,6 @@ -# Copyright (c) 2020 Frank Harrison -# Copyright (c) 2021 Pierre Sassoulas -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import abc diff --git a/pylint/checkers/misc.py b/pylint/checkers/misc.py index 6461975ae4..c558e28851 100644 --- a/pylint/checkers/misc.py +++ b/pylint/checkers/misc.py @@ -1,28 +1,6 @@ -# Copyright (c) 2006, 2009-2013 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2012-2014 Google, Inc. -# Copyright (c) 2014-2020 Claudiu Popa -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Alexandru Coman -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Łukasz Rogalski -# Copyright (c) 2016 glegoux -# Copyright (c) 2017-2020 hippo91 -# Copyright (c) 2017 Mikhail Fesenko -# Copyright (c) 2018 Rogalski, Lukasz -# Copyright (c) 2018 Lucas Cimon -# Copyright (c) 2018 Ville Skyttä -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2020 wtracy -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2020 Benny -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Nick Drozd -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Konstantina Saketou <56515303+ksaketou@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Check source code is ascii only or has an encoding declaration (PEP 263).""" diff --git a/pylint/checkers/modified_iterating_checker.py b/pylint/checkers/modified_iterating_checker.py index 711d37bb0e..b3e5daeae8 100644 --- a/pylint/checkers/modified_iterating_checker.py +++ b/pylint/checkers/modified_iterating_checker.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from typing import TYPE_CHECKING, Union diff --git a/pylint/checkers/newstyle.py b/pylint/checkers/newstyle.py index eb8473d09f..af4e365d02 100644 --- a/pylint/checkers/newstyle.py +++ b/pylint/checkers/newstyle.py @@ -1,24 +1,6 @@ -# Copyright (c) 2006, 2008-2011, 2013-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2012-2014 Google, Inc. -# Copyright (c) 2013-2020 Claudiu Popa -# Copyright (c) 2014 Michal Nowikowski -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Alexander Todorov -# Copyright (c) 2016 Jakub Wilk -# Copyright (c) 2018 Lucas Cimon -# Copyright (c) 2018 Natalie Serebryakova -# Copyright (c) 2018 ssolanki -# Copyright (c) 2019, 2021 Pierre Sassoulas -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2019 Robert Schweizer -# Copyright (c) 2020 hippo91 -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Check for new / old style related problems.""" from typing import TYPE_CHECKING diff --git a/pylint/checkers/non_ascii_names.py b/pylint/checkers/non_ascii_names.py index d9b3bfd505..d80d9dec05 100644 --- a/pylint/checkers/non_ascii_names.py +++ b/pylint/checkers/non_ascii_names.py @@ -1,7 +1,7 @@ -# Copyright (c) 2021-2022 Carli Freudenberg - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors + """All alphanumeric unicode character are allowed in Python but due to similarities in how they look they can be confused. diff --git a/pylint/checkers/raw_metrics.py b/pylint/checkers/raw_metrics.py index dae296ec84..15f08dc852 100644 --- a/pylint/checkers/raw_metrics.py +++ b/pylint/checkers/raw_metrics.py @@ -1,20 +1,6 @@ -# Copyright (c) 2007, 2010, 2013, 2015 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2013 Google, Inc. -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015-2018, 2020 Claudiu Popa -# Copyright (c) 2015 Mike Frysinger -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Glenn Matthews -# Copyright (c) 2018 ssolanki -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2020-2021 hippo91 -# Copyright (c) 2020 谭九鼎 <109224573@qq.com> -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 bot -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import sys import tokenize diff --git a/pylint/checkers/refactoring/__init__.py b/pylint/checkers/refactoring/__init__.py index 8c873c6988..fdcf635fd0 100644 --- a/pylint/checkers/refactoring/__init__.py +++ b/pylint/checkers/refactoring/__init__.py @@ -1,39 +1,6 @@ -# Copyright (c) 2016-2020 Claudiu Popa -# Copyright (c) 2016-2017 Łukasz Rogalski -# Copyright (c) 2016 Moises Lopez -# Copyright (c) 2016 Alexander Todorov -# Copyright (c) 2017-2018, 2020 hippo91 -# Copyright (c) 2017-2018 Ville Skyttä -# Copyright (c) 2017-2018 Bryce Guinta -# Copyright (c) 2017 Hugo -# Copyright (c) 2017 Łukasz Sznuk -# Copyright (c) 2017 Alex Hearn -# Copyright (c) 2017 Antonio Ossa -# Copyright (c) 2018-2019 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Justin Li -# Copyright (c) 2018 Jim Robertson -# Copyright (c) 2018 Lucas Cimon -# Copyright (c) 2018 Ben James -# Copyright (c) 2018 Tomer Chachamu -# Copyright (c) 2018 Nick Drozd -# Copyright (c) 2018 Konstantin Manna -# Copyright (c) 2018 Konstantin -# Copyright (c) 2018 Matej Marušák -# Copyright (c) 2018 Mr. Senko -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Rémi Cardona -# Copyright (c) 2019 Robert Schweizer -# Copyright (c) 2019 PHeanEX -# Copyright (c) 2019 Paul Renvoise -# Copyright (c) 2020 ethan-leba -# Copyright (c) 2020 lrjball <50599110+lrjball@users.noreply.github.com> -# Copyright (c) 2020 Yang Yang -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Jaehoon Hwang -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Looks for code which can be refactored.""" diff --git a/pylint/checkers/refactoring/implicit_booleaness_checker.py b/pylint/checkers/refactoring/implicit_booleaness_checker.py index e9482f6b71..dd59b2085b 100644 --- a/pylint/checkers/refactoring/implicit_booleaness_checker.py +++ b/pylint/checkers/refactoring/implicit_booleaness_checker.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from typing import List, Union import astroid diff --git a/pylint/checkers/refactoring/not_checker.py b/pylint/checkers/refactoring/not_checker.py index d1710ea222..c7c8f4289e 100644 --- a/pylint/checkers/refactoring/not_checker.py +++ b/pylint/checkers/refactoring/not_checker.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import astroid diff --git a/pylint/checkers/refactoring/recommendation_checker.py b/pylint/checkers/refactoring/recommendation_checker.py index d517cfd1b5..5aa1d26226 100644 --- a/pylint/checkers/refactoring/recommendation_checker.py +++ b/pylint/checkers/refactoring/recommendation_checker.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from typing import Union import astroid diff --git a/pylint/checkers/refactoring/refactoring_checker.py b/pylint/checkers/refactoring/refactoring_checker.py index 0644271b21..1514770479 100644 --- a/pylint/checkers/refactoring/refactoring_checker.py +++ b/pylint/checkers/refactoring/refactoring_checker.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import collections import copy diff --git a/pylint/checkers/similar.py b/pylint/checkers/similar.py index 8e6eee92d5..cd70e326b3 100644 --- a/pylint/checkers/similar.py +++ b/pylint/checkers/similar.py @@ -1,31 +1,6 @@ -# Copyright (c) 2006, 2008-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2012 Ry4an Brase -# Copyright (c) 2012 Google, Inc. -# Copyright (c) 2012 Anthony VEREZ -# Copyright (c) 2014-2020 Claudiu Popa -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2017, 2020 Anthony Sottile -# Copyright (c) 2017 Mikhail Fesenko -# Copyright (c) 2018 Scott Worley -# Copyright (c) 2018 ssolanki -# Copyright (c) 2019, 2021 Pierre Sassoulas -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2019 Taewon D. Kim -# Copyright (c) 2020-2021 hippo91 -# Copyright (c) 2020 Frank Harrison -# Copyright (c) 2020 Eli Fine -# Copyright (c) 2020 Shiv Venkatasubrahmanyam -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Ville Skyttä -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Maksym Humetskyi -# Copyright (c) 2021 bot -# Copyright (c) 2021 Aditya Gupta - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """A similarities / code duplication command line tool and pylint checker. diff --git a/pylint/checkers/spelling.py b/pylint/checkers/spelling.py index e63196155a..92d6e037ff 100644 --- a/pylint/checkers/spelling.py +++ b/pylint/checkers/spelling.py @@ -1,32 +1,6 @@ -# Copyright (c) 2014-2020 Claudiu Popa -# Copyright (c) 2014 Michal Nowikowski -# Copyright (c) 2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2015 Pavel Roskin -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016-2017, 2020 Pedro Algarvio -# Copyright (c) 2016 Alexander Todorov -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2017 Mikhail Fesenko -# Copyright (c) 2018, 2020 Anthony Sottile -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Mike Frysinger -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Peter Kolbus -# Copyright (c) 2019 agutole -# Copyright (c) 2020 Ganden Schaffner -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Damien Baty -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Tushar Sadhwani -# Copyright (c) 2021 Nick Drozd -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 bot -# Copyright (c) 2021 Andreas Finkler -# Copyright (c) 2021 Eli Fine - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Checker for spelling errors in comments and docstrings.""" import os diff --git a/pylint/checkers/stdlib.py b/pylint/checkers/stdlib.py index 5b4670803e..ad5aa3dbcc 100644 --- a/pylint/checkers/stdlib.py +++ b/pylint/checkers/stdlib.py @@ -1,39 +1,6 @@ -# Copyright (c) 2013-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2013-2014 Google, Inc. -# Copyright (c) 2014-2020 Claudiu Popa -# Copyright (c) 2014 Cosmin Poieana -# Copyright (c) 2014 Vlad Temian -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Cezar -# Copyright (c) 2015 Chris Rebert -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Jared Garst -# Copyright (c) 2017 Renat Galimov -# Copyright (c) 2017 Martin -# Copyright (c) 2017 Christopher Zurcher -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2018 Lucas Cimon -# Copyright (c) 2018 Banjamin Freeman -# Copyright (c) 2018 Ioana Tagirta -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Julien Palard -# Copyright (c) 2019 laike9m -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2019 Robert Schweizer -# Copyright (c) 2019 fadedDexofan -# Copyright (c) 2020 Sorin Sbarnea -# Copyright (c) 2020 Federico Bond -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 谭九鼎 <109224573@qq.com> -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Yilei "Dolee" Yang -# Copyright (c) 2021 Matus Valo -# Copyright (c) 2021 victor <16359131+jiajunsu@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Checkers for various standard library functions.""" diff --git a/pylint/checkers/strings.py b/pylint/checkers/strings.py index 3b2ed51068..19bdbce91f 100644 --- a/pylint/checkers/strings.py +++ b/pylint/checkers/strings.py @@ -1,38 +1,6 @@ -# Copyright (c) 2009-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2010 Daniel Harding -# Copyright (c) 2012-2014 Google, Inc. -# Copyright (c) 2013-2020 Claudiu Popa -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Rene Zhang -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016, 2018 Jakub Wilk -# Copyright (c) 2016 Peter Dawyndt -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2017 Ville Skyttä -# Copyright (c) 2018, 2020 Anthony Sottile -# Copyright (c) 2018-2019 Lucas Cimon -# Copyright (c) 2018 Alan Chan -# Copyright (c) 2018 Yury Gribov -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Nick Drozd -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Wes Turner -# Copyright (c) 2019 Djailla -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2020 Matthew Suozzo -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 谭九鼎 <109224573@qq.com> -# Copyright (c) 2020 Anthony -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Tushar Sadhwani -# Copyright (c) 2021 Jaehoon Hwang -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Peter Kolbus - - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Checker for string formatting operations.""" diff --git a/pylint/checkers/threading_checker.py b/pylint/checkers/threading_checker.py index 6148b82923..649696f4b4 100644 --- a/pylint/checkers/threading_checker.py +++ b/pylint/checkers/threading_checker.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from typing import TYPE_CHECKING diff --git a/pylint/checkers/typecheck.py b/pylint/checkers/typecheck.py index 7cb132830e..f220f4c273 100644 --- a/pylint/checkers/typecheck.py +++ b/pylint/checkers/typecheck.py @@ -1,59 +1,6 @@ -# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2009 James Lingard -# Copyright (c) 2012-2014 Google, Inc. -# Copyright (c) 2014-2020 Claudiu Popa -# Copyright (c) 2014 David Shea -# Copyright (c) 2014 Steven Myint -# Copyright (c) 2014 Holger Peters -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Anentropic -# Copyright (c) 2015 Dmitry Pribysh -# Copyright (c) 2015 Rene Zhang -# Copyright (c) 2015 Radu Ciorba -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016, 2019 Ashley Whetter -# Copyright (c) 2016 Alexander Todorov -# Copyright (c) 2016 Jürgen Hermann -# Copyright (c) 2016 Jakub Wilk -# Copyright (c) 2016 Filipe Brandenburger -# Copyright (c) 2017, 2021 Ville Skyttä -# Copyright (c) 2017-2018, 2020 hippo91 -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2017 Derek Gustafson -# Copyright (c) 2018-2019, 2021 Nick Drozd -# Copyright (c) 2018 Pablo Galindo -# Copyright (c) 2018 Jim Robertson -# Copyright (c) 2018 Lucas Cimon -# Copyright (c) 2018 Mike Frysinger -# Copyright (c) 2018 Ben Green -# Copyright (c) 2018 Konstantin -# Copyright (c) 2018 Justin Li -# Copyright (c) 2018 Bryce Guinta -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Andy Palmer <25123779+ninezerozeronine@users.noreply.github.com> -# Copyright (c) 2019 mattlbeck <17108752+mattlbeck@users.noreply.github.com> -# Copyright (c) 2019 Martin Vielsmaier -# Copyright (c) 2019 Santiago Castro -# Copyright (c) 2019 yory8 <39745367+yory8@users.noreply.github.com> -# Copyright (c) 2019 Federico Bond -# Copyright (c) 2019 Pascal Corpet -# Copyright (c) 2020 Peter Kolbus -# Copyright (c) 2020 Julien Palard -# Copyright (c) 2020 Ram Rachum -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2020 Anubhav <35621759+anubh-v@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Tushar Sadhwani -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 David Liu -# Copyright (c) 2021 doranid -# Copyright (c) 2021 Yu Shao, Pang <36848472+yushao2@users.noreply.github.com> -# Copyright (c) 2021 Andrew Haigh -# Copyright (c) 2021 Jens H. Nielsen -# Copyright (c) 2021 Ikraduya Edian - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Try to find more bugs in the code using astroid inference capabilities.""" diff --git a/pylint/checkers/unicode.py b/pylint/checkers/unicode.py index 93dfacb4b6..a6f46ad4bb 100644 --- a/pylint/checkers/unicode.py +++ b/pylint/checkers/unicode.py @@ -1,7 +1,7 @@ -# Copyright (c) 2021-2022 Carli Freudenberg - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors + """Unicode and some other ASCII characters can be used to create programs that run much different compared to what a human reader would expect from them. diff --git a/pylint/checkers/unsupported_version.py b/pylint/checkers/unsupported_version.py index 7c82817c00..8c34a921f8 100644 --- a/pylint/checkers/unsupported_version.py +++ b/pylint/checkers/unsupported_version.py @@ -1,9 +1,6 @@ -# Copyright (c) 2021 Pierre Sassoulas -# Copyright (c) 2021 Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Checker for features used that are not supported by all python versions indicated by the py-version setting. diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py index 6966bf16f9..f3b643109b 100644 --- a/pylint/checkers/utils.py +++ b/pylint/checkers/utils.py @@ -1,61 +1,6 @@ -# Copyright (c) 2006-2007, 2009-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2009 Mads Kiilerich -# Copyright (c) 2010 Daniel Harding -# Copyright (c) 2012-2014 Google, Inc. -# Copyright (c) 2012 FELD Boris -# Copyright (c) 2013-2020 Claudiu Popa -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Ricardo Gemignani -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Dmitry Pribysh -# Copyright (c) 2015 Florian Bruhin -# Copyright (c) 2015 Radu Ciorba -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016, 2018-2019 Ashley Whetter -# Copyright (c) 2016-2017 Łukasz Rogalski -# Copyright (c) 2016-2017 Moises Lopez -# Copyright (c) 2016 Brian C. Lane -# Copyright (c) 2017-2018, 2020 hippo91 -# Copyright (c) 2017 ttenhoeve-aa -# Copyright (c) 2018 Alan Chan -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Yury Gribov -# Copyright (c) 2018 Caio Carrara -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Bryce Guinta -# Copyright (c) 2018 Bryce Guinta -# Copyright (c) 2018 Ville Skyttä -# Copyright (c) 2018 Brian Shaginaw -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Matthijs Blom <19817960+MatthijsBlom@users.noreply.github.com> -# Copyright (c) 2019 Djailla -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2019 Nathan Marrow -# Copyright (c) 2019 Svet -# Copyright (c) 2019 Pascal Corpet -# Copyright (c) 2020 Batuhan Taskaya -# Copyright (c) 2020 Luigi -# Copyright (c) 2020 ethan-leba -# Copyright (c) 2020 Damien Baty -# Copyright (c) 2020 Andrew Simmons -# Copyright (c) 2020 Ram Rachum -# Copyright (c) 2020 Slavfox -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 bot -# Copyright (c) 2021 Yu Shao, Pang <36848472+yushao2@users.noreply.github.com> -# Copyright (c) 2021 Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> -# Copyright (c) 2021 Nick Drozd -# Copyright (c) 2021 Arianna Y <92831762+areveny@users.noreply.github.com> -# Copyright (c) 2021 Jaehoon Hwang -# Copyright (c) 2021 Samuel FORESTIER -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 David Liu -# Copyright (c) 2021 Matus Valo -# Copyright (c) 2021 Lorena B <46202743+lorena-b@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Some functions that may be useful for various checkers.""" import builtins diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index 3580e660e9..b518eb47e7 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -1,58 +1,6 @@ -# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2009 Mads Kiilerich -# Copyright (c) 2010 Daniel Harding -# Copyright (c) 2011-2014, 2017 Google, Inc. -# Copyright (c) 2012 FELD Boris -# Copyright (c) 2013-2020 Claudiu Popa -# Copyright (c) 2014 Michal Nowikowski -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Ricardo Gemignani -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Dmitry Pribysh -# Copyright (c) 2015 Radu Ciorba -# Copyright (c) 2015 Simu Toni -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016, 2018-2019 Ashley Whetter -# Copyright (c) 2016, 2018 Jakub Wilk -# Copyright (c) 2016-2017 Derek Gustafson -# Copyright (c) 2016-2017 Łukasz Rogalski -# Copyright (c) 2016 Grant Welch -# Copyright (c) 2017-2018, 2021 Ville Skyttä -# Copyright (c) 2017-2018, 2020 hippo91 -# Copyright (c) 2017 Dan Garrette -# Copyright (c) 2018-2019 Jim Robertson -# Copyright (c) 2018 Mike Miller -# Copyright (c) 2018 Lucas Cimon -# Copyright (c) 2018 Drew -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Bryce Guinta -# Copyright (c) 2018 Bryce Guinta -# Copyright (c) 2018 Mike Frysinger -# Copyright (c) 2018 Marianna Polatoglou -# Copyright (c) 2018 mar-chi-pan -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019, 2021 Nick Drozd -# Copyright (c) 2019 Djailla -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2020 Andrew Simmons -# Copyright (c) 2020 Andrew Simmons -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2020 Ashley Whetter -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Tushar Sadhwani -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 bot -# Copyright (c) 2021 David Liu -# Copyright (c) 2021 kasium <15907922+kasium@users.noreply.github.com> -# Copyright (c) 2021 Marcin Kurczewski -# Copyright (c) 2021 Sergei Lebedev <185856+superbobry@users.noreply.github.com> -# Copyright (c) 2021 Lorena B <46202743+lorena-b@users.noreply.github.com> -# Copyright (c) 2021 haasea <44787650+haasea@users.noreply.github.com> -# Copyright (c) 2021 Alexander Kapshuna - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Variables checkers for Python code.""" import collections diff --git a/pylint/config/__init__.py b/pylint/config/__init__.py index 2e378660fe..c4582ee002 100644 --- a/pylint/config/__init__.py +++ b/pylint/config/__init__.py @@ -1,38 +1,6 @@ -# Copyright (c) 2006-2010, 2012-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2008 pyves@crater.logilab.fr -# Copyright (c) 2013 Google, Inc. -# Copyright (c) 2013 John McGehee -# Copyright (c) 2014-2020 Claudiu Popa -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Aru Sahni -# Copyright (c) 2015 John Kirkham -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Erik -# Copyright (c) 2016 Alexander Todorov -# Copyright (c) 2016 Moises Lopez -# Copyright (c) 2017, 2020 hippo91 -# Copyright (c) 2017-2019 Ville Skyttä -# Copyright (c) 2017 ahirnish -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2018, 2020 Anthony Sottile -# Copyright (c) 2018 Jim Robertson -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Bryce Guinta -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Gary Tyler McLeod -# Copyright (c) 2018 Konstantin -# Copyright (c) 2018 Nick Drozd -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019, 2021 Ashley Whetter -# Copyright (c) 2019 Janne Rönkkö -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Eisuke Kawashima -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import os import pathlib diff --git a/pylint/config/config_initialization.py b/pylint/config/config_initialization.py index d038220302..fd36e7c6f1 100644 --- a/pylint/config/config_initialization.py +++ b/pylint/config/config_initialization.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import sys from pathlib import Path diff --git a/pylint/config/configuration_mixin.py b/pylint/config/configuration_mixin.py index a2abcb7528..bb1115ad76 100644 --- a/pylint/config/configuration_mixin.py +++ b/pylint/config/configuration_mixin.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from pylint.config.option_manager_mixin import OptionsManagerMixIn from pylint.config.options_provider_mixin import OptionsProviderMixIn diff --git a/pylint/config/find_default_config_files.py b/pylint/config/find_default_config_files.py index 73a7f0f8a5..d2461a6251 100644 --- a/pylint/config/find_default_config_files.py +++ b/pylint/config/find_default_config_files.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import configparser import os diff --git a/pylint/config/man_help_formatter.py b/pylint/config/man_help_formatter.py index c00f45468e..5531fec03b 100644 --- a/pylint/config/man_help_formatter.py +++ b/pylint/config/man_help_formatter.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import optparse # pylint: disable=deprecated-module import sys diff --git a/pylint/config/option.py b/pylint/config/option.py index cf88e3fc90..5667a14ccf 100644 --- a/pylint/config/option.py +++ b/pylint/config/option.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import copy import optparse # pylint: disable=deprecated-module diff --git a/pylint/config/option_manager_mixin.py b/pylint/config/option_manager_mixin.py index 387c628235..346533ab60 100644 --- a/pylint/config/option_manager_mixin.py +++ b/pylint/config/option_manager_mixin.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import collections diff --git a/pylint/config/option_parser.py b/pylint/config/option_parser.py index 66b5737234..ad512329bf 100644 --- a/pylint/config/option_parser.py +++ b/pylint/config/option_parser.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import optparse # pylint: disable=deprecated-module diff --git a/pylint/config/options_provider_mixin.py b/pylint/config/options_provider_mixin.py index 8c6204586a..ae467c30c6 100644 --- a/pylint/config/options_provider_mixin.py +++ b/pylint/config/options_provider_mixin.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import optparse # pylint: disable=deprecated-module diff --git a/pylint/constants.py b/pylint/constants.py index ae87d4293d..94e0636bb5 100644 --- a/pylint/constants.py +++ b/pylint/constants.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import platform import sys from typing import Dict, List, NamedTuple, Tuple diff --git a/pylint/epylint.py b/pylint/epylint.py index 223f723a77..d02ce6d5dc 100755 --- a/pylint/epylint.py +++ b/pylint/epylint.py @@ -1,32 +1,9 @@ # mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 # -*- vim:fenc=utf-8:ft=python:et:sw=4:ts=4:sts=4 -# Copyright (c) 2008-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2014 Jakob Normark -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Manuel Vázquez Acosta -# Copyright (c) 2014 Derek Harland -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015-2020 Claudiu Popa -# Copyright (c) 2015 Mihai Balint -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2017, 2020 hippo91 -# Copyright (c) 2017 Daniela Plascencia -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Ryan McGuire -# Copyright (c) 2018 thernstig <30827238+thernstig@users.noreply.github.com> -# Copyright (c) 2018 Radostin Stoyanov -# Copyright (c) 2019, 2021 Pierre Sassoulas -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2020 Damien Baty -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Nick Drozd -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Emacs and Flymake compatible Pylint. diff --git a/pylint/exceptions.py b/pylint/exceptions.py index 5999dcfd4a..61b5bb07de 100644 --- a/pylint/exceptions.py +++ b/pylint/exceptions.py @@ -1,16 +1,6 @@ -# Copyright (c) 2016-2018, 2020 Claudiu Popa -# Copyright (c) 2016 Glenn Matthews -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2018 Ville Skyttä -# Copyright (c) 2019 Thomas Hisch -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Ashley Whetter -# Copyright (c) 2021 Pierre Sassoulas -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Exception classes raised by various operations within pylint.""" diff --git a/pylint/extensions/__init__.py b/pylint/extensions/__init__.py index 4af3aefb17..467608e4ec 100644 --- a/pylint/extensions/__init__.py +++ b/pylint/extensions/__init__.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from typing import TYPE_CHECKING diff --git a/pylint/extensions/_check_docs_utils.py b/pylint/extensions/_check_docs_utils.py index ffda42cd37..ff01ef226d 100644 --- a/pylint/extensions/_check_docs_utils.py +++ b/pylint/extensions/_check_docs_utils.py @@ -1,26 +1,6 @@ -# Copyright (c) 2016-2019, 2021 Ashley Whetter -# Copyright (c) 2016-2020 Claudiu Popa -# Copyright (c) 2016 Yuri Bochkarev -# Copyright (c) 2016 Glenn Matthews -# Copyright (c) 2016 Moises Lopez -# Copyright (c) 2017, 2020 hippo91 -# Copyright (c) 2017 Mitar -# Copyright (c) 2018, 2020 Anthony Sottile -# Copyright (c) 2018 Jim Robertson -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Mitchell T.H. Young -# Copyright (c) 2018 Adrian Chirieac -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2019 Danny Hermes -# Copyright (c) 2019 Zeb Nicholls -# Copyright (c) 2021 Pierre Sassoulas -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 allanc65 <95424144+allanc65@users.noreply.github.com> -# Copyright (c) 2021 Konstantina Saketou <56515303+ksaketou@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Utility methods for docstring checking.""" diff --git a/pylint/extensions/bad_builtin.py b/pylint/extensions/bad_builtin.py index bf80722442..62fe6691c2 100644 --- a/pylint/extensions/bad_builtin.py +++ b/pylint/extensions/bad_builtin.py @@ -1,14 +1,6 @@ -# Copyright (c) 2016, 2018, 2020 Claudiu Popa -# Copyright (c) 2019, 2021 Pierre Sassoulas -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2020 Peter Kolbus -# Copyright (c) 2020 hippo91 -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Nick Drozd -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Checker for deprecated builtins.""" from typing import TYPE_CHECKING diff --git a/pylint/extensions/broad_try_clause.py b/pylint/extensions/broad_try_clause.py index a45dc5fe6b..e51106987b 100644 --- a/pylint/extensions/broad_try_clause.py +++ b/pylint/extensions/broad_try_clause.py @@ -1,13 +1,6 @@ -# Copyright (c) 2019-2020 Claudiu Popa -# Copyright (c) 2019-2020 Tyler Thieding -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Pierre Sassoulas -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Looks for try/except statements with too much code in the try clause.""" from typing import TYPE_CHECKING, Union diff --git a/pylint/extensions/check_elif.py b/pylint/extensions/check_elif.py index 0563d5170c..41d737f5f0 100644 --- a/pylint/extensions/check_elif.py +++ b/pylint/extensions/check_elif.py @@ -1,16 +1,6 @@ -# Copyright (c) 2015 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2016-2020 Claudiu Popa -# Copyright (c) 2016 Glenn Matthews -# Copyright (c) 2018 Ville Skyttä -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 bot -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from typing import TYPE_CHECKING diff --git a/pylint/extensions/comparetozero.py b/pylint/extensions/comparetozero.py index 0d0865a133..37304b93ee 100644 --- a/pylint/extensions/comparetozero.py +++ b/pylint/extensions/comparetozero.py @@ -1,14 +1,6 @@ -# Copyright (c) 2016 Alexander Todorov -# Copyright (c) 2017-2018, 2020 Claudiu Popa -# Copyright (c) 2019, 2021 Pierre Sassoulas -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 bernie gray - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Looks for comparisons to zero.""" diff --git a/pylint/extensions/comparison_placement.py b/pylint/extensions/comparison_placement.py index f34f1eb821..a85ea91fb6 100644 --- a/pylint/extensions/comparison_placement.py +++ b/pylint/extensions/comparison_placement.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Checks for yoda comparisons (variable before constant) See https://en.wikipedia.org/wiki/Yoda_conditions diff --git a/pylint/extensions/confusing_elif.py b/pylint/extensions/confusing_elif.py index 99588d0b8d..b6eee6ef14 100644 --- a/pylint/extensions/confusing_elif.py +++ b/pylint/extensions/confusing_elif.py @@ -1,11 +1,6 @@ -# Copyright (c) 2021 Pierre Sassoulas -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Ashley Whetter -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from typing import TYPE_CHECKING diff --git a/pylint/extensions/docparams.py b/pylint/extensions/docparams.py index 8d60b11881..ff3a0c641d 100644 --- a/pylint/extensions/docparams.py +++ b/pylint/extensions/docparams.py @@ -1,28 +1,6 @@ -# Copyright (c) 2014-2015 Bruno Daniel -# Copyright (c) 2015-2020 Claudiu Popa -# Copyright (c) 2016-2019 Ashley Whetter -# Copyright (c) 2016 Glenn Matthews -# Copyright (c) 2016 Glenn Matthews -# Copyright (c) 2016 Moises Lopez -# Copyright (c) 2017 Ville Skyttä -# Copyright (c) 2017 John Paraskevopoulos -# Copyright (c) 2018, 2020 Anthony Sottile -# Copyright (c) 2018 Jim Robertson -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Adam Dangoor -# Copyright (c) 2019, 2021 Pierre Sassoulas -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2020 Luigi -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Damien Baty -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Konstantina Saketou <56515303+ksaketou@users.noreply.github.com> -# Copyright (c) 2021 SupImDos <62866982+SupImDos@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Logan Miller <14319179+komodo472@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Pylint plugin for checking in Sphinx, Google, or Numpy style docstrings.""" import re diff --git a/pylint/extensions/docstyle.py b/pylint/extensions/docstyle.py index e520d0650c..8823d61e57 100644 --- a/pylint/extensions/docstyle.py +++ b/pylint/extensions/docstyle.py @@ -1,14 +1,6 @@ -# Copyright (c) 2016-2018, 2020 Claudiu Popa -# Copyright (c) 2016 Łukasz Rogalski -# Copyright (c) 2016 Luis Escobar -# Copyright (c) 2019, 2021 Pierre Sassoulas -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import linecache from typing import TYPE_CHECKING diff --git a/pylint/extensions/emptystring.py b/pylint/extensions/emptystring.py index 096b96ec90..30a8212257 100644 --- a/pylint/extensions/emptystring.py +++ b/pylint/extensions/emptystring.py @@ -1,14 +1,6 @@ -# Copyright (c) 2016 Alexander Todorov -# Copyright (c) 2017-2018, 2020 Claudiu Popa -# Copyright (c) 2019, 2021 Pierre Sassoulas -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Jaehoon Hwang -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Looks for comparisons to empty string.""" diff --git a/pylint/extensions/mccabe.py b/pylint/extensions/mccabe.py index b84865decf..6b3e4080d6 100644 --- a/pylint/extensions/mccabe.py +++ b/pylint/extensions/mccabe.py @@ -1,15 +1,6 @@ -# Copyright (c) 2016-2020 Claudiu Popa -# Copyright (c) 2016 Moises Lopez -# Copyright (c) 2017, 2020 hippo91 -# Copyright (c) 2019, 2021 Pierre Sassoulas -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Ville Skyttä -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Module to add McCabe checker class for pylint.""" diff --git a/pylint/extensions/overlapping_exceptions.py b/pylint/extensions/overlapping_exceptions.py index c3bf9aab2e..771a9a499c 100644 --- a/pylint/extensions/overlapping_exceptions.py +++ b/pylint/extensions/overlapping_exceptions.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Looks for overlapping exceptions.""" diff --git a/pylint/extensions/redefined_variable_type.py b/pylint/extensions/redefined_variable_type.py index 527418bf53..65e666f213 100644 --- a/pylint/extensions/redefined_variable_type.py +++ b/pylint/extensions/redefined_variable_type.py @@ -1,15 +1,6 @@ -# Copyright (c) 2016-2018, 2020 Claudiu Popa -# Copyright (c) 2016 Glenn Matthews -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Ville Skyttä -# Copyright (c) 2019, 2021 Pierre Sassoulas -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from typing import TYPE_CHECKING, List diff --git a/pylint/graph.py b/pylint/graph.py index c35cf8c5da..07e3aa549c 100644 --- a/pylint/graph.py +++ b/pylint/graph.py @@ -1,20 +1,6 @@ -# Copyright (c) 2015-2018, 2020 Claudiu Popa -# Copyright (c) 2015 Florian Bruhin -# Copyright (c) 2016 Ashley Whetter -# Copyright (c) 2018 ssolanki -# Copyright (c) 2019, 2021 Pierre Sassoulas -# Copyright (c) 2019 Nick Drozd -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Damien Baty -# Copyright (c) 2020 谭九鼎 <109224573@qq.com> -# Copyright (c) 2020 Benjamin Graham -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler -# Copyright (c) 2021 Andrew Howe - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Graph manipulation utilities. diff --git a/pylint/interfaces.py b/pylint/interfaces.py index e2b4b44220..fe48d4daa2 100644 --- a/pylint/interfaces.py +++ b/pylint/interfaces.py @@ -1,21 +1,6 @@ -# Copyright (c) 2009-2010, 2012-2013 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2013-2014 Google, Inc. -# Copyright (c) 2014 Michal Nowikowski -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015-2018, 2020 Claudiu Popa -# Copyright (c) 2015 Florian Bruhin -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Ville Skyttä -# Copyright (c) 2020-2021 Pierre Sassoulas -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Nick Drozd -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Interfaces for Pylint objects.""" from collections import namedtuple diff --git a/pylint/lint/__init__.py b/pylint/lint/__init__.py index ae3c56c890..b110728658 100644 --- a/pylint/lint/__init__.py +++ b/pylint/lint/__init__.py @@ -1,63 +1,6 @@ -# Copyright (c) 2006-2015 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2008 Fabrice Douchant -# Copyright (c) 2009 Vincent -# Copyright (c) 2009 Mads Kiilerich -# Copyright (c) 2011-2014 Google, Inc. -# Copyright (c) 2012 David Pursehouse -# Copyright (c) 2012 Kevin Jing Qiu -# Copyright (c) 2012 FELD Boris -# Copyright (c) 2012 JT Olds -# Copyright (c) 2014-2020 Claudiu Popa -# Copyright (c) 2014-2015 Michal Nowikowski -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Alexandru Coman -# Copyright (c) 2014 Daniel Harding -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2014 Dan Goldsmith -# Copyright (c) 2015-2016 Florian Bruhin -# Copyright (c) 2015 Aru Sahni -# Copyright (c) 2015 Steven Myint -# Copyright (c) 2015 Simu Toni -# Copyright (c) 2015 Mihai Balint -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016-2017 Łukasz Rogalski -# Copyright (c) 2016 Glenn Matthews -# Copyright (c) 2016 Alan Evangelista -# Copyright (c) 2017-2019 hippo91 -# Copyright (c) 2017-2018 Ville Skyttä -# Copyright (c) 2017 Daniel Miller -# Copyright (c) 2017 Roman Ivanov -# Copyright (c) 2017 Ned Batchelder -# Copyright (c) 2018-2021 Pierre Sassoulas -# Copyright (c) 2018, 2020 Anthony Sottile -# Copyright (c) 2018-2019 Nick Drozd -# Copyright (c) 2018 Matus Valo -# Copyright (c) 2018 Lucas Cimon -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Randall Leeds -# Copyright (c) 2018 Mike Frysinger -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Jason Owen -# Copyright (c) 2018 Gary Tyler McLeod -# Copyright (c) 2018 Yuval Langer -# Copyright (c) 2018 kapsh -# Copyright (c) 2019 syutbai -# Copyright (c) 2019 Thomas Hisch -# Copyright (c) 2019 Hugues -# Copyright (c) 2019 Janne Rönkkö -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2019 Trevor Bekolay -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2019 Robert Schweizer -# Copyright (c) 2019 Andres Perez Hortal -# Copyright (c) 2019 Peter Kolbus -# Copyright (c) 2019 Nicolas Dickreuter -# Copyright (c) 2020 Frank Harrison -# Copyright (c) 2020 anubh-v -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Pylint [options] modules_or_packages. diff --git a/pylint/lint/parallel.py b/pylint/lint/parallel.py index 99c3714931..5cf0b0b67f 100644 --- a/pylint/lint/parallel.py +++ b/pylint/lint/parallel.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import collections import functools diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py index 9f94da292d..248df9d06d 100644 --- a/pylint/lint/pylinter.py +++ b/pylint/lint/pylinter.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import collections import contextlib diff --git a/pylint/lint/report_functions.py b/pylint/lint/report_functions.py index 0f5e9360db..052c564a7f 100644 --- a/pylint/lint/report_functions.py +++ b/pylint/lint/report_functions.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import collections from typing import DefaultDict, Dict, Union diff --git a/pylint/lint/run.py b/pylint/lint/run.py index b719051844..28e45dde66 100644 --- a/pylint/lint/run.py +++ b/pylint/lint/run.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import os import sys diff --git a/pylint/lint/utils.py b/pylint/lint/utils.py index 410269e9d9..4a1a375703 100644 --- a/pylint/lint/utils.py +++ b/pylint/lint/utils.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import contextlib import sys diff --git a/pylint/message/__init__.py b/pylint/message/__init__.py index 68159bf342..1238c127ae 100644 --- a/pylint/message/__init__.py +++ b/pylint/message/__init__.py @@ -1,42 +1,6 @@ -# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2009 Vincent -# Copyright (c) 2009 Mads Kiilerich -# Copyright (c) 2012-2014 Google, Inc. -# Copyright (c) 2014-2018, 2020 Claudiu Popa -# Copyright (c) 2014-2015 Michal Nowikowski -# Copyright (c) 2014 LCD 47 -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2014 Damien Nozay -# Copyright (c) 2015 Aru Sahni -# Copyright (c) 2015 Florian Bruhin -# Copyright (c) 2015 Simu Toni -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Łukasz Rogalski -# Copyright (c) 2016 Moises Lopez -# Copyright (c) 2016 Glenn Matthews -# Copyright (c) 2016 Glenn Matthews -# Copyright (c) 2016 Ashley Whetter -# Copyright (c) 2016 xmo-odoo -# Copyright (c) 2017-2019, 2021 Pierre Sassoulas -# Copyright (c) 2017-2018, 2020 hippo91 -# Copyright (c) 2017, 2020 Anthony Sottile -# Copyright (c) 2017-2018 Bryce Guinta -# Copyright (c) 2017 Chris Lamb -# Copyright (c) 2017 Thomas Hisch -# Copyright (c) 2017 Mikhail Fesenko -# Copyright (c) 2017 Craig Citro -# Copyright (c) 2017 Ville Skyttä -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Bryce Guinta -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Reverb C -# Copyright (c) 2018 Nick Drozd -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """All the classes related to Message handling.""" diff --git a/pylint/message/message.py b/pylint/message/message.py index 8a12d84b84..79db438784 100644 --- a/pylint/message/message.py +++ b/pylint/message/message.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import collections diff --git a/pylint/message/message_definition.py b/pylint/message/message_definition.py index a286f5a6d5..ea65a32b88 100644 --- a/pylint/message/message_definition.py +++ b/pylint/message/message_definition.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import sys from typing import TYPE_CHECKING, List, Optional, Tuple diff --git a/pylint/message/message_definition_store.py b/pylint/message/message_definition_store.py index c8b4e166a0..643bc26a93 100644 --- a/pylint/message/message_definition_store.py +++ b/pylint/message/message_definition_store.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import collections import functools diff --git a/pylint/message/message_id_store.py b/pylint/message/message_id_store.py index e585be5a06..b45d074c65 100644 --- a/pylint/message/message_id_store.py +++ b/pylint/message/message_id_store.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from typing import Dict, List, NoReturn, Optional, Tuple from pylint.exceptions import InvalidMessageError, UnknownMessageError diff --git a/pylint/pyreverse/__init__.py b/pylint/pyreverse/__init__.py index cce5caec3a..f0ca20a7bf 100644 --- a/pylint/pyreverse/__init__.py +++ b/pylint/pyreverse/__init__.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Pyreverse.extensions.""" diff --git a/pylint/pyreverse/diadefslib.py b/pylint/pyreverse/diadefslib.py index 6fa8ea107b..50b9ad9b31 100644 --- a/pylint/pyreverse/diadefslib.py +++ b/pylint/pyreverse/diadefslib.py @@ -1,23 +1,6 @@ -# Copyright (c) 2006, 2008-2010, 2013-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015-2018, 2020 Claudiu Popa -# Copyright (c) 2015 Florian Bruhin -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Ashley Whetter -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Ville Skyttä -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 bot -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Handle diagram generation options for class diagram or default diagrams.""" diff --git a/pylint/pyreverse/diagrams.py b/pylint/pyreverse/diagrams.py index fa88e38165..c2699f7674 100644 --- a/pylint/pyreverse/diagrams.py +++ b/pylint/pyreverse/diagrams.py @@ -1,20 +1,6 @@ -# Copyright (c) 2006, 2008-2010, 2012-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2014-2018, 2020 Claudiu Popa -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2018 ssolanki -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2020 hippo91 -# Copyright (c) 2021 Takahide Nojima -# Copyright (c) 2021 bot -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler -# Copyright (c) 2021 Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Diagram objects.""" import astroid diff --git a/pylint/pyreverse/dot_printer.py b/pylint/pyreverse/dot_printer.py index 21f41d765c..841d96fdca 100644 --- a/pylint/pyreverse/dot_printer.py +++ b/pylint/pyreverse/dot_printer.py @@ -1,12 +1,6 @@ -# Copyright (c) 2021 Pierre Sassoulas -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Ashley Whetter -# Copyright (c) 2021 Nick Drozd -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Class to generate files in dot format and image formats supported by Graphviz.""" import os diff --git a/pylint/pyreverse/inspector.py b/pylint/pyreverse/inspector.py index 808f34266c..7ef3f7bb64 100644 --- a/pylint/pyreverse/inspector.py +++ b/pylint/pyreverse/inspector.py @@ -1,18 +1,6 @@ -# Copyright (c) 2015-2020 Claudiu Popa -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Ville Skyttä -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Nick Drozd -# Copyright (c) 2021 Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Visitor doing some postprocessing on the astroid tree. diff --git a/pylint/pyreverse/main.py b/pylint/pyreverse/main.py index aefffb315d..9efe9ee4d7 100644 --- a/pylint/pyreverse/main.py +++ b/pylint/pyreverse/main.py @@ -1,24 +1,6 @@ -# Copyright (c) 2008-2010, 2012-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015-2020 Claudiu Popa -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Alexander Pervakov -# Copyright (c) 2018 ssolanki -# Copyright (c) 2019, 2021 Pierre Sassoulas -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2020 Peter Kolbus -# Copyright (c) 2020 hippo91 -# Copyright (c) 2021 Antonio Quarta -# Copyright (c) 2021 Tushar Sadhwani -# Copyright (c) 2021 Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> -# Copyright (c) 2021 bot -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """%prog [options] . diff --git a/pylint/pyreverse/mermaidjs_printer.py b/pylint/pyreverse/mermaidjs_printer.py index a725d03f4c..b0452d2882 100644 --- a/pylint/pyreverse/mermaidjs_printer.py +++ b/pylint/pyreverse/mermaidjs_printer.py @@ -1,7 +1,6 @@ -# Copyright (c) 2021 Antonio Quarta - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Class to generate files in mermaidjs format.""" from typing import Dict, Optional diff --git a/pylint/pyreverse/plantuml_printer.py b/pylint/pyreverse/plantuml_printer.py index 2e643fe1fe..8674aead73 100644 --- a/pylint/pyreverse/plantuml_printer.py +++ b/pylint/pyreverse/plantuml_printer.py @@ -1,7 +1,6 @@ -# Copyright (c) 2021 Andreas Finkler - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Class to generate files in dot format and image formats supported by Graphviz.""" from typing import Dict, Optional diff --git a/pylint/pyreverse/printer.py b/pylint/pyreverse/printer.py index 6f4d62f364..346579719a 100644 --- a/pylint/pyreverse/printer.py +++ b/pylint/pyreverse/printer.py @@ -1,11 +1,6 @@ -# Copyright (c) 2021 Pierre Sassoulas -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Ashley Whetter -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Base class defining the interface for a printer.""" from abc import ABC, abstractmethod diff --git a/pylint/pyreverse/printer_factory.py b/pylint/pyreverse/printer_factory.py index bdcaf0869d..27eb7f7ab8 100644 --- a/pylint/pyreverse/printer_factory.py +++ b/pylint/pyreverse/printer_factory.py @@ -1,9 +1,6 @@ -# Copyright (c) 2021 Pierre Sassoulas -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from typing import Dict, Type diff --git a/pylint/pyreverse/utils.py b/pylint/pyreverse/utils.py index f7eff0ee0b..d18efe32ee 100644 --- a/pylint/pyreverse/utils.py +++ b/pylint/pyreverse/utils.py @@ -1,23 +1,6 @@ -# Copyright (c) 2006, 2008, 2010, 2013-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015-2020 Claudiu Popa -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2017, 2020 hippo91 -# Copyright (c) 2018 ssolanki -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2020-2021 Pierre Sassoulas -# Copyright (c) 2020 yeting li -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2020 bernie gray -# Copyright (c) 2021 bot -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Generic classes/functions for pyreverse core/extensions.""" import os diff --git a/pylint/pyreverse/vcg_printer.py b/pylint/pyreverse/vcg_printer.py index 52e99a300a..3a4d25edcf 100644 --- a/pylint/pyreverse/vcg_printer.py +++ b/pylint/pyreverse/vcg_printer.py @@ -1,17 +1,6 @@ -# Copyright (c) 2015-2018, 2020 Claudiu Popa -# Copyright (c) 2015 Florian Bruhin -# Copyright (c) 2018 ssolanki -# Copyright (c) 2020-2021 Pierre Sassoulas -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Ram Rachum -# Copyright (c) 2020 谭九鼎 <109224573@qq.com> -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Functions to generate files readable with Georg Sander's vcg (Visualization of Compiler Graphs). diff --git a/pylint/pyreverse/writer.py b/pylint/pyreverse/writer.py index 86a03ac7e6..a45394ac76 100644 --- a/pylint/pyreverse/writer.py +++ b/pylint/pyreverse/writer.py @@ -1,20 +1,6 @@ -# Copyright (c) 2008-2010, 2013-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015-2018, 2020 Claudiu Popa -# Copyright (c) 2015 Mike Frysinger -# Copyright (c) 2015 Florian Bruhin -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2018, 2020 Anthony Sottile -# Copyright (c) 2018 ssolanki -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Kylian -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Utilities for creating VCG and Dot diagrams.""" diff --git a/pylint/reporters/__init__.py b/pylint/reporters/__init__.py index 92b6bae21e..2420a03abf 100644 --- a/pylint/reporters/__init__.py +++ b/pylint/reporters/__init__.py @@ -1,25 +1,6 @@ -# Copyright (c) 2006, 2010, 2012-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2012-2014 Google, Inc. -# Copyright (c) 2012 FELD Boris -# Copyright (c) 2014-2020 Claudiu Popa -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Ricardo Gemignani -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Simu Toni -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2017 Kári Tristan Helgason -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Ville Skyttä -# Copyright (c) 2019, 2021 Pierre Sassoulas -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 ruro - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Utilities methods and classes for reporters.""" from typing import TYPE_CHECKING diff --git a/pylint/reporters/base_reporter.py b/pylint/reporters/base_reporter.py index 570175567b..fc7422370f 100644 --- a/pylint/reporters/base_reporter.py +++ b/pylint/reporters/base_reporter.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import os import sys diff --git a/pylint/reporters/collecting_reporter.py b/pylint/reporters/collecting_reporter.py index 9b787342af..2ee041b01c 100644 --- a/pylint/reporters/collecting_reporter.py +++ b/pylint/reporters/collecting_reporter.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from typing import TYPE_CHECKING from pylint.reporters.base_reporter import BaseReporter diff --git a/pylint/reporters/json_reporter.py b/pylint/reporters/json_reporter.py index 5c20747735..cb7418fbbc 100644 --- a/pylint/reporters/json_reporter.py +++ b/pylint/reporters/json_reporter.py @@ -1,16 +1,6 @@ -# Copyright (c) 2014 Vlad Temian -# Copyright (c) 2015-2020 Claudiu Popa -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2017 guillaume2 -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Clément Pit-Claudel -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """JSON reporter.""" import json diff --git a/pylint/reporters/multi_reporter.py b/pylint/reporters/multi_reporter.py index c2c7382d29..63b65eb0c4 100644 --- a/pylint/reporters/multi_reporter.py +++ b/pylint/reporters/multi_reporter.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import os diff --git a/pylint/reporters/reports_handler_mix_in.py b/pylint/reporters/reports_handler_mix_in.py index 01d9947fd7..f6486c95dd 100644 --- a/pylint/reporters/reports_handler_mix_in.py +++ b/pylint/reporters/reports_handler_mix_in.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import collections from typing import ( diff --git a/pylint/reporters/text.py b/pylint/reporters/text.py index 2e1abf6bfa..09a113c415 100644 --- a/pylint/reporters/text.py +++ b/pylint/reporters/text.py @@ -1,23 +1,6 @@ -# Copyright (c) 2006-2007, 2010-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2012-2014 Google, Inc. -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015-2018, 2020 Claudiu Popa -# Copyright (c) 2015 Florian Bruhin -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 y2kbugger -# Copyright (c) 2018-2019 Nick Drozd -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Jace Browning -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2020 hippo91 -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 bot - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Plain text reporters:. diff --git a/pylint/reporters/ureports/__init__.py b/pylint/reporters/ureports/__init__.py index 29bc85d894..51e490b4da 100644 --- a/pylint/reporters/ureports/__init__.py +++ b/pylint/reporters/ureports/__init__.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors __all__ = ("BaseWriter",) diff --git a/pylint/reporters/ureports/base_writer.py b/pylint/reporters/ureports/base_writer.py index dba57c86fe..38eba6227e 100644 --- a/pylint/reporters/ureports/base_writer.py +++ b/pylint/reporters/ureports/base_writer.py @@ -1,15 +1,6 @@ -# Copyright (c) 2015-2016, 2018, 2020 Claudiu Popa -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Anthony Sottile -# Copyright (c) 2019, 2021 Pierre Sassoulas -# Copyright (c) 2020 hippo91 -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Nick Drozd -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Universal report objects and some formatting drivers. diff --git a/pylint/reporters/ureports/nodes.py b/pylint/reporters/ureports/nodes.py index a4e32f81e3..f7d6f89c90 100644 --- a/pylint/reporters/ureports/nodes.py +++ b/pylint/reporters/ureports/nodes.py @@ -1,15 +1,6 @@ -# Copyright (c) 2015-2016, 2018, 2020 Claudiu Popa -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Nick Drozd -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Pierre Sassoulas -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Micro reports objects. diff --git a/pylint/reporters/ureports/text_writer.py b/pylint/reporters/ureports/text_writer.py index cb80e67713..b247af4a02 100644 --- a/pylint/reporters/ureports/text_writer.py +++ b/pylint/reporters/ureports/text_writer.py @@ -1,14 +1,6 @@ -# Copyright (c) 2015-2016, 2018-2020 Claudiu Popa -# Copyright (c) 2018, 2020 Anthony Sottile -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2020 hippo91 -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 bot - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Text formatting drivers for ureports.""" diff --git a/pylint/testutils/__init__.py b/pylint/testutils/__init__.py index 2b392d0584..a7ac8680c9 100644 --- a/pylint/testutils/__init__.py +++ b/pylint/testutils/__init__.py @@ -1,32 +1,6 @@ -# Copyright (c) 2012-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2012 FELD Boris -# Copyright (c) 2013-2018, 2020 Claudiu Popa -# Copyright (c) 2013-2014 Google, Inc. -# Copyright (c) 2013 buck@yelp.com -# Copyright (c) 2014 LCD 47 -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Ricardo Gemignani -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Pavel Roskin -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2016 Roy Williams -# Copyright (c) 2016 xmo-odoo -# Copyright (c) 2017 Bryce Guinta -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Mr. Senko -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 谭九鼎 <109224573@qq.com> -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Lefteris Karapetsas - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Functional/non regression tests for pylint.""" diff --git a/pylint/testutils/checker_test_case.py b/pylint/testutils/checker_test_case.py index 739db50810..84df31e049 100644 --- a/pylint/testutils/checker_test_case.py +++ b/pylint/testutils/checker_test_case.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import contextlib import warnings diff --git a/pylint/testutils/configuration_test.py b/pylint/testutils/configuration_test.py index b699f32428..591dc57bd8 100644 --- a/pylint/testutils/configuration_test.py +++ b/pylint/testutils/configuration_test.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Utility functions for configuration testing.""" import copy diff --git a/pylint/testutils/constants.py b/pylint/testutils/constants.py index c46da393ce..305b367538 100644 --- a/pylint/testutils/constants.py +++ b/pylint/testutils/constants.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import operator import re diff --git a/pylint/testutils/decorator.py b/pylint/testutils/decorator.py index 4cee70302f..efa572b59f 100644 --- a/pylint/testutils/decorator.py +++ b/pylint/testutils/decorator.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import functools import optparse # pylint: disable=deprecated-module diff --git a/pylint/testutils/functional/__init__.py b/pylint/testutils/functional/__init__.py index 607c22cb45..d9df9d338b 100644 --- a/pylint/testutils/functional/__init__.py +++ b/pylint/testutils/functional/__init__.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors __all__ = [ "FunctionalTestFile", diff --git a/pylint/testutils/functional/find_functional_tests.py b/pylint/testutils/functional/find_functional_tests.py index cddf0ade73..6fbdded121 100644 --- a/pylint/testutils/functional/find_functional_tests.py +++ b/pylint/testutils/functional/find_functional_tests.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import os from pathlib import Path diff --git a/pylint/testutils/functional/lint_module_output_update.py b/pylint/testutils/functional/lint_module_output_update.py index 0bd46fc0bf..1f5fc8392c 100644 --- a/pylint/testutils/functional/lint_module_output_update.py +++ b/pylint/testutils/functional/lint_module_output_update.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import csv import os diff --git a/pylint/testutils/functional/test_file.py b/pylint/testutils/functional/test_file.py index 1ebc30d0e0..aaaa7e8a9e 100644 --- a/pylint/testutils/functional/test_file.py +++ b/pylint/testutils/functional/test_file.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import configparser import sys diff --git a/pylint/testutils/functional_test_file.py b/pylint/testutils/functional_test_file.py index cb13cd21d8..1a3c07eff8 100644 --- a/pylint/testutils/functional_test_file.py +++ b/pylint/testutils/functional_test_file.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors __all__ = [ "FunctionalTestFile", diff --git a/pylint/testutils/get_test_info.py b/pylint/testutils/get_test_info.py index 32498b8ba2..7a8bb9f92a 100644 --- a/pylint/testutils/get_test_info.py +++ b/pylint/testutils/get_test_info.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from glob import glob from os.path import basename, join, splitext diff --git a/pylint/testutils/global_test_linter.py b/pylint/testutils/global_test_linter.py index 2e6028e302..57506491d6 100644 --- a/pylint/testutils/global_test_linter.py +++ b/pylint/testutils/global_test_linter.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from pylint import checkers diff --git a/pylint/testutils/lint_module_test.py b/pylint/testutils/lint_module_test.py index ed20ed8604..19459a0bb2 100644 --- a/pylint/testutils/lint_module_test.py +++ b/pylint/testutils/lint_module_test.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import csv import operator diff --git a/pylint/testutils/output_line.py b/pylint/testutils/output_line.py index 70dc01f383..62ba9b039d 100644 --- a/pylint/testutils/output_line.py +++ b/pylint/testutils/output_line.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import warnings from typing import Any, NamedTuple, Optional, Sequence, Tuple, TypeVar, Union diff --git a/pylint/testutils/pyreverse.py b/pylint/testutils/pyreverse.py index 34d66d2177..b4e83f5d2b 100644 --- a/pylint/testutils/pyreverse.py +++ b/pylint/testutils/pyreverse.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from typing import List, Optional, Tuple diff --git a/pylint/testutils/reporter_for_tests.py b/pylint/testutils/reporter_for_tests.py index 0c2b456f30..0610e6594e 100644 --- a/pylint/testutils/reporter_for_tests.py +++ b/pylint/testutils/reporter_for_tests.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from io import StringIO from os import getcwd, sep diff --git a/pylint/testutils/tokenize_str.py b/pylint/testutils/tokenize_str.py index 2c4f31acb5..5ce152e6ee 100644 --- a/pylint/testutils/tokenize_str.py +++ b/pylint/testutils/tokenize_str.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import tokenize from io import StringIO diff --git a/pylint/testutils/unittest_linter.py b/pylint/testutils/unittest_linter.py index 37d430fd2b..51f60c7342 100644 --- a/pylint/testutils/unittest_linter.py +++ b/pylint/testutils/unittest_linter.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from typing import Any, Optional diff --git a/pylint/typing.py b/pylint/typing.py index 84c49df558..84488987ac 100644 --- a/pylint/typing.py +++ b/pylint/typing.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """A collection of typing utilities.""" import sys diff --git a/pylint/utils/__init__.py b/pylint/utils/__init__.py index 53d07825ec..7406f7ec6e 100644 --- a/pylint/utils/__init__.py +++ b/pylint/utils/__init__.py @@ -1,44 +1,6 @@ -# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2009 Vincent -# Copyright (c) 2009 Mads Kiilerich -# Copyright (c) 2012-2014 Google, Inc. -# Copyright (c) 2014-2018, 2020 Claudiu Popa -# Copyright (c) 2014-2015 Michal Nowikowski -# Copyright (c) 2014 LCD 47 -# Copyright (c) 2014 Brett Cannon -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2014 Damien Nozay -# Copyright (c) 2015 Aru Sahni -# Copyright (c) 2015 Florian Bruhin -# Copyright (c) 2015 Simu Toni -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Łukasz Rogalski -# Copyright (c) 2016 Moises Lopez -# Copyright (c) 2016 Glenn Matthews -# Copyright (c) 2016 Glenn Matthews -# Copyright (c) 2016 Ashley Whetter -# Copyright (c) 2016 xmo-odoo -# Copyright (c) 2017-2021 Pierre Sassoulas -# Copyright (c) 2017-2018, 2020-2021 hippo91 -# Copyright (c) 2017, 2020 Anthony Sottile -# Copyright (c) 2017-2018 Bryce Guinta -# Copyright (c) 2017 Chris Lamb -# Copyright (c) 2017 Thomas Hisch -# Copyright (c) 2017 Mikhail Fesenko -# Copyright (c) 2017 Craig Citro -# Copyright (c) 2017 Ville Skyttä -# Copyright (c) 2018 ssolanki -# Copyright (c) 2018 Bryce Guinta -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Reverb C -# Copyright (c) 2018 Nick Drozd -# Copyright (c) 2020 Peter Kolbus -# Copyright (c) 2020 Damien Baty -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Some various utilities and helper classes, most of them used in the main pylint class diff --git a/pylint/utils/ast_walker.py b/pylint/utils/ast_walker.py index f9e573a95b..08fc3af925 100644 --- a/pylint/utils/ast_walker.py +++ b/pylint/utils/ast_walker.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import collections import traceback diff --git a/pylint/utils/docs.py b/pylint/utils/docs.py index 848a498684..22412b803c 100644 --- a/pylint/utils/docs.py +++ b/pylint/utils/docs.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Various helper functions to create the docs of a linter object.""" import sys diff --git a/pylint/utils/file_state.py b/pylint/utils/file_state.py index 30e91c3ea1..b7f09a6b9c 100644 --- a/pylint/utils/file_state.py +++ b/pylint/utils/file_state.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import collections import sys diff --git a/pylint/utils/linterstats.py b/pylint/utils/linterstats.py index 54b98d533e..e09e0ce432 100644 --- a/pylint/utils/linterstats.py +++ b/pylint/utils/linterstats.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import sys from typing import Dict, List, Optional, Set, cast diff --git a/pylint/utils/pragma_parser.py b/pylint/utils/pragma_parser.py index e09cba7c9e..090a336fc5 100644 --- a/pylint/utils/pragma_parser.py +++ b/pylint/utils/pragma_parser.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import re from collections import namedtuple diff --git a/pylint/utils/utils.py b/pylint/utils/utils.py index 14f57a16c1..835351ec37 100644 --- a/pylint/utils/utils.py +++ b/pylint/utils/utils.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors try: diff --git a/tbump.toml b/tbump.toml index 6744a745ed..2116fdb7cc 100644 --- a/tbump.toml +++ b/tbump.toml @@ -40,10 +40,6 @@ cmd = "contributors-txt-normalize-configuration -a script/.contributors_aliases. name = "Upgrade the contributors list" cmd = "python3 script/create_contributor_list.py" -[[before_commit]] -name = "Upgrade copyrights" -cmd = "pip3 install copyrite;copyrite --contribution-threshold 1 --change-threshold 3 --backend-type git --aliases=.copyrite_aliases . --jobs=8" - [[before_commit]] name = "Apply pre-commit" cmd = "pre-commit run --all-files||echo 'Hack so this command does not fail'" diff --git a/tests/benchmark/test_baseline_benchmarks.py b/tests/benchmark/test_baseline_benchmarks.py index 5617996dfd..b4550db431 100644 --- a/tests/benchmark/test_baseline_benchmarks.py +++ b/tests/benchmark/test_baseline_benchmarks.py @@ -1,14 +1,8 @@ """Profiles basic -jX functionality.""" -# Copyright (c) 2020-2021 Pierre Sassoulas -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Claudiu Popa -# Copyright (c) 2020 Frank Harrison -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Ville Skyttä -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors # pylint: disable=missing-function-docstring diff --git a/tests/checkers/unittest_base.py b/tests/checkers/unittest_base.py index c1c76610ca..b0238c3eae 100644 --- a/tests/checkers/unittest_base.py +++ b/tests/checkers/unittest_base.py @@ -1,29 +1,6 @@ -# Copyright (c) 2013-2015 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2013-2014 Google, Inc. -# Copyright (c) 2015-2018, 2020 Claudiu Popa -# Copyright (c) 2015 Dmitry Pribysh -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2016 Yannack -# Copyright (c) 2017, 2019-2021 Pierre Sassoulas -# Copyright (c) 2017, 2019 Ville Skyttä -# Copyright (c) 2017 ttenhoeve-aa -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2018 Fureigh -# Copyright (c) 2018 glmdgrielson <32415403+glmdgrielson@users.noreply.github.com> -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020-2021 hippo91 -# Copyright (c) 2020 ethan-leba -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2020 bernie gray -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Yilei "Dolee" Yang -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021-2022 Or Bahari -# Copyright (c) 2021 David Gilman - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Unittest for the base checker.""" diff --git a/tests/checkers/unittest_base_checker.py b/tests/checkers/unittest_base_checker.py index ba5e8dfcc2..7efdf2aba9 100644 --- a/tests/checkers/unittest_base_checker.py +++ b/tests/checkers/unittest_base_checker.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Unittest for the BaseChecker class.""" diff --git a/tests/checkers/unittest_design.py b/tests/checkers/unittest_design.py index b60106590e..95baea3b21 100644 --- a/tests/checkers/unittest_design.py +++ b/tests/checkers/unittest_design.py @@ -1,11 +1,6 @@ -# Copyright (c) 2021 Pierre Sassoulas -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Mike Fiedler -# Copyright (c) 2021 Ashley Whetter -# Copyright (c) 2021 Rebecca Turner - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import astroid diff --git a/tests/checkers/unittest_format.py b/tests/checkers/unittest_format.py index 30972cb5c7..8c5a2836ce 100644 --- a/tests/checkers/unittest_format.py +++ b/tests/checkers/unittest_format.py @@ -1,30 +1,6 @@ -# Copyright (c) 2009-2011, 2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2012 FELD Boris -# Copyright (c) 2013-2014 Google, Inc. -# Copyright (c) 2014-2020 Claudiu Popa -# Copyright (c) 2014 buck -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Harut -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Petr Pulc -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2017 Krzysztof Czapla -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2017 James M. Allen -# Copyright (c) 2017 vinnyrose -# Copyright (c) 2018, 2020 Bryce Guinta -# Copyright (c) 2018 Bryce Guinta -# Copyright (c) 2018, 2020 Anthony Sottile -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 hippo91 -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Check format checker helper functions.""" diff --git a/tests/checkers/unittest_imports.py b/tests/checkers/unittest_imports.py index c5285d2598..7f1181339e 100644 --- a/tests/checkers/unittest_imports.py +++ b/tests/checkers/unittest_imports.py @@ -1,21 +1,6 @@ -# Copyright (c) 2015-2020 Claudiu Popa -# Copyright (c) 2015 Dmitry Pribysh -# Copyright (c) 2015 Cezar -# Copyright (c) 2015 James Morgensen -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2018 Hornwitser -# Copyright (c) 2018 Marianna Polatoglou -# Copyright (c) 2018 Ville Skyttä -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Nick Drozd -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Unit tests for the imports checker.""" diff --git a/tests/checkers/unittest_misc.py b/tests/checkers/unittest_misc.py index bd15a932ed..9c0ec70895 100644 --- a/tests/checkers/unittest_misc.py +++ b/tests/checkers/unittest_misc.py @@ -1,20 +1,6 @@ -# Copyright (c) 2013-2014, 2016-2020 Claudiu Popa -# Copyright (c) 2013-2014 Google, Inc. -# Copyright (c) 2013-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2016 glegoux -# Copyright (c) 2018 Rogalski, Lukasz -# Copyright (c) 2018 Anthony Sottile -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 hippo91 -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Tests for the misc checker.""" diff --git a/tests/checkers/unittest_refactoring.py b/tests/checkers/unittest_refactoring.py index 86ed28a4da..2a28c0bede 100644 --- a/tests/checkers/unittest_refactoring.py +++ b/tests/checkers/unittest_refactoring.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import os diff --git a/tests/checkers/unittest_similar.py b/tests/checkers/unittest_similar.py index 2f2b43115e..3911db93bc 100644 --- a/tests/checkers/unittest_similar.py +++ b/tests/checkers/unittest_similar.py @@ -1,24 +1,6 @@ -# Copyright (c) 2010, 2012, 2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2012 Ry4an Brase -# Copyright (c) 2014 Google, Inc. -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016-2018, 2020 Claudiu Popa -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2018 Scott Worley -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2019 Taewon D. Kim -# Copyright (c) 2020-2021 hippo91 -# Copyright (c) 2020 Frank Harrison -# Copyright (c) 2020 Eli Fine -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Maksym Humetskyi -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Aditya Gupta - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from contextlib import redirect_stdout from io import StringIO diff --git a/tests/checkers/unittest_spelling.py b/tests/checkers/unittest_spelling.py index 838e4755a4..6f7308aaa0 100644 --- a/tests/checkers/unittest_spelling.py +++ b/tests/checkers/unittest_spelling.py @@ -1,22 +1,6 @@ -# Copyright (c) 2014-2018, 2020 Claudiu Popa -# Copyright (c) 2014 Michal Nowikowski -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2017, 2020 Pedro Algarvio -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2018, 2020 Anthony Sottile -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2019 agutole -# Copyright (c) 2020 Ganden Schaffner -# Copyright (c) 2020 hippo91 -# Copyright (c) 2021 Jaehoon Hwang -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Eli Fine - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Unittest for the spelling checker.""" diff --git a/tests/checkers/unittest_stdlib.py b/tests/checkers/unittest_stdlib.py index 890fa7a8a9..480da89921 100644 --- a/tests/checkers/unittest_stdlib.py +++ b/tests/checkers/unittest_stdlib.py @@ -1,15 +1,6 @@ -# Copyright (c) 2015-2018, 2020 Claudiu Popa -# Copyright (c) 2015 Cezar -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2017 Martin -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 hippo91 -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import contextlib from typing import Any, Callable, Iterator, Optional, Union diff --git a/tests/checkers/unittest_strings.py b/tests/checkers/unittest_strings.py index 9f2d378016..529a9284fc 100644 --- a/tests/checkers/unittest_strings.py +++ b/tests/checkers/unittest_strings.py @@ -1,15 +1,6 @@ -# Copyright (c) 2015-2018, 2020 Claudiu Popa -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2018 Lucas Cimon -# Copyright (c) 2018 Yury Gribov -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 hippo91 -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from pylint.checkers import strings diff --git a/tests/checkers/unittest_typecheck.py b/tests/checkers/unittest_typecheck.py index 4564a461ef..736a16ca20 100644 --- a/tests/checkers/unittest_typecheck.py +++ b/tests/checkers/unittest_typecheck.py @@ -1,29 +1,6 @@ -# Copyright (c) 2014 Google, Inc. -# Copyright (c) 2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2014 Holger Peters -# Copyright (c) 2015-2020 Claudiu Popa -# Copyright (c) 2015 Dmitry Pribysh -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2016 Filipe Brandenburger -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2018 Bryce Guinta -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2019 Martin Vielsmaier -# Copyright (c) 2019 Federico Bond -# Copyright (c) 2020 Julien Palard -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Damien Baty -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 David Liu -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 David Gilman - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import astroid import pytest diff --git a/tests/checkers/unittest_utils.py b/tests/checkers/unittest_utils.py index 1b916b98a6..e27443f26d 100644 --- a/tests/checkers/unittest_utils.py +++ b/tests/checkers/unittest_utils.py @@ -1,22 +1,6 @@ -# Copyright (c) 2010 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2013-2020 Claudiu Popa -# Copyright (c) 2013-2014 Google, Inc. -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2018 Alan Chan -# Copyright (c) 2018 Caio Carrara -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2019 Nathan Marrow -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Jaehoon Hwang -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Tests for the pylint.checkers.utils module.""" diff --git a/tests/checkers/unittest_variables.py b/tests/checkers/unittest_variables.py index f42c3fbae6..e9ebbd6137 100644 --- a/tests/checkers/unittest_variables.py +++ b/tests/checkers/unittest_variables.py @@ -1,24 +1,6 @@ -# Copyright (c) 2014-2018, 2020 Claudiu Popa -# Copyright (c) 2014 Google, Inc. -# Copyright (c) 2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2017 Ville Skyttä -# Copyright (c) 2018 Bryce Guinta -# Copyright (c) 2018 Bryce Guinta -# Copyright (c) 2018 mar-chi-pan -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Andrew Simmons -# Copyright (c) 2020 Andrew Simmons -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Sergei Lebedev <185856+superbobry@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import os import re diff --git a/tests/config/test_functional_config_loading.py b/tests/config/test_functional_config_loading.py index 1937435f73..174af48b89 100644 --- a/tests/config/test_functional_config_loading.py +++ b/tests/config/test_functional_config_loading.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """This launches the configuration functional tests. This permits to test configuration files by providing a file with the appropriate extension in the ``tests/config/functional`` diff --git a/tests/config/unittest_config.py b/tests/config/unittest_config.py index fd56a3f928..16e12350e3 100644 --- a/tests/config/unittest_config.py +++ b/tests/config/unittest_config.py @@ -1,16 +1,6 @@ -# Copyright (c) 2015 Aru Sahni -# Copyright (c) 2016-2018, 2020 Claudiu Popa -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2017 Ville Skyttä -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Unit tests for the config module.""" diff --git a/tests/extensions/test_check_docs_utils.py b/tests/extensions/test_check_docs_utils.py index 2fa5719fd5..abc0751d82 100644 --- a/tests/extensions/test_check_docs_utils.py +++ b/tests/extensions/test_check_docs_utils.py @@ -1,16 +1,6 @@ -# Copyright (c) 2016-2018, 2020 Claudiu Popa -# Copyright (c) 2016, 2019 Ashley Whetter -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2018 Anthony Sottile -# Copyright (c) 2019, 2021 Pierre Sassoulas -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Damien Baty -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Unit tests for utils functions in :mod:`pylint.extensions._check_docs_utils`.""" import astroid diff --git a/tests/input/similar_lines_a.py b/tests/input/similar_lines_a.py index 65a72a79d5..bbd13b5f37 100644 --- a/tests/input/similar_lines_a.py +++ b/tests/input/similar_lines_a.py @@ -1,7 +1,6 @@ """ A file designed to have lines of similarity when compared to similar_lines_b We use lorm-ipsum to generate 'random' code. """ -# Copyright (c) 2020 Frank Harrison def adipiscing(elit): diff --git a/tests/input/similar_lines_b.py b/tests/input/similar_lines_b.py index 21634883d8..fbca78fb9b 100644 --- a/tests/input/similar_lines_b.py +++ b/tests/input/similar_lines_b.py @@ -2,7 +2,6 @@ similarity when compared to its sister file As with the sister file, we use lorm-ipsum to generate 'random' code. """ -# Copyright (c) 2020 Frank Harrison class Nulla: diff --git a/tests/lint/unittest_expand_modules.py b/tests/lint/unittest_expand_modules.py index bb00a67ace..6c0855e9d4 100644 --- a/tests/lint/unittest_expand_modules.py +++ b/tests/lint/unittest_expand_modules.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import re diff --git a/tests/lint/unittest_lint.py b/tests/lint/unittest_lint.py index 9dd6ae4dec..04b94d4e8e 100644 --- a/tests/lint/unittest_lint.py +++ b/tests/lint/unittest_lint.py @@ -1,41 +1,7 @@ -# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2011-2014 Google, Inc. -# Copyright (c) 2012 Kevin Jing Qiu -# Copyright (c) 2012 Anthony VEREZ -# Copyright (c) 2012 FELD Boris -# Copyright (c) 2013-2018, 2020 Claudiu Popa -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Florian Bruhin -# Copyright (c) 2015 Noam Yorav-Raphael -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016-2017 Derek Gustafson -# Copyright (c) 2016 Glenn Matthews -# Copyright (c) 2016 Glenn Matthews -# Copyright (c) 2017-2021 Pierre Sassoulas -# Copyright (c) 2017, 2021 Ville Skyttä -# Copyright (c) 2017 Craig Citro -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2018, 2020 Anthony Sottile -# Copyright (c) 2018 Matus Valo -# Copyright (c) 2018 Scott Worley -# Copyright (c) 2018 Randall Leeds -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Reverb C -# Copyright (c) 2019 Janne Rönkkö -# Copyright (c) 2019 Trevor Bekolay -# Copyright (c) 2019 Andres Perez Hortal -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 Martin Vielsmaier -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Damien Baty -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Michal Vasilek -# Copyright (c) 2021 Eisuke Kawashima -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors + # pylint: disable=redefined-outer-name import os diff --git a/tests/message/conftest.py b/tests/message/conftest.py index e30dbb5355..aee6f50194 100644 --- a/tests/message/conftest.py +++ b/tests/message/conftest.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors # pylint: disable=redefined-outer-name diff --git a/tests/message/test_no_removed_msgid_or_symbol_used.py b/tests/message/test_no_removed_msgid_or_symbol_used.py index c6ece36794..d829c2943a 100644 --- a/tests/message/test_no_removed_msgid_or_symbol_used.py +++ b/tests/message/test_no_removed_msgid_or_symbol_used.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from pylint.constants import DELETED_MESSAGES from pylint.lint import PyLinter diff --git a/tests/message/unittest_message.py b/tests/message/unittest_message.py index d402e1d330..f8397cc3cb 100644 --- a/tests/message/unittest_message.py +++ b/tests/message/unittest_message.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from typing import ValuesView diff --git a/tests/message/unittest_message_definition.py b/tests/message/unittest_message_definition.py index 2015c21549..51211b8ba2 100644 --- a/tests/message/unittest_message_definition.py +++ b/tests/message/unittest_message_definition.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import sys from unittest import mock diff --git a/tests/message/unittest_message_definition_store.py b/tests/message/unittest_message_definition_store.py index e13163080a..96756ce866 100644 --- a/tests/message/unittest_message_definition_store.py +++ b/tests/message/unittest_message_definition_store.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from contextlib import redirect_stdout from io import StringIO diff --git a/tests/message/unittest_message_id_store.py b/tests/message/unittest_message_id_store.py index b44e33c6db..4be49b1826 100644 --- a/tests/message/unittest_message_id_store.py +++ b/tests/message/unittest_message_id_store.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from pathlib import Path from typing import Dict, ValuesView diff --git a/tests/primer/test_primer_external.py b/tests/primer/test_primer_external.py index 193eabf1d8..c9ec9f167d 100644 --- a/tests/primer/test_primer_external.py +++ b/tests/primer/test_primer_external.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import json import logging import subprocess diff --git a/tests/primer/test_primer_stdlib.py b/tests/primer/test_primer_stdlib.py index 824c1feac9..cb84437fbd 100644 --- a/tests/primer/test_primer_stdlib.py +++ b/tests/primer/test_primer_stdlib.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import contextlib import io diff --git a/tests/profile/test_profile_against_externals.py b/tests/profile/test_profile_against_externals.py index 7be4930e82..643896623e 100644 --- a/tests/profile/test_profile_against_externals.py +++ b/tests/profile/test_profile_against_externals.py @@ -1,11 +1,8 @@ """Profiles basic -jX functionality.""" -# Copyright (c) 2020-2021 Pierre Sassoulas -# Copyright (c) 2020 Frank Harrison -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors # pylint: disable=missing-function-docstring diff --git a/tests/pyreverse/test_diadefs.py b/tests/pyreverse/test_diadefs.py index d9a3589360..1a43daaa99 100644 --- a/tests/pyreverse/test_diadefs.py +++ b/tests/pyreverse/test_diadefs.py @@ -1,25 +1,6 @@ -# Copyright (c) 2008-2010, 2013 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2014 Google, Inc. -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015-2020 Claudiu Popa -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Damien Baty -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Takahide Nojima -# Copyright (c) 2021 Ville Skyttä -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler -# Copyright (c) 2021 Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> -# Copyright (c) 2021 bot - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Unit test for the extensions.diadefslib modules.""" # pylint: disable=redefined-outer-name diff --git a/tests/pyreverse/test_diagrams.py b/tests/pyreverse/test_diagrams.py index b307a37d8e..6bf0ab7064 100644 --- a/tests/pyreverse/test_diagrams.py +++ b/tests/pyreverse/test_diagrams.py @@ -1,9 +1,6 @@ -# Copyright (c) 2021 Pierre Sassoulas -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Takahide Nojima -# # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Unit test for the diagrams modules.""" from typing import Callable diff --git a/tests/pyreverse/test_inspector.py b/tests/pyreverse/test_inspector.py index 3a4ee423c2..c93e802338 100644 --- a/tests/pyreverse/test_inspector.py +++ b/tests/pyreverse/test_inspector.py @@ -1,17 +1,6 @@ -# Copyright (c) 2015-2018, 2020 Claudiu Popa -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Damien Baty -# Copyright (c) 2021 Takahide Nojima -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler -# Copyright (c) 2021 Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """For the visitors.diadefs module.""" # pylint: disable=redefined-outer-name diff --git a/tests/pyreverse/test_printer.py b/tests/pyreverse/test_printer.py index 5406c6e83f..26faea74f4 100644 --- a/tests/pyreverse/test_printer.py +++ b/tests/pyreverse/test_printer.py @@ -1,9 +1,6 @@ -# Copyright (c) 2021 Pierre Sassoulas -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from typing import Type diff --git a/tests/pyreverse/test_printer_factory.py b/tests/pyreverse/test_printer_factory.py index 73a5e2670b..1f00559551 100644 --- a/tests/pyreverse/test_printer_factory.py +++ b/tests/pyreverse/test_printer_factory.py @@ -1,7 +1,6 @@ -# Copyright (c) 2021 Andreas Finkler - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Unit tests for pylint.pyreverse.printer_factory.""" diff --git a/tests/pyreverse/test_utils.py b/tests/pyreverse/test_utils.py index 322b5bea24..095939ad66 100644 --- a/tests/pyreverse/test_utils.py +++ b/tests/pyreverse/test_utils.py @@ -1,12 +1,6 @@ -# Copyright (c) 2021 Pierre Sassoulas -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Ashley Whetter -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html -# For details: https://github.com/PyCQA/pylint/blob/master/LICENSE +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Tests for pylint.pyreverse.utils.""" diff --git a/tests/pyreverse/test_writer.py b/tests/pyreverse/test_writer.py index 1226182138..3864bd51ee 100644 --- a/tests/pyreverse/test_writer.py +++ b/tests/pyreverse/test_writer.py @@ -1,21 +1,6 @@ -# Copyright (c) 2008, 2010, 2013 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2014-2018, 2020 Claudiu Popa -# Copyright (c) 2014 Google, Inc. -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2018 Ville Skyttä -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Andreas Finkler -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Unit test for ``DiagramWriter``.""" diff --git a/tests/test_check_parallel.py b/tests/test_check_parallel.py index 5bc1a6f279..7011461b2c 100644 --- a/tests/test_check_parallel.py +++ b/tests/test_check_parallel.py @@ -1,13 +1,8 @@ -"""Puts the check_parallel system under test.""" -# Copyright (c) 2020-2021 Pierre Sassoulas -# Copyright (c) 2020 Frank Harrison -# Copyright (c) 2021 Jaehoon Hwang -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Julien Palard -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors + +"""Puts the check_parallel system under test.""" # pylint: disable=protected-access,missing-function-docstring,no-self-use diff --git a/tests/test_func.py b/tests/test_func.py index 492797ec21..a372b4a284 100644 --- a/tests/test_func.py +++ b/tests/test_func.py @@ -1,22 +1,6 @@ -# Copyright (c) 2006-2010, 2013-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2012 FELD Boris -# Copyright (c) 2013-2014 Google, Inc. -# Copyright (c) 2014-2020 Claudiu Popa -# Copyright (c) 2014 Michal Nowikowski -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2017 Michka Popoff -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Functional/non regression tests for pylint.""" diff --git a/tests/test_functional.py b/tests/test_functional.py index 27fda03097..86f8fe73b3 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -1,25 +1,6 @@ -# Copyright (c) 2014-2018, 2020 Claudiu Popa -# Copyright (c) 2014 Google, Inc. -# Copyright (c) 2014 Michal Nowikowski -# Copyright (c) 2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Łukasz Rogalski -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2018 Lucas Cimon -# Copyright (c) 2018 Ville Skyttä -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Mr. Senko -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Damien Baty -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2020 bernie gray -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Functional full-module tests for PyLint.""" import sys diff --git a/tests/test_import_graph.py b/tests/test_import_graph.py index 9a4ea59a63..7dc06307f9 100644 --- a/tests/test_import_graph.py +++ b/tests/test_import_graph.py @@ -1,21 +1,7 @@ -# Copyright (c) 2006-2008, 2010, 2013 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2012 FELD Boris -# Copyright (c) 2014-2018, 2020 Claudiu Popa -# Copyright (c) 2014 Google, Inc. -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2018 Reverb C -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Damien Baty -# Copyright (c) 2020 Frank Harrison -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Andrew Howe - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors + # pylint: disable=redefined-outer-name import os diff --git a/tests/test_numversion.py b/tests/test_numversion.py index 46f154da73..beffc31bb7 100644 --- a/tests/test_numversion.py +++ b/tests/test_numversion.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import pytest diff --git a/tests/test_regr.py b/tests/test_regr.py index 2980057c6e..486c9b8b75 100644 --- a/tests/test_regr.py +++ b/tests/test_regr.py @@ -1,21 +1,6 @@ -# Copyright (c) 2006-2011, 2013-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2012 FELD Boris -# Copyright (c) 2014 Google, Inc. -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015-2020 Claudiu Popa -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016-2017 Derek Gustafson -# Copyright (c) 2018 Reverb C -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 hippo91 -# Copyright (c) 2020 Damien Baty -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Andrew Haigh -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Non regression tests for pylint, which requires a too specific configuration to be incorporated in the automatic functional test framework diff --git a/tests/test_self.py b/tests/test_self.py index 0018b47a9b..f2911ee096 100644 --- a/tests/test_self.py +++ b/tests/test_self.py @@ -1,39 +1,6 @@ -# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2014-2020 Claudiu Popa -# Copyright (c) 2014 Vlad Temian -# Copyright (c) 2014 Google, Inc. -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2016 Moises Lopez -# Copyright (c) 2017, 2019-2021 Pierre Sassoulas -# Copyright (c) 2017, 2021 Ville Skyttä -# Copyright (c) 2017, 2020 hippo91 -# Copyright (c) 2017, 2019 Thomas Hisch -# Copyright (c) 2017 Daniel Miller -# Copyright (c) 2017 Bryce Guinta -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2018 Jason Owen -# Copyright (c) 2018 Jace Browning -# Copyright (c) 2018 Reverb C -# Copyright (c) 2019 Hugues -# Copyright (c) 2019 Hugo van Kemenade -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 Frank Harrison -# Copyright (c) 2020 Matěj Grabovský -# Copyright (c) 2020 Pieter Engelbrecht -# Copyright (c) 2020 Clément Pit-Claudel -# Copyright (c) 2020 Anthony Sottile -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Mark Bell -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Dr. Nick -# Copyright (c) 2021 Andreas Finkler -# Copyright (c) 2021 chohner -# Copyright (c) 2021 Louis Sautier - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors # pylint: disable=too-many-public-methods diff --git a/tests/testutils/test_decorator.py b/tests/testutils/test_decorator.py index 4ab9d04f04..64594b39c3 100644 --- a/tests/testutils/test_decorator.py +++ b/tests/testutils/test_decorator.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import pytest diff --git a/tests/testutils/test_functional_testutils.py b/tests/testutils/test_functional_testutils.py index 032f6ac120..136bda749d 100644 --- a/tests/testutils/test_functional_testutils.py +++ b/tests/testutils/test_functional_testutils.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Tests for the functional test framework.""" diff --git a/tests/testutils/test_lint_module_output_update.py b/tests/testutils/test_lint_module_output_update.py index ad414a9ddb..332463b033 100644 --- a/tests/testutils/test_lint_module_output_update.py +++ b/tests/testutils/test_lint_module_output_update.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors # pylint: disable=redefined-outer-name from pathlib import Path diff --git a/tests/testutils/test_output_line.py b/tests/testutils/test_output_line.py index 48ae107213..6a0e355184 100644 --- a/tests/testutils/test_output_line.py +++ b/tests/testutils/test_output_line.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors # pylint: disable=redefined-outer-name diff --git a/tests/testutils/test_package_to_lint.py b/tests/testutils/test_package_to_lint.py index bf90db3e74..a79faa60c3 100644 --- a/tests/testutils/test_package_to_lint.py +++ b/tests/testutils/test_package_to_lint.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors from pylint.testutils.primer import PRIMER_DIRECTORY_PATH, PackageToLint diff --git a/tests/unittest_reporters_json.py b/tests/unittest_reporters_json.py index be7aadabac..66da977a37 100644 --- a/tests/unittest_reporters_json.py +++ b/tests/unittest_reporters_json.py @@ -1,17 +1,6 @@ -# Copyright (c) 2014 Vlad Temian -# Copyright (c) 2015-2018, 2020 Claudiu Popa -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2017 guillaume2 -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 hippo91 -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors """Test for the JSON reporter.""" diff --git a/tests/unittest_reporting.py b/tests/unittest_reporting.py index d6cb182206..4bbef21151 100644 --- a/tests/unittest_reporting.py +++ b/tests/unittest_reporting.py @@ -1,20 +1,7 @@ -# Copyright (c) 2013-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2014-2018, 2020 Claudiu Popa -# Copyright (c) 2014 Calin Don -# Copyright (c) 2014 Google, Inc. -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016-2017 Derek Gustafson -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2019-2021 Pierre Sassoulas -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 hippo91 -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 ruro - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors + # pylint: disable=redefined-outer-name import sys import warnings diff --git a/tests/utils/unittest_ast_walker.py b/tests/utils/unittest_ast_walker.py index 9d350830a1..8f24bdaaa3 100644 --- a/tests/utils/unittest_ast_walker.py +++ b/tests/utils/unittest_ast_walker.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import warnings from typing import Dict, Set diff --git a/tests/utils/unittest_utils.py b/tests/utils/unittest_utils.py index 485756e7da..2f9ed9f4b7 100644 --- a/tests/utils/unittest_utils.py +++ b/tests/utils/unittest_utils.py @@ -1,23 +1,6 @@ -# Copyright (c) 2013-2014 Google, Inc. -# Copyright (c) 2013-2014 LOGILAB S.A. (Paris, FRANCE) -# Copyright (c) 2014 Arun Persaud -# Copyright (c) 2015-2018, 2020 Claudiu Popa -# Copyright (c) 2015 Aru Sahni -# Copyright (c) 2015 Ionel Cristian Maries -# Copyright (c) 2016 Derek Gustafson -# Copyright (c) 2016 Glenn Matthews -# Copyright (c) 2017-2019, 2021 Pierre Sassoulas -# Copyright (c) 2017-2018, 2020 Anthony Sottile -# Copyright (c) 2017 ttenhoeve-aa -# Copyright (c) 2017 Łukasz Rogalski -# Copyright (c) 2019 Ashley Whetter -# Copyright (c) 2020 Peter Kolbus -# Copyright (c) 2020 hippo91 -# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors import io From ec4a3f7f1eac9e605b35d1ac56680e1608c48be3 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Tue, 1 Mar 2022 16:04:49 +0100 Subject: [PATCH 081/473] Add a pre-commit hook to check the copyright notice Fix the existing file so they have a notice. No header for setup.py or examples or doc --- .pre-commit-config.yaml | 9 ++++++++- doc/conf.py | 5 ++++- doc/exts/pylint_extensions.py | 3 ++- doc/exts/pylint_features.py | 3 ++- doc/exts/pylint_messages.py | 2 +- pylint/__init__.py | 2 +- pylint/__main__.py | 2 +- pylint/__pkginfo__.py | 3 ++- pylint/checkers/__init__.py | 2 +- pylint/checkers/async.py | 2 +- pylint/checkers/base.py | 2 +- pylint/checkers/base_checker.py | 3 ++- pylint/checkers/classes/__init__.py | 2 +- pylint/checkers/classes/class_checker.py | 2 +- pylint/checkers/classes/special_methods_checker.py | 2 +- pylint/checkers/deprecated.py | 2 +- pylint/checkers/design_analysis.py | 2 +- pylint/checkers/ellipsis_checker.py | 4 ++++ pylint/checkers/exceptions.py | 2 +- pylint/checkers/format.py | 2 +- pylint/checkers/imports.py | 2 +- pylint/checkers/logging.py | 2 +- pylint/checkers/mapreduce_checker.py | 3 ++- pylint/checkers/misc.py | 3 +-- pylint/checkers/modified_iterating_checker.py | 2 +- pylint/checkers/newstyle.py | 2 +- pylint/checkers/non_ascii_names.py | 2 +- pylint/checkers/raw_metrics.py | 2 +- pylint/checkers/refactoring/__init__.py | 2 +- .../checkers/refactoring/implicit_booleaness_checker.py | 3 ++- pylint/checkers/refactoring/not_checker.py | 3 +-- pylint/checkers/refactoring/recommendation_checker.py | 3 ++- pylint/checkers/refactoring/refactoring_checker.py | 2 +- pylint/checkers/similar.py | 2 +- pylint/checkers/spelling.py | 2 +- pylint/checkers/stdlib.py | 2 +- pylint/checkers/strings.py | 2 +- pylint/checkers/threading_checker.py | 2 +- pylint/checkers/typecheck.py | 2 +- pylint/checkers/unicode.py | 2 +- pylint/checkers/unsupported_version.py | 2 +- pylint/checkers/utils.py | 2 +- pylint/checkers/variables.py | 2 +- pylint/config/__init__.py | 2 +- pylint/config/config_initialization.py | 2 +- pylint/config/configuration_mixin.py | 2 +- pylint/config/find_default_config_files.py | 2 +- pylint/config/man_help_formatter.py | 2 +- pylint/config/option.py | 2 +- pylint/config/option_manager_mixin.py | 3 +-- pylint/config/option_parser.py | 2 +- pylint/config/options_provider_mixin.py | 3 +-- pylint/constants.py | 3 ++- pylint/epylint.py | 2 +- pylint/exceptions.py | 2 +- pylint/extensions/__init__.py | 2 +- pylint/extensions/_check_docs_utils.py | 2 +- pylint/extensions/bad_builtin.py | 2 +- pylint/extensions/broad_try_clause.py | 2 +- pylint/extensions/check_elif.py | 2 +- pylint/extensions/code_style.py | 4 ++++ pylint/extensions/comparetozero.py | 2 +- pylint/extensions/comparison_placement.py | 2 +- pylint/extensions/confusing_elif.py | 2 +- pylint/extensions/consider_ternary_expression.py | 4 ++++ pylint/extensions/docparams.py | 2 +- pylint/extensions/docstyle.py | 2 +- pylint/extensions/empty_comment.py | 4 ++++ pylint/extensions/emptystring.py | 2 +- pylint/extensions/eq_without_hash.py | 1 + pylint/extensions/for_any_all.py | 4 ++++ pylint/extensions/mccabe.py | 2 +- pylint/extensions/overlapping_exceptions.py | 2 +- pylint/extensions/private_import.py | 4 ++++ pylint/extensions/redefined_variable_type.py | 2 +- pylint/extensions/set_membership.py | 4 ++++ pylint/extensions/typing.py | 4 ++++ pylint/extensions/while_used.py | 4 ++++ pylint/graph.py | 2 +- pylint/interfaces.py | 2 +- pylint/lint/__init__.py | 2 +- pylint/lint/expand_modules.py | 4 ++++ pylint/lint/parallel.py | 2 +- pylint/lint/pylinter.py | 2 +- pylint/lint/report_functions.py | 2 +- pylint/lint/run.py | 2 +- pylint/lint/utils.py | 2 +- pylint/message/__init__.py | 2 +- pylint/message/message.py | 3 +-- pylint/message/message_definition.py | 2 +- pylint/message/message_definition_store.py | 2 +- pylint/message/message_id_store.py | 3 ++- pylint/pyreverse/__init__.py | 2 +- pylint/pyreverse/diadefslib.py | 2 +- pylint/pyreverse/diagrams.py | 2 +- pylint/pyreverse/dot_printer.py | 2 +- pylint/pyreverse/inspector.py | 2 +- pylint/pyreverse/main.py | 2 +- pylint/pyreverse/mermaidjs_printer.py | 2 +- pylint/pyreverse/plantuml_printer.py | 2 +- pylint/pyreverse/printer.py | 2 +- pylint/pyreverse/printer_factory.py | 2 +- pylint/pyreverse/utils.py | 2 +- pylint/pyreverse/vcg_printer.py | 2 +- pylint/pyreverse/writer.py | 2 +- pylint/reporters/__init__.py | 2 +- pylint/reporters/base_reporter.py | 2 +- pylint/reporters/collecting_reporter.py | 3 ++- pylint/reporters/json_reporter.py | 2 +- pylint/reporters/multi_reporter.py | 3 +-- pylint/reporters/reports_handler_mix_in.py | 2 +- pylint/reporters/text.py | 2 +- pylint/reporters/ureports/__init__.py | 2 +- pylint/reporters/ureports/base_writer.py | 2 +- pylint/reporters/ureports/nodes.py | 2 +- pylint/reporters/ureports/text_writer.py | 2 +- pylint/testutils/__init__.py | 2 +- pylint/testutils/checker_test_case.py | 2 +- pylint/testutils/configuration_test.py | 2 +- pylint/testutils/constants.py | 2 +- pylint/testutils/decorator.py | 2 +- pylint/testutils/functional/__init__.py | 2 +- pylint/testutils/functional/find_functional_tests.py | 2 +- pylint/testutils/functional/lint_module_output_update.py | 2 +- pylint/testutils/functional/test_file.py | 2 +- pylint/testutils/functional_test_file.py | 2 +- pylint/testutils/get_test_info.py | 2 +- pylint/testutils/global_test_linter.py | 3 +-- pylint/testutils/lint_module_test.py | 2 +- pylint/testutils/output_line.py | 2 +- pylint/testutils/primer.py | 4 ++++ pylint/testutils/pyreverse.py | 2 +- pylint/testutils/reporter_for_tests.py | 2 +- pylint/testutils/tokenize_str.py | 2 +- pylint/testutils/unittest_linter.py | 2 +- pylint/typing.py | 2 +- pylint/utils/__init__.py | 2 +- pylint/utils/ast_walker.py | 2 +- pylint/utils/docs.py | 3 ++- pylint/utils/file_state.py | 2 +- pylint/utils/linterstats.py | 2 +- pylint/utils/pragma_parser.py | 2 +- pylint/utils/utils.py | 3 +-- tests/benchmark/test_baseline_benchmarks.py | 2 +- tests/checkers/__init__.py | 3 +++ tests/checkers/conftest.py | 4 ++++ tests/checkers/unittest_base.py | 2 +- tests/checkers/unittest_base_checker.py | 2 +- tests/checkers/unittest_deprecated.py | 4 ++++ tests/checkers/unittest_design.py | 3 +-- tests/checkers/unittest_format.py | 2 +- tests/checkers/unittest_imports.py | 2 +- tests/checkers/unittest_misc.py | 2 +- tests/checkers/unittest_non_ascii_name.py | 4 ++++ tests/checkers/unittest_refactoring.py | 2 +- tests/checkers/unittest_similar.py | 2 +- tests/checkers/unittest_spelling.py | 2 +- tests/checkers/unittest_stdlib.py | 2 +- tests/checkers/unittest_strings.py | 3 +-- tests/checkers/unittest_typecheck.py | 2 +- tests/checkers/unittest_unicode/__init__.py | 4 ++++ tests/checkers/unittest_unicode/unittest_bad_chars.py | 4 ++++ .../unittest_unicode/unittest_bidirectional_unicode.py | 4 ++++ tests/checkers/unittest_unicode/unittest_functions.py | 4 ++++ .../unittest_unicode/unittest_invalid_encoding.py | 4 ++++ tests/checkers/unittest_utils.py | 2 +- tests/checkers/unittest_variables.py | 2 +- tests/config/conftest.py | 4 ++++ tests/config/file_to_lint.py | 4 ++++ tests/config/test_config.py | 4 ++++ tests/config/test_functional_config_loading.py | 2 +- tests/config/unittest_config.py | 2 +- tests/conftest.py | 4 ++++ tests/extensions/__init__.py | 3 +++ tests/extensions/test_check_docs_utils.py | 2 +- tests/extensions/test_private_import.py | 4 ++++ tests/lint/__init__.py | 3 +++ tests/lint/test_pylinter.py | 4 ++++ tests/lint/test_utils.py | 4 ++++ tests/lint/unittest_expand_modules.py | 3 +-- tests/lint/unittest_lint.py | 2 +- tests/message/__init__.py | 3 +++ tests/message/conftest.py | 3 ++- tests/message/test_no_removed_msgid_or_symbol_used.py | 2 +- tests/message/unittest_message.py | 2 +- tests/message/unittest_message_definition.py | 2 +- tests/message/unittest_message_definition_store.py | 2 +- tests/message/unittest_message_id_store.py | 2 +- tests/primer/test_primer_external.py | 3 ++- tests/primer/test_primer_stdlib.py | 2 +- tests/profile/test_profile_against_externals.py | 2 +- tests/pyreverse/conftest.py | 4 ++++ tests/pyreverse/test_diadefs.py | 2 +- tests/pyreverse/test_diagrams.py | 2 +- tests/pyreverse/test_inspector.py | 2 +- tests/pyreverse/test_main.py | 4 ++++ tests/pyreverse/test_printer.py | 2 +- tests/pyreverse/test_printer_factory.py | 2 +- tests/pyreverse/test_utils.py | 2 +- tests/pyreverse/test_writer.py | 2 +- tests/test_check_parallel.py | 2 +- tests/test_epylint.py | 4 ++++ tests/test_func.py | 2 +- tests/test_functional.py | 2 +- tests/test_functional_directories.py | 4 ++++ tests/test_import_graph.py | 2 +- tests/test_numversion.py | 2 +- tests/test_pragma_parser.py | 4 ++++ tests/test_pylint_runners.py | 4 ++++ tests/test_regr.py | 2 +- tests/test_self.py | 2 +- tests/test_similar.py | 2 +- tests/testutils/dummy_checker.py | 3 +++ tests/testutils/test_configuration_test.py | 4 ++++ tests/testutils/test_decorator.py | 3 +-- tests/testutils/test_functional_testutils.py | 2 +- tests/testutils/test_lint_module_output_update.py | 2 +- tests/testutils/test_output_line.py | 2 +- tests/testutils/test_package_to_lint.py | 2 +- tests/unittest_reporters_json.py | 2 +- tests/unittest_reporting.py | 2 +- tests/utils/__init__.py | 3 +++ tests/utils/unittest_ast_walker.py | 2 +- tests/utils/unittest_utils.py | 2 +- 224 files changed, 358 insertions(+), 196 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f19027503c..6bd4832deb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,13 +13,20 @@ repos: rev: v1.4 hooks: - id: autoflake - exclude: &fixtures tests/functional/|tests/input|tests/regrtest_data/|tests/data/|doc/data/messages + exclude: &fixtures tests/functional/|tests/input|tests/regrtest_data/|tests/data/|doc/data/messages|tests/testutils/data/ args: - --in-place - --remove-all-unused-imports - --expand-star-imports - --remove-duplicate-keys - --remove-unused-variables + - repo: https://github.com/Pierre-Sassoulas/copyright_notice_precommit + rev: f683ab7d10d5f7e779c75aea17197007583d14e4 + hooks: + - id: copyright-notice + args: ["--notice=script/copyright.txt", "--enforce-all"] + exclude: tests/functional/|tests/input|tests/regrtest_data/|tests/data/|doc/data/messages|tests/testutils/data/|examples/|setup.py + types: [python] - repo: https://github.com/asottile/pyupgrade rev: v2.31.1 hooks: diff --git a/doc/conf.py b/doc/conf.py index 0f15ffd91c..8b548ddc33 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -1,4 +1,7 @@ -# +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + # Pylint documentation build configuration file, created by # sphinx-quickstart on Thu Apr 4 20:31:25 2013. # diff --git a/doc/exts/pylint_extensions.py b/doc/exts/pylint_extensions.py index 921db904df..da1b9ee2e4 100755 --- a/doc/exts/pylint_extensions.py +++ b/doc/exts/pylint_extensions.py @@ -1,7 +1,8 @@ #!/usr/bin/env python + # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Script used to generate the extensions file before building the actual documentation.""" diff --git a/doc/exts/pylint_features.py b/doc/exts/pylint_features.py index b4e5e2df2f..a605102243 100755 --- a/doc/exts/pylint_features.py +++ b/doc/exts/pylint_features.py @@ -1,7 +1,8 @@ #!/usr/bin/env python + # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Script used to generate the features file before building the actual documentation.""" diff --git a/doc/exts/pylint_messages.py b/doc/exts/pylint_messages.py index 51b10482f0..5c63171264 100644 --- a/doc/exts/pylint_messages.py +++ b/doc/exts/pylint_messages.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Script used to generate the messages files.""" diff --git a/pylint/__init__.py b/pylint/__init__.py index cb5468eb5a..9fde923dc0 100644 --- a/pylint/__init__.py +++ b/pylint/__init__.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import os import sys diff --git a/pylint/__main__.py b/pylint/__main__.py index 267adb9eb0..7df5805f93 100644 --- a/pylint/__main__.py +++ b/pylint/__main__.py @@ -2,7 +2,7 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import pylint diff --git a/pylint/__pkginfo__.py b/pylint/__pkginfo__.py index 24bc31e99c..0063381eb1 100644 --- a/pylint/__pkginfo__.py +++ b/pylint/__pkginfo__.py @@ -1,6 +1,7 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + from typing import Tuple __version__ = "2.13.0-dev0" diff --git a/pylint/checkers/__init__.py b/pylint/checkers/__init__.py index 1f7f8fd38d..2855d70293 100644 --- a/pylint/checkers/__init__.py +++ b/pylint/checkers/__init__.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Utilities methods and classes for checkers. diff --git a/pylint/checkers/async.py b/pylint/checkers/async.py index 58fe8a5d8f..a85ab41170 100644 --- a/pylint/checkers/async.py +++ b/pylint/checkers/async.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Checker for anything related to the async protocol (PEP 492).""" diff --git a/pylint/checkers/base.py b/pylint/checkers/base.py index 7f2d9da7b3..38791c05ea 100644 --- a/pylint/checkers/base.py +++ b/pylint/checkers/base.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Basic checker for Python code.""" import collections diff --git a/pylint/checkers/base_checker.py b/pylint/checkers/base_checker.py index e0e3c03f30..1cdc014fc0 100644 --- a/pylint/checkers/base_checker.py +++ b/pylint/checkers/base_checker.py @@ -1,6 +1,7 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + import functools from inspect import cleandoc from typing import Any, Optional diff --git a/pylint/checkers/classes/__init__.py b/pylint/checkers/classes/__init__.py index ac1641fdf4..5e9bc5ae36 100644 --- a/pylint/checkers/classes/__init__.py +++ b/pylint/checkers/classes/__init__.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from typing import TYPE_CHECKING diff --git a/pylint/checkers/classes/class_checker.py b/pylint/checkers/classes/class_checker.py index 42fc83ea70..91343a5d26 100644 --- a/pylint/checkers/classes/class_checker.py +++ b/pylint/checkers/classes/class_checker.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Classes checker for Python code.""" import collections diff --git a/pylint/checkers/classes/special_methods_checker.py b/pylint/checkers/classes/special_methods_checker.py index e85150f082..9a7c9a7629 100644 --- a/pylint/checkers/classes/special_methods_checker.py +++ b/pylint/checkers/classes/special_methods_checker.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Special methods checker and helper function's module.""" diff --git a/pylint/checkers/deprecated.py b/pylint/checkers/deprecated.py index 0edbac4a98..299922f2b3 100644 --- a/pylint/checkers/deprecated.py +++ b/pylint/checkers/deprecated.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Checker mixin for deprecated functionality.""" from itertools import chain diff --git a/pylint/checkers/design_analysis.py b/pylint/checkers/design_analysis.py index ad600fc2fd..dcc43dc502 100644 --- a/pylint/checkers/design_analysis.py +++ b/pylint/checkers/design_analysis.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Check for signs of poor design.""" diff --git a/pylint/checkers/ellipsis_checker.py b/pylint/checkers/ellipsis_checker.py index 76e8a77ce0..2d904a28d2 100644 --- a/pylint/checkers/ellipsis_checker.py +++ b/pylint/checkers/ellipsis_checker.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + """Ellipsis checker for Python code.""" from typing import TYPE_CHECKING diff --git a/pylint/checkers/exceptions.py b/pylint/checkers/exceptions.py index 1020e7c183..6d0397e528 100644 --- a/pylint/checkers/exceptions.py +++ b/pylint/checkers/exceptions.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Checks for various exception related errors.""" import builtins diff --git a/pylint/checkers/format.py b/pylint/checkers/format.py index 9f125b5681..fae6085ca8 100644 --- a/pylint/checkers/format.py +++ b/pylint/checkers/format.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Python code format's checker. diff --git a/pylint/checkers/imports.py b/pylint/checkers/imports.py index 4e8f64ccf0..fb99bbf4b6 100644 --- a/pylint/checkers/imports.py +++ b/pylint/checkers/imports.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Imports checkers for Python code.""" diff --git a/pylint/checkers/logging.py b/pylint/checkers/logging.py index 084aeebeec..743f40db8c 100644 --- a/pylint/checkers/logging.py +++ b/pylint/checkers/logging.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Checker for use of Python logging.""" import string diff --git a/pylint/checkers/mapreduce_checker.py b/pylint/checkers/mapreduce_checker.py index 3078b6872e..d6ee875dc5 100644 --- a/pylint/checkers/mapreduce_checker.py +++ b/pylint/checkers/mapreduce_checker.py @@ -1,6 +1,7 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + import abc diff --git a/pylint/checkers/misc.py b/pylint/checkers/misc.py index c558e28851..e5e77bb81d 100644 --- a/pylint/checkers/misc.py +++ b/pylint/checkers/misc.py @@ -1,7 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors - +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Check source code is ascii only or has an encoding declaration (PEP 263).""" diff --git a/pylint/checkers/modified_iterating_checker.py b/pylint/checkers/modified_iterating_checker.py index b3e5daeae8..d1fe08d40c 100644 --- a/pylint/checkers/modified_iterating_checker.py +++ b/pylint/checkers/modified_iterating_checker.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from typing import TYPE_CHECKING, Union diff --git a/pylint/checkers/newstyle.py b/pylint/checkers/newstyle.py index af4e365d02..15833f2937 100644 --- a/pylint/checkers/newstyle.py +++ b/pylint/checkers/newstyle.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Check for new / old style related problems.""" from typing import TYPE_CHECKING diff --git a/pylint/checkers/non_ascii_names.py b/pylint/checkers/non_ascii_names.py index d80d9dec05..ece663ab4d 100644 --- a/pylint/checkers/non_ascii_names.py +++ b/pylint/checkers/non_ascii_names.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """All alphanumeric unicode character are allowed in Python but due to similarities in how they look they can be confused. diff --git a/pylint/checkers/raw_metrics.py b/pylint/checkers/raw_metrics.py index 15f08dc852..524ecbf854 100644 --- a/pylint/checkers/raw_metrics.py +++ b/pylint/checkers/raw_metrics.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import sys import tokenize diff --git a/pylint/checkers/refactoring/__init__.py b/pylint/checkers/refactoring/__init__.py index fdcf635fd0..481845f925 100644 --- a/pylint/checkers/refactoring/__init__.py +++ b/pylint/checkers/refactoring/__init__.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Looks for code which can be refactored.""" diff --git a/pylint/checkers/refactoring/implicit_booleaness_checker.py b/pylint/checkers/refactoring/implicit_booleaness_checker.py index dd59b2085b..e52b972d8f 100644 --- a/pylint/checkers/refactoring/implicit_booleaness_checker.py +++ b/pylint/checkers/refactoring/implicit_booleaness_checker.py @@ -1,6 +1,7 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + from typing import List, Union import astroid diff --git a/pylint/checkers/refactoring/not_checker.py b/pylint/checkers/refactoring/not_checker.py index c7c8f4289e..85d33bfdb6 100644 --- a/pylint/checkers/refactoring/not_checker.py +++ b/pylint/checkers/refactoring/not_checker.py @@ -1,7 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors - +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import astroid from astroid import nodes diff --git a/pylint/checkers/refactoring/recommendation_checker.py b/pylint/checkers/refactoring/recommendation_checker.py index 5aa1d26226..1fb7e72375 100644 --- a/pylint/checkers/refactoring/recommendation_checker.py +++ b/pylint/checkers/refactoring/recommendation_checker.py @@ -1,6 +1,7 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + from typing import Union import astroid diff --git a/pylint/checkers/refactoring/refactoring_checker.py b/pylint/checkers/refactoring/refactoring_checker.py index 1514770479..8dc65f129d 100644 --- a/pylint/checkers/refactoring/refactoring_checker.py +++ b/pylint/checkers/refactoring/refactoring_checker.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import collections import copy diff --git a/pylint/checkers/similar.py b/pylint/checkers/similar.py index cd70e326b3..69b401fa45 100644 --- a/pylint/checkers/similar.py +++ b/pylint/checkers/similar.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """A similarities / code duplication command line tool and pylint checker. diff --git a/pylint/checkers/spelling.py b/pylint/checkers/spelling.py index 92d6e037ff..f0c5effeb6 100644 --- a/pylint/checkers/spelling.py +++ b/pylint/checkers/spelling.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Checker for spelling errors in comments and docstrings.""" import os diff --git a/pylint/checkers/stdlib.py b/pylint/checkers/stdlib.py index ad5aa3dbcc..007a4f9788 100644 --- a/pylint/checkers/stdlib.py +++ b/pylint/checkers/stdlib.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Checkers for various standard library functions.""" diff --git a/pylint/checkers/strings.py b/pylint/checkers/strings.py index 19bdbce91f..dd9f1887f4 100644 --- a/pylint/checkers/strings.py +++ b/pylint/checkers/strings.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Checker for string formatting operations.""" diff --git a/pylint/checkers/threading_checker.py b/pylint/checkers/threading_checker.py index 649696f4b4..6a720d334f 100644 --- a/pylint/checkers/threading_checker.py +++ b/pylint/checkers/threading_checker.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from typing import TYPE_CHECKING diff --git a/pylint/checkers/typecheck.py b/pylint/checkers/typecheck.py index f220f4c273..70b958238d 100644 --- a/pylint/checkers/typecheck.py +++ b/pylint/checkers/typecheck.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Try to find more bugs in the code using astroid inference capabilities.""" diff --git a/pylint/checkers/unicode.py b/pylint/checkers/unicode.py index a6f46ad4bb..8939524df2 100644 --- a/pylint/checkers/unicode.py +++ b/pylint/checkers/unicode.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Unicode and some other ASCII characters can be used to create programs that run much different compared to what a human reader would expect from them. diff --git a/pylint/checkers/unsupported_version.py b/pylint/checkers/unsupported_version.py index 8c34a921f8..d63d4fb20b 100644 --- a/pylint/checkers/unsupported_version.py +++ b/pylint/checkers/unsupported_version.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Checker for features used that are not supported by all python versions indicated by the py-version setting. diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py index f3b643109b..344792d09b 100644 --- a/pylint/checkers/utils.py +++ b/pylint/checkers/utils.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Some functions that may be useful for various checkers.""" import builtins diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index b518eb47e7..7600eb00ee 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Variables checkers for Python code.""" import collections diff --git a/pylint/config/__init__.py b/pylint/config/__init__.py index c4582ee002..12f834d81b 100644 --- a/pylint/config/__init__.py +++ b/pylint/config/__init__.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import os import pathlib diff --git a/pylint/config/config_initialization.py b/pylint/config/config_initialization.py index fd36e7c6f1..6be0ab8b93 100644 --- a/pylint/config/config_initialization.py +++ b/pylint/config/config_initialization.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import sys from pathlib import Path diff --git a/pylint/config/configuration_mixin.py b/pylint/config/configuration_mixin.py index bb1115ad76..3db9acaa1c 100644 --- a/pylint/config/configuration_mixin.py +++ b/pylint/config/configuration_mixin.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from pylint.config.option_manager_mixin import OptionsManagerMixIn from pylint.config.options_provider_mixin import OptionsProviderMixIn diff --git a/pylint/config/find_default_config_files.py b/pylint/config/find_default_config_files.py index d2461a6251..7538f5b15e 100644 --- a/pylint/config/find_default_config_files.py +++ b/pylint/config/find_default_config_files.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import configparser import os diff --git a/pylint/config/man_help_formatter.py b/pylint/config/man_help_formatter.py index 5531fec03b..84837cc3c1 100644 --- a/pylint/config/man_help_formatter.py +++ b/pylint/config/man_help_formatter.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import optparse # pylint: disable=deprecated-module import sys diff --git a/pylint/config/option.py b/pylint/config/option.py index 5667a14ccf..260e0a2207 100644 --- a/pylint/config/option.py +++ b/pylint/config/option.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import copy import optparse # pylint: disable=deprecated-module diff --git a/pylint/config/option_manager_mixin.py b/pylint/config/option_manager_mixin.py index 346533ab60..44e1127379 100644 --- a/pylint/config/option_manager_mixin.py +++ b/pylint/config/option_manager_mixin.py @@ -1,7 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors - +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import collections import configparser diff --git a/pylint/config/option_parser.py b/pylint/config/option_parser.py index ad512329bf..b5d228ec23 100644 --- a/pylint/config/option_parser.py +++ b/pylint/config/option_parser.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import optparse # pylint: disable=deprecated-module diff --git a/pylint/config/options_provider_mixin.py b/pylint/config/options_provider_mixin.py index ae467c30c6..e937fee155 100644 --- a/pylint/config/options_provider_mixin.py +++ b/pylint/config/options_provider_mixin.py @@ -1,7 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors - +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import optparse # pylint: disable=deprecated-module from typing import Any, Dict, Tuple diff --git a/pylint/constants.py b/pylint/constants.py index 94e0636bb5..a6c9aa63d4 100644 --- a/pylint/constants.py +++ b/pylint/constants.py @@ -1,6 +1,7 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + import platform import sys from typing import Dict, List, NamedTuple, Tuple diff --git a/pylint/epylint.py b/pylint/epylint.py index d02ce6d5dc..2eade40f9b 100755 --- a/pylint/epylint.py +++ b/pylint/epylint.py @@ -3,7 +3,7 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Emacs and Flymake compatible Pylint. diff --git a/pylint/exceptions.py b/pylint/exceptions.py index 61b5bb07de..06ed21acd3 100644 --- a/pylint/exceptions.py +++ b/pylint/exceptions.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Exception classes raised by various operations within pylint.""" diff --git a/pylint/extensions/__init__.py b/pylint/extensions/__init__.py index 467608e4ec..393fe5e9e4 100644 --- a/pylint/extensions/__init__.py +++ b/pylint/extensions/__init__.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from typing import TYPE_CHECKING diff --git a/pylint/extensions/_check_docs_utils.py b/pylint/extensions/_check_docs_utils.py index ff01ef226d..4853162c0f 100644 --- a/pylint/extensions/_check_docs_utils.py +++ b/pylint/extensions/_check_docs_utils.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Utility methods for docstring checking.""" diff --git a/pylint/extensions/bad_builtin.py b/pylint/extensions/bad_builtin.py index 62fe6691c2..259df6e954 100644 --- a/pylint/extensions/bad_builtin.py +++ b/pylint/extensions/bad_builtin.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Checker for deprecated builtins.""" from typing import TYPE_CHECKING diff --git a/pylint/extensions/broad_try_clause.py b/pylint/extensions/broad_try_clause.py index e51106987b..ddb7f75a38 100644 --- a/pylint/extensions/broad_try_clause.py +++ b/pylint/extensions/broad_try_clause.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Looks for try/except statements with too much code in the try clause.""" from typing import TYPE_CHECKING, Union diff --git a/pylint/extensions/check_elif.py b/pylint/extensions/check_elif.py index 41d737f5f0..6ffc32009b 100644 --- a/pylint/extensions/check_elif.py +++ b/pylint/extensions/check_elif.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from typing import TYPE_CHECKING diff --git a/pylint/extensions/code_style.py b/pylint/extensions/code_style.py index d1bb04928a..74e838ed20 100644 --- a/pylint/extensions/code_style.py +++ b/pylint/extensions/code_style.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + import sys from typing import TYPE_CHECKING, List, Optional, Set, Tuple, Type, Union, cast diff --git a/pylint/extensions/comparetozero.py b/pylint/extensions/comparetozero.py index 37304b93ee..a1db3e5312 100644 --- a/pylint/extensions/comparetozero.py +++ b/pylint/extensions/comparetozero.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Looks for comparisons to zero.""" diff --git a/pylint/extensions/comparison_placement.py b/pylint/extensions/comparison_placement.py index a85ea91fb6..8156f98b30 100644 --- a/pylint/extensions/comparison_placement.py +++ b/pylint/extensions/comparison_placement.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Checks for yoda comparisons (variable before constant) See https://en.wikipedia.org/wiki/Yoda_conditions diff --git a/pylint/extensions/confusing_elif.py b/pylint/extensions/confusing_elif.py index b6eee6ef14..9f815da96d 100644 --- a/pylint/extensions/confusing_elif.py +++ b/pylint/extensions/confusing_elif.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from typing import TYPE_CHECKING diff --git a/pylint/extensions/consider_ternary_expression.py b/pylint/extensions/consider_ternary_expression.py index 6dabe3613f..aece514b77 100644 --- a/pylint/extensions/consider_ternary_expression.py +++ b/pylint/extensions/consider_ternary_expression.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + """Check for if / assign blocks that can be rewritten with if-expressions.""" from typing import TYPE_CHECKING diff --git a/pylint/extensions/docparams.py b/pylint/extensions/docparams.py index ff3a0c641d..eff625b92d 100644 --- a/pylint/extensions/docparams.py +++ b/pylint/extensions/docparams.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Pylint plugin for checking in Sphinx, Google, or Numpy style docstrings.""" import re diff --git a/pylint/extensions/docstyle.py b/pylint/extensions/docstyle.py index 8823d61e57..537f110dc4 100644 --- a/pylint/extensions/docstyle.py +++ b/pylint/extensions/docstyle.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import linecache from typing import TYPE_CHECKING diff --git a/pylint/extensions/empty_comment.py b/pylint/extensions/empty_comment.py index 68b48970d9..4308364bb6 100644 --- a/pylint/extensions/empty_comment.py +++ b/pylint/extensions/empty_comment.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + from typing import TYPE_CHECKING from astroid import nodes diff --git a/pylint/extensions/emptystring.py b/pylint/extensions/emptystring.py index 30a8212257..68f086fb9b 100644 --- a/pylint/extensions/emptystring.py +++ b/pylint/extensions/emptystring.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Looks for comparisons to empty string.""" diff --git a/pylint/extensions/eq_without_hash.py b/pylint/extensions/eq_without_hash.py index aeadac9b33..9cbbb54522 100644 --- a/pylint/extensions/eq_without_hash.py +++ b/pylint/extensions/eq_without_hash.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """This is the remnant of the python3 checker. diff --git a/pylint/extensions/for_any_all.py b/pylint/extensions/for_any_all.py index 915fae8a33..078c204023 100644 --- a/pylint/extensions/for_any_all.py +++ b/pylint/extensions/for_any_all.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + """Check for use of for loops that only check for a condition.""" from typing import TYPE_CHECKING diff --git a/pylint/extensions/mccabe.py b/pylint/extensions/mccabe.py index 6b3e4080d6..5d2e2fc238 100644 --- a/pylint/extensions/mccabe.py +++ b/pylint/extensions/mccabe.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Module to add McCabe checker class for pylint.""" diff --git a/pylint/extensions/overlapping_exceptions.py b/pylint/extensions/overlapping_exceptions.py index 771a9a499c..17eaa6d3ac 100644 --- a/pylint/extensions/overlapping_exceptions.py +++ b/pylint/extensions/overlapping_exceptions.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Looks for overlapping exceptions.""" diff --git a/pylint/extensions/private_import.py b/pylint/extensions/private_import.py index 88033fa1e5..8d57eca837 100644 --- a/pylint/extensions/private_import.py +++ b/pylint/extensions/private_import.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + """Check for imports on private external modules and names.""" from pathlib import Path from typing import TYPE_CHECKING, Dict, List, Union diff --git a/pylint/extensions/redefined_variable_type.py b/pylint/extensions/redefined_variable_type.py index 65e666f213..41464630b9 100644 --- a/pylint/extensions/redefined_variable_type.py +++ b/pylint/extensions/redefined_variable_type.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from typing import TYPE_CHECKING, List diff --git a/pylint/extensions/set_membership.py b/pylint/extensions/set_membership.py index 6ba5166c5b..57089dc161 100644 --- a/pylint/extensions/set_membership.py +++ b/pylint/extensions/set_membership.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + from typing import TYPE_CHECKING from astroid import nodes diff --git a/pylint/extensions/typing.py b/pylint/extensions/typing.py index 07d18fdc7f..d6d67515a0 100644 --- a/pylint/extensions/typing.py +++ b/pylint/extensions/typing.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + from typing import TYPE_CHECKING, Dict, List, NamedTuple, Set, Union import astroid.bases diff --git a/pylint/extensions/while_used.py b/pylint/extensions/while_used.py index dc9861bac7..4c41510d4f 100644 --- a/pylint/extensions/while_used.py +++ b/pylint/extensions/while_used.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + """Check for use of while loops.""" from typing import TYPE_CHECKING diff --git a/pylint/graph.py b/pylint/graph.py index 07e3aa549c..8191847249 100644 --- a/pylint/graph.py +++ b/pylint/graph.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Graph manipulation utilities. diff --git a/pylint/interfaces.py b/pylint/interfaces.py index fe48d4daa2..7f6edbdf52 100644 --- a/pylint/interfaces.py +++ b/pylint/interfaces.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Interfaces for Pylint objects.""" from collections import namedtuple diff --git a/pylint/lint/__init__.py b/pylint/lint/__init__.py index b110728658..7cfa7f59d8 100644 --- a/pylint/lint/__init__.py +++ b/pylint/lint/__init__.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Pylint [options] modules_or_packages. diff --git a/pylint/lint/expand_modules.py b/pylint/lint/expand_modules.py index 236e49c992..184316e9bd 100644 --- a/pylint/lint/expand_modules.py +++ b/pylint/lint/expand_modules.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + import os import sys from typing import List, Pattern, Tuple diff --git a/pylint/lint/parallel.py b/pylint/lint/parallel.py index 5cf0b0b67f..ea5d7abacc 100644 --- a/pylint/lint/parallel.py +++ b/pylint/lint/parallel.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import collections import functools diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py index 248df9d06d..0bf8961c1e 100644 --- a/pylint/lint/pylinter.py +++ b/pylint/lint/pylinter.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import collections import contextlib diff --git a/pylint/lint/report_functions.py b/pylint/lint/report_functions.py index 052c564a7f..f4c0a57106 100644 --- a/pylint/lint/report_functions.py +++ b/pylint/lint/report_functions.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import collections from typing import DefaultDict, Dict, Union diff --git a/pylint/lint/run.py b/pylint/lint/run.py index 28e45dde66..2d28cc47f5 100644 --- a/pylint/lint/run.py +++ b/pylint/lint/run.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import os import sys diff --git a/pylint/lint/utils.py b/pylint/lint/utils.py index 4a1a375703..8377dfdd44 100644 --- a/pylint/lint/utils.py +++ b/pylint/lint/utils.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import contextlib import sys diff --git a/pylint/message/__init__.py b/pylint/message/__init__.py index 1238c127ae..11d2b17dce 100644 --- a/pylint/message/__init__.py +++ b/pylint/message/__init__.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """All the classes related to Message handling.""" diff --git a/pylint/message/message.py b/pylint/message/message.py index 79db438784..297442e450 100644 --- a/pylint/message/message.py +++ b/pylint/message/message.py @@ -1,7 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors - +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import collections from typing import Optional, Tuple, Union, overload diff --git a/pylint/message/message_definition.py b/pylint/message/message_definition.py index ea65a32b88..a729e595c7 100644 --- a/pylint/message/message_definition.py +++ b/pylint/message/message_definition.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import sys from typing import TYPE_CHECKING, List, Optional, Tuple diff --git a/pylint/message/message_definition_store.py b/pylint/message/message_definition_store.py index 643bc26a93..e3605fab6d 100644 --- a/pylint/message/message_definition_store.py +++ b/pylint/message/message_definition_store.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import collections import functools diff --git a/pylint/message/message_id_store.py b/pylint/message/message_id_store.py index b45d074c65..d4ccbe6bc8 100644 --- a/pylint/message/message_id_store.py +++ b/pylint/message/message_id_store.py @@ -1,6 +1,7 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + from typing import Dict, List, NoReturn, Optional, Tuple from pylint.exceptions import InvalidMessageError, UnknownMessageError diff --git a/pylint/pyreverse/__init__.py b/pylint/pyreverse/__init__.py index f0ca20a7bf..458c0f35db 100644 --- a/pylint/pyreverse/__init__.py +++ b/pylint/pyreverse/__init__.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Pyreverse.extensions.""" diff --git a/pylint/pyreverse/diadefslib.py b/pylint/pyreverse/diadefslib.py index 50b9ad9b31..b5dd3fb506 100644 --- a/pylint/pyreverse/diadefslib.py +++ b/pylint/pyreverse/diadefslib.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Handle diagram generation options for class diagram or default diagrams.""" diff --git a/pylint/pyreverse/diagrams.py b/pylint/pyreverse/diagrams.py index c2699f7674..2ad50910dd 100644 --- a/pylint/pyreverse/diagrams.py +++ b/pylint/pyreverse/diagrams.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Diagram objects.""" import astroid diff --git a/pylint/pyreverse/dot_printer.py b/pylint/pyreverse/dot_printer.py index 841d96fdca..0cca0ab619 100644 --- a/pylint/pyreverse/dot_printer.py +++ b/pylint/pyreverse/dot_printer.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Class to generate files in dot format and image formats supported by Graphviz.""" import os diff --git a/pylint/pyreverse/inspector.py b/pylint/pyreverse/inspector.py index 7ef3f7bb64..91d2199f22 100644 --- a/pylint/pyreverse/inspector.py +++ b/pylint/pyreverse/inspector.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Visitor doing some postprocessing on the astroid tree. diff --git a/pylint/pyreverse/main.py b/pylint/pyreverse/main.py index 9efe9ee4d7..ceaa123511 100644 --- a/pylint/pyreverse/main.py +++ b/pylint/pyreverse/main.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """%prog [options] . diff --git a/pylint/pyreverse/mermaidjs_printer.py b/pylint/pyreverse/mermaidjs_printer.py index b0452d2882..b1b56fcd25 100644 --- a/pylint/pyreverse/mermaidjs_printer.py +++ b/pylint/pyreverse/mermaidjs_printer.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Class to generate files in mermaidjs format.""" from typing import Dict, Optional diff --git a/pylint/pyreverse/plantuml_printer.py b/pylint/pyreverse/plantuml_printer.py index 8674aead73..57fe3a9d06 100644 --- a/pylint/pyreverse/plantuml_printer.py +++ b/pylint/pyreverse/plantuml_printer.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Class to generate files in dot format and image formats supported by Graphviz.""" from typing import Dict, Optional diff --git a/pylint/pyreverse/printer.py b/pylint/pyreverse/printer.py index 346579719a..43cc534e5e 100644 --- a/pylint/pyreverse/printer.py +++ b/pylint/pyreverse/printer.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Base class defining the interface for a printer.""" from abc import ABC, abstractmethod diff --git a/pylint/pyreverse/printer_factory.py b/pylint/pyreverse/printer_factory.py index 27eb7f7ab8..29a406b01f 100644 --- a/pylint/pyreverse/printer_factory.py +++ b/pylint/pyreverse/printer_factory.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from typing import Dict, Type diff --git a/pylint/pyreverse/utils.py b/pylint/pyreverse/utils.py index d18efe32ee..8b279281e4 100644 --- a/pylint/pyreverse/utils.py +++ b/pylint/pyreverse/utils.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Generic classes/functions for pyreverse core/extensions.""" import os diff --git a/pylint/pyreverse/vcg_printer.py b/pylint/pyreverse/vcg_printer.py index 3a4d25edcf..fa5e90a29a 100644 --- a/pylint/pyreverse/vcg_printer.py +++ b/pylint/pyreverse/vcg_printer.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Functions to generate files readable with Georg Sander's vcg (Visualization of Compiler Graphs). diff --git a/pylint/pyreverse/writer.py b/pylint/pyreverse/writer.py index a45394ac76..a3120e6d9c 100644 --- a/pylint/pyreverse/writer.py +++ b/pylint/pyreverse/writer.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Utilities for creating VCG and Dot diagrams.""" diff --git a/pylint/reporters/__init__.py b/pylint/reporters/__init__.py index 2420a03abf..47bb680b04 100644 --- a/pylint/reporters/__init__.py +++ b/pylint/reporters/__init__.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Utilities methods and classes for reporters.""" from typing import TYPE_CHECKING diff --git a/pylint/reporters/base_reporter.py b/pylint/reporters/base_reporter.py index fc7422370f..b45be0dc4f 100644 --- a/pylint/reporters/base_reporter.py +++ b/pylint/reporters/base_reporter.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import os import sys diff --git a/pylint/reporters/collecting_reporter.py b/pylint/reporters/collecting_reporter.py index 2ee041b01c..1562ab15d2 100644 --- a/pylint/reporters/collecting_reporter.py +++ b/pylint/reporters/collecting_reporter.py @@ -1,6 +1,7 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + from typing import TYPE_CHECKING from pylint.reporters.base_reporter import BaseReporter diff --git a/pylint/reporters/json_reporter.py b/pylint/reporters/json_reporter.py index cb7418fbbc..f7e782c9ac 100644 --- a/pylint/reporters/json_reporter.py +++ b/pylint/reporters/json_reporter.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """JSON reporter.""" import json diff --git a/pylint/reporters/multi_reporter.py b/pylint/reporters/multi_reporter.py index 63b65eb0c4..43822f05c2 100644 --- a/pylint/reporters/multi_reporter.py +++ b/pylint/reporters/multi_reporter.py @@ -1,7 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors - +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import os from typing import IO, TYPE_CHECKING, Any, AnyStr, Callable, List, Optional diff --git a/pylint/reporters/reports_handler_mix_in.py b/pylint/reporters/reports_handler_mix_in.py index f6486c95dd..890d58660d 100644 --- a/pylint/reporters/reports_handler_mix_in.py +++ b/pylint/reporters/reports_handler_mix_in.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import collections from typing import ( diff --git a/pylint/reporters/text.py b/pylint/reporters/text.py index 09a113c415..d37de5b963 100644 --- a/pylint/reporters/text.py +++ b/pylint/reporters/text.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Plain text reporters:. diff --git a/pylint/reporters/ureports/__init__.py b/pylint/reporters/ureports/__init__.py index 51e490b4da..a6a0946af9 100644 --- a/pylint/reporters/ureports/__init__.py +++ b/pylint/reporters/ureports/__init__.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt __all__ = ("BaseWriter",) diff --git a/pylint/reporters/ureports/base_writer.py b/pylint/reporters/ureports/base_writer.py index 38eba6227e..4f0ce55c81 100644 --- a/pylint/reporters/ureports/base_writer.py +++ b/pylint/reporters/ureports/base_writer.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Universal report objects and some formatting drivers. diff --git a/pylint/reporters/ureports/nodes.py b/pylint/reporters/ureports/nodes.py index f7d6f89c90..543082ae9a 100644 --- a/pylint/reporters/ureports/nodes.py +++ b/pylint/reporters/ureports/nodes.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Micro reports objects. diff --git a/pylint/reporters/ureports/text_writer.py b/pylint/reporters/ureports/text_writer.py index b247af4a02..fc4ce67df9 100644 --- a/pylint/reporters/ureports/text_writer.py +++ b/pylint/reporters/ureports/text_writer.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Text formatting drivers for ureports.""" diff --git a/pylint/testutils/__init__.py b/pylint/testutils/__init__.py index a7ac8680c9..0b55fc8e99 100644 --- a/pylint/testutils/__init__.py +++ b/pylint/testutils/__init__.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Functional/non regression tests for pylint.""" diff --git a/pylint/testutils/checker_test_case.py b/pylint/testutils/checker_test_case.py index 84df31e049..b6e10fb481 100644 --- a/pylint/testutils/checker_test_case.py +++ b/pylint/testutils/checker_test_case.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import contextlib import warnings diff --git a/pylint/testutils/configuration_test.py b/pylint/testutils/configuration_test.py index 591dc57bd8..c6241f31ed 100644 --- a/pylint/testutils/configuration_test.py +++ b/pylint/testutils/configuration_test.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Utility functions for configuration testing.""" import copy diff --git a/pylint/testutils/constants.py b/pylint/testutils/constants.py index 305b367538..1c3c69d795 100644 --- a/pylint/testutils/constants.py +++ b/pylint/testutils/constants.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import operator import re diff --git a/pylint/testutils/decorator.py b/pylint/testutils/decorator.py index efa572b59f..b2a790c452 100644 --- a/pylint/testutils/decorator.py +++ b/pylint/testutils/decorator.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import functools import optparse # pylint: disable=deprecated-module diff --git a/pylint/testutils/functional/__init__.py b/pylint/testutils/functional/__init__.py index d9df9d338b..4840e1ba64 100644 --- a/pylint/testutils/functional/__init__.py +++ b/pylint/testutils/functional/__init__.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt __all__ = [ "FunctionalTestFile", diff --git a/pylint/testutils/functional/find_functional_tests.py b/pylint/testutils/functional/find_functional_tests.py index 6fbdded121..78d821e319 100644 --- a/pylint/testutils/functional/find_functional_tests.py +++ b/pylint/testutils/functional/find_functional_tests.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import os from pathlib import Path diff --git a/pylint/testutils/functional/lint_module_output_update.py b/pylint/testutils/functional/lint_module_output_update.py index 1f5fc8392c..ae577911f4 100644 --- a/pylint/testutils/functional/lint_module_output_update.py +++ b/pylint/testutils/functional/lint_module_output_update.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import csv import os diff --git a/pylint/testutils/functional/test_file.py b/pylint/testutils/functional/test_file.py index aaaa7e8a9e..ae8d0f2ce3 100644 --- a/pylint/testutils/functional/test_file.py +++ b/pylint/testutils/functional/test_file.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import configparser import sys diff --git a/pylint/testutils/functional_test_file.py b/pylint/testutils/functional_test_file.py index 1a3c07eff8..fc1cdcbb14 100644 --- a/pylint/testutils/functional_test_file.py +++ b/pylint/testutils/functional_test_file.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt __all__ = [ "FunctionalTestFile", diff --git a/pylint/testutils/get_test_info.py b/pylint/testutils/get_test_info.py index 7a8bb9f92a..d0bf8f4e3f 100644 --- a/pylint/testutils/get_test_info.py +++ b/pylint/testutils/get_test_info.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from glob import glob from os.path import basename, join, splitext diff --git a/pylint/testutils/global_test_linter.py b/pylint/testutils/global_test_linter.py index 57506491d6..f6f421dab2 100644 --- a/pylint/testutils/global_test_linter.py +++ b/pylint/testutils/global_test_linter.py @@ -1,7 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors - +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from pylint import checkers from pylint.lint import PyLinter diff --git a/pylint/testutils/lint_module_test.py b/pylint/testutils/lint_module_test.py index 19459a0bb2..3bac0785d7 100644 --- a/pylint/testutils/lint_module_test.py +++ b/pylint/testutils/lint_module_test.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import csv import operator diff --git a/pylint/testutils/output_line.py b/pylint/testutils/output_line.py index 62ba9b039d..f6461adc7a 100644 --- a/pylint/testutils/output_line.py +++ b/pylint/testutils/output_line.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import warnings from typing import Any, NamedTuple, Optional, Sequence, Tuple, TypeVar, Union diff --git a/pylint/testutils/primer.py b/pylint/testutils/primer.py index 558ad582e0..e0f6f2e4d0 100644 --- a/pylint/testutils/primer.py +++ b/pylint/testutils/primer.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + import logging from pathlib import Path from typing import Dict, List, Optional, Union diff --git a/pylint/testutils/pyreverse.py b/pylint/testutils/pyreverse.py index b4e83f5d2b..f4e9bc7fc9 100644 --- a/pylint/testutils/pyreverse.py +++ b/pylint/testutils/pyreverse.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from typing import List, Optional, Tuple diff --git a/pylint/testutils/reporter_for_tests.py b/pylint/testutils/reporter_for_tests.py index 0610e6594e..47c12a3d2f 100644 --- a/pylint/testutils/reporter_for_tests.py +++ b/pylint/testutils/reporter_for_tests.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from io import StringIO from os import getcwd, sep diff --git a/pylint/testutils/tokenize_str.py b/pylint/testutils/tokenize_str.py index 5ce152e6ee..0b478c32cb 100644 --- a/pylint/testutils/tokenize_str.py +++ b/pylint/testutils/tokenize_str.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import tokenize from io import StringIO diff --git a/pylint/testutils/unittest_linter.py b/pylint/testutils/unittest_linter.py index 51f60c7342..a7d7fc02df 100644 --- a/pylint/testutils/unittest_linter.py +++ b/pylint/testutils/unittest_linter.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from typing import Any, Optional diff --git a/pylint/typing.py b/pylint/typing.py index 84488987ac..32b2ac4190 100644 --- a/pylint/typing.py +++ b/pylint/typing.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """A collection of typing utilities.""" import sys diff --git a/pylint/utils/__init__.py b/pylint/utils/__init__.py index 7406f7ec6e..51813f994a 100644 --- a/pylint/utils/__init__.py +++ b/pylint/utils/__init__.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Some various utilities and helper classes, most of them used in the main pylint class diff --git a/pylint/utils/ast_walker.py b/pylint/utils/ast_walker.py index 08fc3af925..415bd97ddb 100644 --- a/pylint/utils/ast_walker.py +++ b/pylint/utils/ast_walker.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import collections import traceback diff --git a/pylint/utils/docs.py b/pylint/utils/docs.py index 22412b803c..b6fb877f0f 100644 --- a/pylint/utils/docs.py +++ b/pylint/utils/docs.py @@ -1,6 +1,7 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + """Various helper functions to create the docs of a linter object.""" import sys diff --git a/pylint/utils/file_state.py b/pylint/utils/file_state.py index b7f09a6b9c..b820affccd 100644 --- a/pylint/utils/file_state.py +++ b/pylint/utils/file_state.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import collections import sys diff --git a/pylint/utils/linterstats.py b/pylint/utils/linterstats.py index e09e0ce432..f7ca05f610 100644 --- a/pylint/utils/linterstats.py +++ b/pylint/utils/linterstats.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import sys from typing import Dict, List, Optional, Set, cast diff --git a/pylint/utils/pragma_parser.py b/pylint/utils/pragma_parser.py index 090a336fc5..01cdf440af 100644 --- a/pylint/utils/pragma_parser.py +++ b/pylint/utils/pragma_parser.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import re from collections import namedtuple diff --git a/pylint/utils/utils.py b/pylint/utils/utils.py index 835351ec37..6a60cd8e96 100644 --- a/pylint/utils/utils.py +++ b/pylint/utils/utils.py @@ -1,7 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors - +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt try: import isort.api diff --git a/tests/benchmark/test_baseline_benchmarks.py b/tests/benchmark/test_baseline_benchmarks.py index b4550db431..f9e997ef3d 100644 --- a/tests/benchmark/test_baseline_benchmarks.py +++ b/tests/benchmark/test_baseline_benchmarks.py @@ -2,7 +2,7 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt # pylint: disable=missing-function-docstring diff --git a/tests/checkers/__init__.py b/tests/checkers/__init__.py index e69de29bb2..e8a8ff79fd 100644 --- a/tests/checkers/__init__.py +++ b/tests/checkers/__init__.py @@ -0,0 +1,3 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt diff --git a/tests/checkers/conftest.py b/tests/checkers/conftest.py index e831015420..ac2a187d45 100644 --- a/tests/checkers/conftest.py +++ b/tests/checkers/conftest.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + from pathlib import Path HERE = Path(__file__).parent diff --git a/tests/checkers/unittest_base.py b/tests/checkers/unittest_base.py index b0238c3eae..198eb174e1 100644 --- a/tests/checkers/unittest_base.py +++ b/tests/checkers/unittest_base.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Unittest for the base checker.""" diff --git a/tests/checkers/unittest_base_checker.py b/tests/checkers/unittest_base_checker.py index 7efdf2aba9..68d36cd6c5 100644 --- a/tests/checkers/unittest_base_checker.py +++ b/tests/checkers/unittest_base_checker.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Unittest for the BaseChecker class.""" diff --git a/tests/checkers/unittest_deprecated.py b/tests/checkers/unittest_deprecated.py index 75608acf4d..0b35b297aa 100644 --- a/tests/checkers/unittest_deprecated.py +++ b/tests/checkers/unittest_deprecated.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + from typing import List, Optional, Set, Tuple, Union import astroid diff --git a/tests/checkers/unittest_design.py b/tests/checkers/unittest_design.py index 95baea3b21..46eab45d72 100644 --- a/tests/checkers/unittest_design.py +++ b/tests/checkers/unittest_design.py @@ -1,7 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors - +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import astroid diff --git a/tests/checkers/unittest_format.py b/tests/checkers/unittest_format.py index 8c5a2836ce..fa8b549a53 100644 --- a/tests/checkers/unittest_format.py +++ b/tests/checkers/unittest_format.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Check format checker helper functions.""" diff --git a/tests/checkers/unittest_imports.py b/tests/checkers/unittest_imports.py index 7f1181339e..ac36f784fb 100644 --- a/tests/checkers/unittest_imports.py +++ b/tests/checkers/unittest_imports.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Unit tests for the imports checker.""" diff --git a/tests/checkers/unittest_misc.py b/tests/checkers/unittest_misc.py index 9c0ec70895..e360d3bb68 100644 --- a/tests/checkers/unittest_misc.py +++ b/tests/checkers/unittest_misc.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Tests for the misc checker.""" diff --git a/tests/checkers/unittest_non_ascii_name.py b/tests/checkers/unittest_non_ascii_name.py index 4d69a65194..f6c9abcdbd 100644 --- a/tests/checkers/unittest_non_ascii_name.py +++ b/tests/checkers/unittest_non_ascii_name.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + import sys from typing import Iterable, Optional diff --git a/tests/checkers/unittest_refactoring.py b/tests/checkers/unittest_refactoring.py index 2a28c0bede..fda53098d7 100644 --- a/tests/checkers/unittest_refactoring.py +++ b/tests/checkers/unittest_refactoring.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import os diff --git a/tests/checkers/unittest_similar.py b/tests/checkers/unittest_similar.py index 3911db93bc..64ed46eb02 100644 --- a/tests/checkers/unittest_similar.py +++ b/tests/checkers/unittest_similar.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from contextlib import redirect_stdout from io import StringIO diff --git a/tests/checkers/unittest_spelling.py b/tests/checkers/unittest_spelling.py index 6f7308aaa0..3d45539138 100644 --- a/tests/checkers/unittest_spelling.py +++ b/tests/checkers/unittest_spelling.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Unittest for the spelling checker.""" diff --git a/tests/checkers/unittest_stdlib.py b/tests/checkers/unittest_stdlib.py index 480da89921..cdd61e6bad 100644 --- a/tests/checkers/unittest_stdlib.py +++ b/tests/checkers/unittest_stdlib.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import contextlib from typing import Any, Callable, Iterator, Optional, Union diff --git a/tests/checkers/unittest_strings.py b/tests/checkers/unittest_strings.py index 529a9284fc..7927dcc49d 100644 --- a/tests/checkers/unittest_strings.py +++ b/tests/checkers/unittest_strings.py @@ -1,7 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors - +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from pylint.checkers import strings diff --git a/tests/checkers/unittest_typecheck.py b/tests/checkers/unittest_typecheck.py index 736a16ca20..afcc2dc2e7 100644 --- a/tests/checkers/unittest_typecheck.py +++ b/tests/checkers/unittest_typecheck.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import astroid import pytest diff --git a/tests/checkers/unittest_unicode/__init__.py b/tests/checkers/unittest_unicode/__init__.py index 7a748245af..df1e5bf3dc 100644 --- a/tests/checkers/unittest_unicode/__init__.py +++ b/tests/checkers/unittest_unicode/__init__.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + import io from pathlib import Path diff --git a/tests/checkers/unittest_unicode/unittest_bad_chars.py b/tests/checkers/unittest_unicode/unittest_bad_chars.py index 8c98e094bd..154faad5a0 100644 --- a/tests/checkers/unittest_unicode/unittest_bad_chars.py +++ b/tests/checkers/unittest_unicode/unittest_bad_chars.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + # pylint: disable=redefined-outer-name import itertools from pathlib import Path diff --git a/tests/checkers/unittest_unicode/unittest_bidirectional_unicode.py b/tests/checkers/unittest_unicode/unittest_bidirectional_unicode.py index 2416957c92..68134fcc98 100644 --- a/tests/checkers/unittest_unicode/unittest_bidirectional_unicode.py +++ b/tests/checkers/unittest_unicode/unittest_bidirectional_unicode.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + import itertools import unicodedata from pathlib import Path diff --git a/tests/checkers/unittest_unicode/unittest_functions.py b/tests/checkers/unittest_unicode/unittest_functions.py index d14d2fdadf..bf42df996c 100644 --- a/tests/checkers/unittest_unicode/unittest_functions.py +++ b/tests/checkers/unittest_unicode/unittest_functions.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + import itertools from pathlib import Path from typing import Dict diff --git a/tests/checkers/unittest_unicode/unittest_invalid_encoding.py b/tests/checkers/unittest_unicode/unittest_invalid_encoding.py index 5facf9a059..ff46539e46 100644 --- a/tests/checkers/unittest_unicode/unittest_invalid_encoding.py +++ b/tests/checkers/unittest_unicode/unittest_invalid_encoding.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + import codecs import io import shutil diff --git a/tests/checkers/unittest_utils.py b/tests/checkers/unittest_utils.py index e27443f26d..121bcef2e9 100644 --- a/tests/checkers/unittest_utils.py +++ b/tests/checkers/unittest_utils.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Tests for the pylint.checkers.utils module.""" diff --git a/tests/checkers/unittest_variables.py b/tests/checkers/unittest_variables.py index e9ebbd6137..c2d2d8ec34 100644 --- a/tests/checkers/unittest_variables.py +++ b/tests/checkers/unittest_variables.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import os import re diff --git a/tests/config/conftest.py b/tests/config/conftest.py index 5a6778af2f..491b16267a 100644 --- a/tests/config/conftest.py +++ b/tests/config/conftest.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + from pathlib import Path import pytest diff --git a/tests/config/file_to_lint.py b/tests/config/file_to_lint.py index bc3f722d99..b6a8c14c86 100644 --- a/tests/config/file_to_lint.py +++ b/tests/config/file_to_lint.py @@ -1 +1,5 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + """Perfect module with only documentation for configuration tests.""" diff --git a/tests/config/test_config.py b/tests/config/test_config.py index f89e624168..701d24a822 100644 --- a/tests/config/test_config.py +++ b/tests/config/test_config.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + import os from pathlib import Path from typing import Optional, Set diff --git a/tests/config/test_functional_config_loading.py b/tests/config/test_functional_config_loading.py index 174af48b89..e4ed15051b 100644 --- a/tests/config/test_functional_config_loading.py +++ b/tests/config/test_functional_config_loading.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """This launches the configuration functional tests. This permits to test configuration files by providing a file with the appropriate extension in the ``tests/config/functional`` diff --git a/tests/config/unittest_config.py b/tests/config/unittest_config.py index 16e12350e3..14c3b72320 100644 --- a/tests/config/unittest_config.py +++ b/tests/config/unittest_config.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Unit tests for the config module.""" diff --git a/tests/conftest.py b/tests/conftest.py index 1f2347a1ab..dd0b1195e3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + # pylint: disable=redefined-outer-name import os from pathlib import Path diff --git a/tests/extensions/__init__.py b/tests/extensions/__init__.py index e69de29bb2..e8a8ff79fd 100644 --- a/tests/extensions/__init__.py +++ b/tests/extensions/__init__.py @@ -0,0 +1,3 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt diff --git a/tests/extensions/test_check_docs_utils.py b/tests/extensions/test_check_docs_utils.py index abc0751d82..b14138a921 100644 --- a/tests/extensions/test_check_docs_utils.py +++ b/tests/extensions/test_check_docs_utils.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Unit tests for utils functions in :mod:`pylint.extensions._check_docs_utils`.""" import astroid diff --git a/tests/extensions/test_private_import.py b/tests/extensions/test_private_import.py index 10648a8f91..d2d79947fb 100644 --- a/tests/extensions/test_private_import.py +++ b/tests/extensions/test_private_import.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + """Tests the local module directory comparison logic which requires mocking file directories""" from unittest.mock import patch diff --git a/tests/lint/__init__.py b/tests/lint/__init__.py index e69de29bb2..e8a8ff79fd 100644 --- a/tests/lint/__init__.py +++ b/tests/lint/__init__.py @@ -0,0 +1,3 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt diff --git a/tests/lint/test_pylinter.py b/tests/lint/test_pylinter.py index 9d6695a250..57ad0f7b8e 100644 --- a/tests/lint/test_pylinter.py +++ b/tests/lint/test_pylinter.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + from typing import Any, NoReturn from unittest.mock import patch diff --git a/tests/lint/test_utils.py b/tests/lint/test_utils.py index a1fa536140..891ee0020b 100644 --- a/tests/lint/test_utils.py +++ b/tests/lint/test_utils.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + import unittest.mock from pathlib import Path, PosixPath diff --git a/tests/lint/unittest_expand_modules.py b/tests/lint/unittest_expand_modules.py index 6c0855e9d4..75d344707c 100644 --- a/tests/lint/unittest_expand_modules.py +++ b/tests/lint/unittest_expand_modules.py @@ -1,7 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors - +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import re from pathlib import Path diff --git a/tests/lint/unittest_lint.py b/tests/lint/unittest_lint.py index 04b94d4e8e..91df7dc1f6 100644 --- a/tests/lint/unittest_lint.py +++ b/tests/lint/unittest_lint.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt # pylint: disable=redefined-outer-name diff --git a/tests/message/__init__.py b/tests/message/__init__.py index e69de29bb2..e8a8ff79fd 100644 --- a/tests/message/__init__.py +++ b/tests/message/__init__.py @@ -0,0 +1,3 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt diff --git a/tests/message/conftest.py b/tests/message/conftest.py index aee6f50194..7a9a399cfa 100644 --- a/tests/message/conftest.py +++ b/tests/message/conftest.py @@ -1,6 +1,7 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + # pylint: disable=redefined-outer-name diff --git a/tests/message/test_no_removed_msgid_or_symbol_used.py b/tests/message/test_no_removed_msgid_or_symbol_used.py index d829c2943a..e00450b9a7 100644 --- a/tests/message/test_no_removed_msgid_or_symbol_used.py +++ b/tests/message/test_no_removed_msgid_or_symbol_used.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from pylint.constants import DELETED_MESSAGES from pylint.lint import PyLinter diff --git a/tests/message/unittest_message.py b/tests/message/unittest_message.py index f8397cc3cb..ef560a6499 100644 --- a/tests/message/unittest_message.py +++ b/tests/message/unittest_message.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from typing import ValuesView diff --git a/tests/message/unittest_message_definition.py b/tests/message/unittest_message_definition.py index 51211b8ba2..c81763ff3d 100644 --- a/tests/message/unittest_message_definition.py +++ b/tests/message/unittest_message_definition.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import sys from unittest import mock diff --git a/tests/message/unittest_message_definition_store.py b/tests/message/unittest_message_definition_store.py index 96756ce866..a7d8352c64 100644 --- a/tests/message/unittest_message_definition_store.py +++ b/tests/message/unittest_message_definition_store.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from contextlib import redirect_stdout from io import StringIO diff --git a/tests/message/unittest_message_id_store.py b/tests/message/unittest_message_id_store.py index 4be49b1826..150ec8d698 100644 --- a/tests/message/unittest_message_id_store.py +++ b/tests/message/unittest_message_id_store.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from pathlib import Path from typing import Dict, ValuesView diff --git a/tests/primer/test_primer_external.py b/tests/primer/test_primer_external.py index c9ec9f167d..4a43259621 100644 --- a/tests/primer/test_primer_external.py +++ b/tests/primer/test_primer_external.py @@ -1,6 +1,7 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + import json import logging import subprocess diff --git a/tests/primer/test_primer_stdlib.py b/tests/primer/test_primer_stdlib.py index cb84437fbd..59599ae00a 100644 --- a/tests/primer/test_primer_stdlib.py +++ b/tests/primer/test_primer_stdlib.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import contextlib import io diff --git a/tests/profile/test_profile_against_externals.py b/tests/profile/test_profile_against_externals.py index 643896623e..81819476eb 100644 --- a/tests/profile/test_profile_against_externals.py +++ b/tests/profile/test_profile_against_externals.py @@ -2,7 +2,7 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt # pylint: disable=missing-function-docstring diff --git a/tests/pyreverse/conftest.py b/tests/pyreverse/conftest.py index ed3ad8f422..52b9198836 100644 --- a/tests/pyreverse/conftest.py +++ b/tests/pyreverse/conftest.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + from typing import Callable, Optional import pytest diff --git a/tests/pyreverse/test_diadefs.py b/tests/pyreverse/test_diadefs.py index 1a43daaa99..ecb601b0c6 100644 --- a/tests/pyreverse/test_diadefs.py +++ b/tests/pyreverse/test_diadefs.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Unit test for the extensions.diadefslib modules.""" # pylint: disable=redefined-outer-name diff --git a/tests/pyreverse/test_diagrams.py b/tests/pyreverse/test_diagrams.py index 6bf0ab7064..f10af571db 100644 --- a/tests/pyreverse/test_diagrams.py +++ b/tests/pyreverse/test_diagrams.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Unit test for the diagrams modules.""" from typing import Callable diff --git a/tests/pyreverse/test_inspector.py b/tests/pyreverse/test_inspector.py index c93e802338..8f053c1486 100644 --- a/tests/pyreverse/test_inspector.py +++ b/tests/pyreverse/test_inspector.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """For the visitors.diadefs module.""" # pylint: disable=redefined-outer-name diff --git a/tests/pyreverse/test_main.py b/tests/pyreverse/test_main.py index 2cc422c4ac..eda6e99743 100644 --- a/tests/pyreverse/test_main.py +++ b/tests/pyreverse/test_main.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + """Unittest for the main module.""" import os import sys diff --git a/tests/pyreverse/test_printer.py b/tests/pyreverse/test_printer.py index 26faea74f4..9128fc6ddf 100644 --- a/tests/pyreverse/test_printer.py +++ b/tests/pyreverse/test_printer.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from typing import Type diff --git a/tests/pyreverse/test_printer_factory.py b/tests/pyreverse/test_printer_factory.py index 1f00559551..97ee1179c8 100644 --- a/tests/pyreverse/test_printer_factory.py +++ b/tests/pyreverse/test_printer_factory.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Unit tests for pylint.pyreverse.printer_factory.""" diff --git a/tests/pyreverse/test_utils.py b/tests/pyreverse/test_utils.py index 095939ad66..da75fa9310 100644 --- a/tests/pyreverse/test_utils.py +++ b/tests/pyreverse/test_utils.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Tests for pylint.pyreverse.utils.""" diff --git a/tests/pyreverse/test_writer.py b/tests/pyreverse/test_writer.py index 3864bd51ee..d3b2d8f448 100644 --- a/tests/pyreverse/test_writer.py +++ b/tests/pyreverse/test_writer.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Unit test for ``DiagramWriter``.""" diff --git a/tests/test_check_parallel.py b/tests/test_check_parallel.py index 7011461b2c..d41ed13f4d 100644 --- a/tests/test_check_parallel.py +++ b/tests/test_check_parallel.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Puts the check_parallel system under test.""" diff --git a/tests/test_epylint.py b/tests/test_epylint.py index 8e7ff9b79f..e1b090395a 100644 --- a/tests/test_epylint.py +++ b/tests/test_epylint.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + """Test for issue https://github.com/PyCQA/pylint/issues/4286.""" # pylint: disable=redefined-outer-name from pathlib import PosixPath diff --git a/tests/test_func.py b/tests/test_func.py index a372b4a284..2de78c5d0f 100644 --- a/tests/test_func.py +++ b/tests/test_func.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Functional/non regression tests for pylint.""" diff --git a/tests/test_functional.py b/tests/test_functional.py index 86f8fe73b3..b328af5fcc 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Functional full-module tests for PyLint.""" import sys diff --git a/tests/test_functional_directories.py b/tests/test_functional_directories.py index a01f19cdd1..f757723322 100644 --- a/tests/test_functional_directories.py +++ b/tests/test_functional_directories.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + """Test that the directory structure of the functional tests is correct.""" from pathlib import Path diff --git a/tests/test_import_graph.py b/tests/test_import_graph.py index 7dc06307f9..9ea57e2cef 100644 --- a/tests/test_import_graph.py +++ b/tests/test_import_graph.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt # pylint: disable=redefined-outer-name diff --git a/tests/test_numversion.py b/tests/test_numversion.py index beffc31bb7..1bfb451da7 100644 --- a/tests/test_numversion.py +++ b/tests/test_numversion.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import pytest diff --git a/tests/test_pragma_parser.py b/tests/test_pragma_parser.py index 7bf00c7a34..d8dd508b08 100644 --- a/tests/test_pragma_parser.py +++ b/tests/test_pragma_parser.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + import pytest from pylint.utils.pragma_parser import ( diff --git a/tests/test_pylint_runners.py b/tests/test_pylint_runners.py index e4b20c0a87..303b433d35 100644 --- a/tests/test_pylint_runners.py +++ b/tests/test_pylint_runners.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + # pylint: disable=missing-module-docstring, missing-function-docstring import os import sys diff --git a/tests/test_regr.py b/tests/test_regr.py index 486c9b8b75..76bcafd68d 100644 --- a/tests/test_regr.py +++ b/tests/test_regr.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Non regression tests for pylint, which requires a too specific configuration to be incorporated in the automatic functional test framework diff --git a/tests/test_self.py b/tests/test_self.py index f2911ee096..36084b717a 100644 --- a/tests/test_self.py +++ b/tests/test_self.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt # pylint: disable=too-many-public-methods diff --git a/tests/test_similar.py b/tests/test_similar.py index 53c71cbd1c..f595102bca 100644 --- a/tests/test_similar.py +++ b/tests/test_similar.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE - +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import contextlib import os diff --git a/tests/testutils/dummy_checker.py b/tests/testutils/dummy_checker.py index e69de29bb2..e8a8ff79fd 100644 --- a/tests/testutils/dummy_checker.py +++ b/tests/testutils/dummy_checker.py @@ -0,0 +1,3 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt diff --git a/tests/testutils/test_configuration_test.py b/tests/testutils/test_configuration_test.py index 195c4415c5..2efa65df37 100644 --- a/tests/testutils/test_configuration_test.py +++ b/tests/testutils/test_configuration_test.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + import logging from pathlib import Path diff --git a/tests/testutils/test_decorator.py b/tests/testutils/test_decorator.py index 64594b39c3..42b88ab5c9 100644 --- a/tests/testutils/test_decorator.py +++ b/tests/testutils/test_decorator.py @@ -1,7 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors - +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import pytest diff --git a/tests/testutils/test_functional_testutils.py b/tests/testutils/test_functional_testutils.py index 136bda749d..f37ffb1ca1 100644 --- a/tests/testutils/test_functional_testutils.py +++ b/tests/testutils/test_functional_testutils.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Tests for the functional test framework.""" diff --git a/tests/testutils/test_lint_module_output_update.py b/tests/testutils/test_lint_module_output_update.py index 332463b033..6d46f84b47 100644 --- a/tests/testutils/test_lint_module_output_update.py +++ b/tests/testutils/test_lint_module_output_update.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt # pylint: disable=redefined-outer-name from pathlib import Path diff --git a/tests/testutils/test_output_line.py b/tests/testutils/test_output_line.py index 6a0e355184..6e6335ecc5 100644 --- a/tests/testutils/test_output_line.py +++ b/tests/testutils/test_output_line.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt # pylint: disable=redefined-outer-name diff --git a/tests/testutils/test_package_to_lint.py b/tests/testutils/test_package_to_lint.py index a79faa60c3..c3d2a4ab4d 100644 --- a/tests/testutils/test_package_to_lint.py +++ b/tests/testutils/test_package_to_lint.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt from pylint.testutils.primer import PRIMER_DIRECTORY_PATH, PackageToLint diff --git a/tests/unittest_reporters_json.py b/tests/unittest_reporters_json.py index 66da977a37..421506fe50 100644 --- a/tests/unittest_reporters_json.py +++ b/tests/unittest_reporters_json.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Test for the JSON reporter.""" diff --git a/tests/unittest_reporting.py b/tests/unittest_reporting.py index 4bbef21151..6db3f5a962 100644 --- a/tests/unittest_reporting.py +++ b/tests/unittest_reporting.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt # pylint: disable=redefined-outer-name import sys diff --git a/tests/utils/__init__.py b/tests/utils/__init__.py index e69de29bb2..e8a8ff79fd 100644 --- a/tests/utils/__init__.py +++ b/tests/utils/__init__.py @@ -0,0 +1,3 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt diff --git a/tests/utils/unittest_ast_walker.py b/tests/utils/unittest_ast_walker.py index 8f24bdaaa3..ec271bee78 100644 --- a/tests/utils/unittest_ast_walker.py +++ b/tests/utils/unittest_ast_walker.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import warnings from typing import Dict, Set diff --git a/tests/utils/unittest_utils.py b/tests/utils/unittest_utils.py index 2f9ed9f4b7..c802c40e2d 100644 --- a/tests/utils/unittest_utils.py +++ b/tests/utils/unittest_utils.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import io From e1ad7f26415fe74585e3f65aceaf5852672d67d9 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Thu, 24 Mar 2022 12:43:05 +0100 Subject: [PATCH 082/473] Upgrade documentation for contributors.txt --- .github/PULL_REQUEST_TEMPLATE.md | 3 ++- doc/development_guide/contribute.rst | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 46b9eb71a1..c1c6615b09 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,11 +3,12 @@ Thank you for submitting a PR to pylint! To ease the process of reviewing your PR, do make sure to complete the following boxes. -- [ ] Add yourself to ``CONTRIBUTORS.txt`` 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/`. - [ ] Write a good description on what the PR does. +- [ ] If you used multiple emails or multiple names when contributing, add your mails + and preferred name in ``script/.contributors_aliases.json`` --> ## Type of Changes diff --git a/doc/development_guide/contribute.rst b/doc/development_guide/contribute.rst index aa975bb278..a157532406 100644 --- a/doc/development_guide/contribute.rst +++ b/doc/development_guide/contribute.rst @@ -87,7 +87,8 @@ of Pylint as it gives you access to the latest ``ast`` parser. - Add a short entry in :file:`doc/whatsnew/VERSION.rst`. -- Add yourself to the `CONTRIBUTORS.txt` file. +- If you used multiple emails or multiple names when contributing, add your mails + and preferred name in the ``script/.contributors_aliases.json`` file. - Write a comprehensive commit message @@ -100,8 +101,6 @@ of Pylint as it gives you access to the latest ``ast`` parser. - Send a pull request from GitHub (see `About pull requests`_ for more insight about this topic) - - .. _`Closing issues via commit messages`: https://help.github.com/articles/closing-issues-via-commit-messages/ .. _`About pull requests`: https://help.github.com/articles/using-pull-requests/ .. _tox: https://tox.readthedocs.io/en/latest/ From 7965f08e87a3232aceb75a2508ec52b7afbc9fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Thu, 24 Mar 2022 13:15:09 +0100 Subject: [PATCH 083/473] Add bad-open-mode and unspecified-encoding documentation (#5954) Co-authored-by: Vladyslav Krylasov --- doc/data/messages/b/bad-open-mode/bad.py | 3 +++ doc/data/messages/b/bad-open-mode/good.py | 3 +++ doc/data/messages/u/unspecified-encoding/bad.py | 3 +++ doc/data/messages/u/unspecified-encoding/good.py | 3 +++ pylint/checkers/stdlib.py | 2 +- 5 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 doc/data/messages/b/bad-open-mode/bad.py create mode 100644 doc/data/messages/b/bad-open-mode/good.py create mode 100644 doc/data/messages/u/unspecified-encoding/bad.py create mode 100644 doc/data/messages/u/unspecified-encoding/good.py diff --git a/doc/data/messages/b/bad-open-mode/bad.py b/doc/data/messages/b/bad-open-mode/bad.py new file mode 100644 index 0000000000..28cfb62283 --- /dev/null +++ b/doc/data/messages/b/bad-open-mode/bad.py @@ -0,0 +1,3 @@ +def foo(file_path): + with open(file_path, "rwx") as file: # [bad-open-mode] + contents = file.read() diff --git a/doc/data/messages/b/bad-open-mode/good.py b/doc/data/messages/b/bad-open-mode/good.py new file mode 100644 index 0000000000..64a853b38c --- /dev/null +++ b/doc/data/messages/b/bad-open-mode/good.py @@ -0,0 +1,3 @@ +def foo(file_path): + with open(file_path, "r") as file: + contents = file.read() diff --git a/doc/data/messages/u/unspecified-encoding/bad.py b/doc/data/messages/u/unspecified-encoding/bad.py new file mode 100644 index 0000000000..4645923c58 --- /dev/null +++ b/doc/data/messages/u/unspecified-encoding/bad.py @@ -0,0 +1,3 @@ +def foo(file_path): + with open(file_path) as file: # [unspecified-encoding] + contents = file.read() diff --git a/doc/data/messages/u/unspecified-encoding/good.py b/doc/data/messages/u/unspecified-encoding/good.py new file mode 100644 index 0000000000..a267a36070 --- /dev/null +++ b/doc/data/messages/u/unspecified-encoding/good.py @@ -0,0 +1,3 @@ +def foo(file_path): + with open(file_path, encoding="utf-8") as file: + contents = file.read() diff --git a/pylint/checkers/stdlib.py b/pylint/checkers/stdlib.py index 007a4f9788..8761c45b3f 100644 --- a/pylint/checkers/stdlib.py +++ b/pylint/checkers/stdlib.py @@ -330,7 +330,7 @@ class StdlibChecker(DeprecatedMixin, BaseChecker): "bad-open-mode", "Python supports: r, w, a[, x] modes with b, +, " "and U (only with r) options. " - "See https://docs.python.org/2/library/functions.html#open", + "See https://docs.python.org/3/library/functions.html#open", ), "W1502": ( "Using datetime.time in a boolean context.", From 251802607688b47b91c1ccca54a715bd07d261a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Thu, 24 Mar 2022 13:16:00 +0100 Subject: [PATCH 084/473] Add CI test for message documentation (#5956) --- .github/workflows/ci.yaml | 31 ++++++ doc/data/messages/e/empty-docstring/bad.py | 4 +- doc/test_messages_documentation.py | 110 +++++++++++++++++++++ 3 files changed, 143 insertions(+), 2 deletions(-) create mode 100644 doc/test_messages_documentation.py diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5bf14f0601..8432c93fbe 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -148,6 +148,37 @@ jobs: . venv/bin/activate pytest tests/ -k unittest_spelling + documentation: + name: checks / documentation + runs-on: ubuntu-latest + timeout-minutes: 5 + needs: prepare-base + steps: + - name: Check out code from GitHub + uses: actions/checkout@v3.0.0 + - name: Set up Python ${{ env.DEFAULT_PYTHON }} + id: python + uses: actions/setup-python@v3.0.0 + with: + python-version: ${{ env.DEFAULT_PYTHON }} + - name: Restore Python virtual environment + id: cache-venv + uses: actions/cache@v3.0.0 + with: + path: venv + key: + ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ + needs.prepare-base.outputs.python-key }} + - name: Fail job if Python cache restore failed + if: steps.cache-venv.outputs.cache-hit != 'true' + run: | + echo "Failed to restore Python venv from cache" + exit 1 + - name: Run checks on documentation code examples + run: | + . venv/bin/activate + pytest doc/test_messages_documentation.py + prepare-tests-linux: name: tests / prepare / ${{ matrix.python-version }} / Linux runs-on: ubuntu-latest diff --git a/doc/data/messages/e/empty-docstring/bad.py b/doc/data/messages/e/empty-docstring/bad.py index 83d3601251..33dbb5f881 100644 --- a/doc/data/messages/e/empty-docstring/bad.py +++ b/doc/data/messages/e/empty-docstring/bad.py @@ -1,2 +1,2 @@ -def foo(): - pass # [emtpy-docstring] +def foo(): # [empty-docstring] + """""" diff --git a/doc/test_messages_documentation.py b/doc/test_messages_documentation.py new file mode 100644 index 0000000000..06c71d725c --- /dev/null +++ b/doc/test_messages_documentation.py @@ -0,0 +1,110 @@ +"""Functional tests for the code examples in the messages documentation.""" + +from collections import Counter +from pathlib import Path +from typing import Counter as CounterType +from typing import List, TextIO, Tuple + +import pytest + +from pylint import checkers +from pylint.config.config_initialization import _config_initialization +from pylint.lint import PyLinter +from pylint.message.message import Message +from pylint.testutils.constants import _EXPECTED_RE +from pylint.testutils.reporter_for_tests import FunctionalTestReporter + +MessageCounter = CounterType[Tuple[int, str]] + + +def get_functional_test_files_from_directory(input_dir: Path) -> List[Tuple[str, Path]]: + """Get all functional tests in the input_dir.""" + suite: List[Tuple[str, Path]] = [] + + for subdirectory in input_dir.iterdir(): + for message_dir in subdirectory.iterdir(): + if (message_dir / "good.py").exists(): + suite.append( + (message_dir.stem, message_dir / "good.py"), + ) + if (message_dir / "bad.py").exists(): + suite.append( + (message_dir.stem, message_dir / "bad.py"), + ) + return suite + + +TESTS_DIR = Path(__file__).parent.resolve() / "data" / "messages" +TESTS = get_functional_test_files_from_directory(TESTS_DIR) +TESTS_NAMES = [f"{t[0]}-{t[1].stem}" for t in TESTS] + + +class LintModuleTest: + def __init__(self, test_file: Tuple[str, Path]) -> None: + self._test_file = test_file + + _test_reporter = FunctionalTestReporter() + + self._linter = PyLinter() + self._linter.config.persistent = 0 + checkers.initialize(self._linter) + + _config_initialization( + self._linter, + args_list=[ + str(test_file[1]), + "--disable=all", + f"--enable={test_file[0]}", + ], + reporter=_test_reporter, + ) + + def runTest(self) -> None: + self._runTest() + + @staticmethod + def get_expected_messages(stream: TextIO) -> MessageCounter: + """Parse a file and get expected messages.""" + messages: MessageCounter = Counter() + for i, line in enumerate(stream): + match = _EXPECTED_RE.search(line) + if match is None: + continue + + line = match.group("line") + if line is None: + lineno = i + 1 + else: + lineno = int(line) + + for msg_id in match.group("msgs").split(","): + messages[lineno, msg_id.strip()] += 1 + return messages + + def _get_expected(self) -> MessageCounter: + """Get the expected messages for a file.""" + with open(self._test_file[1], encoding="utf8") as f: + expected_msgs = self.get_expected_messages(f) + return expected_msgs + + def _get_actual(self) -> MessageCounter: + """Get the actual messages after a run.""" + messages: List[Message] = self._linter.reporter.messages + messages.sort(key=lambda m: (m.line, m.symbol, m.msg)) + received_msgs: MessageCounter = Counter() + for msg in messages: + received_msgs[msg.line, msg.symbol] += 1 + return received_msgs + + def _runTest(self) -> None: + """Run the test and assert message differences.""" + self._linter.check([str(self._test_file[1])]) + expected_messages = self._get_expected() + actual_messages = self._get_actual() + assert expected_messages == actual_messages + + +@pytest.mark.parametrize("test_file", TESTS, ids=TESTS_NAMES) +def test_code_examples(test_file: Tuple[str, Path]) -> None: + lint_test = LintModuleTest(test_file) + lint_test.runTest() From 2b6184ba758ca7b2645ffccf678cdfa750d9f09c Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Thu, 24 Mar 2022 09:38:31 +0100 Subject: [PATCH 085/473] Use the new process created in https://github.com/PyCQA/astroid/pull/1438 --- doc/release.md | 100 +++++++++++++++++++++++++++++++------------------ 1 file changed, 64 insertions(+), 36 deletions(-) diff --git a/doc/release.md b/doc/release.md index 22194cd9b7..9052927b4f 100644 --- a/doc/release.md +++ b/doc/release.md @@ -1,52 +1,80 @@ -# Releasing a pylint version +# Releasing an astroid version -So, you want to release the `X.Y.Z` version of pylint ? +So, you want to release the `X.Y.Z` version of astroid ? -## Process +## Releasing a major or minor version -1. Check if the dependencies of the package are correct, make sure that astroid is - pinned to the latest version. -2. Install the release dependencies `pip3 install pre-commit tbump tox` -3. Bump the version by using `tbump X.Y.Z --no-tag --no-push` -4. Check the result (Do `git diff vX.Y.Z-1 ChangeLog doc/whatsnew/` in particular). -5. Move back to a dev version for pylint with `tbump`: +**Before releasing a major or minor version check if there are any unreleased commits on +the maintenance branch. If so, release a last patch release first. See +`Releasing a patch version`.** + +- Remove the empty changelog for the last unreleased patch version `X.Y-1.Z'`. (For + example: `v2.3.5`) +- Check the result of `git diff vX.Y-1.Z' ChangeLog`. (For example: + `git diff v2.3.4 ChangeLog`) +- Install the release dependencies: `pip3 install -r requirements_test.txt` +- Bump the version and release by using `tbump X.Y.0 --no-push --no-tag`. (For example: + `tbump 2.4.0 --no-push --no-tag`) +- Check the commit created with `git show` amend the commit if required. +- Move the `main` branch up to a dev version with `tbump`: ```bash -tbump X.Y.Z+1-dev0 --no-tag --no-push # You can interrupt after the first step -git commit -am "Move back to a dev version following X.Y.Z release" +tbump X.Y+1.0-dev0 --no-tag --no-push # You can interrupt after the first step +git commit -am "Upgrade the version to x.y+1.0-dev0 following x.y.0 release" ``` -4. Check the result -5. Open a merge request with the two commits (no one can push directly on `main`) -6. After the merge recover the merged commits and tag the first one (the version should - be `X.Y.Z`) as `vX.Y.Z` -7. Push the tag -8. Go to GitHub, click on "Releases" then on the `vX.Y.Z` tag, choose edit tag, and copy - past the changelog in the description. This will trigger the release to pypi. +For example: -## Post release +```bash +tbump 2.5.0-dev0 --no-tag --no-push +git commit -am "Upgrade the version to 2.5.0-dev0 following 2.4.0 release" +``` -### Merge tags in main for pre-commit +Check the commit and then push to a release branch -If the tag you just made is not part of the main branch, merge the tag `vX.Y.Z` in the -main branch by doing a history only merge. It's done in order to signal that this is an -official release tag, and for `pre-commit autoupdate` to works. +- Open a merge request with the two commits (no one can push directly on `main`) +- Trigger the "release tests" workflow in GitHub Actions. +- After the merge, recover the merged commits on `main` and tag the first one (the + version should be `X.Y.Z`) as `vX.Y.Z` (For example: `v2.4.0`) +- Push the tag. +- Release the version on GitHub with the same name as the tag and copy and paste the + appropriate changelog in the description. This triggers the PyPI release. +- Delete the `maintenance/X.Y-1.x` branch. (For example: `maintenance/2.3.x`) +- Create a `maintenance/X.Y.x` (For example: `maintenance/2.4.x` from the `v2.4.0` tag.) -```bash -git checkout main -git merge --no-edit --strategy=ours vX.Y.Z -git push -``` +## Backporting a fix from `main` to the maintenance branch + +Whenever a commit on `main` should be released in a patch release on the current +maintenance branch we cherry-pick the commit from `main`. + +- During the merge request on `main`, make sure that the changelog is for the patch + version `X.Y-1.Z'`. (For example: `v2.3.5`) +- After the PR is merged on `main` cherry-pick the commits on the `maintenance/X.Y.x` + branch (For example: from `maintenance/2.4.x` cherry-pick a commit from `main`) +- Release a patch version -### Milestone handling +## Releasing a patch version -We move issue that were not done in the next milestone and block release only if it's an -issue labelled as blocker. +We release patch versions when a crash or a bug is fixed on the main branch and has been +cherry-picked on the maintenance branch. -- Close milestone `X.Y.Z` -- Create the milestones for `X.Y.Z+1`, (or `X.Y+1.0`, and `X+1.0.0` if applicable) +- Check the result of `git diff vX.Y-1.Z-1 ChangeLog`. (For example: + `git diff v2.3.4 ChangeLog`) +- Install the release dependencies: `pip3 install -r requirements_test.txt` +- Bump the version and release by using `tbump X.Y-1.Z --no-push`. (For example: + `tbump 2.3.5 --no-push`) +- Check the result visually and then by triggering the "release tests" workflow in + GitHub Actions first. +- Push the tag. +- Release the version on GitHub with the same name as the tag and copy and paste the + appropriate changelog in the description. This triggers the PyPI release. +- Merge the `maintenance/X.Y.x` branch on the main branch. The main branch should have + the changelog for `X.Y-1.Z+1` (For example `v2.3.6`). This merge is required so + `pre-commit autoupdate` works for pylint. +- Fix version conflicts properly, or bump the version to `X.Y.0-devZ` (For example: + `2.4.0-dev6`) before pushing on the main branch -#### What's new +## Milestone handling -If it's a minor release, create a new `What's new in Pylint X.Y+1` document. Add it to -`doc/index.rst`. Take a look at the examples from `doc/whatsnew`. +We move issues that were not done to the next milestone and block releases only if there +are any open issues labelled as `blocker`. From c508d84858228dbd37214a9747b8073afa16e643 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 27 Feb 2022 22:56:43 +0100 Subject: [PATCH 086/473] Adaptation for pylint --- doc/release.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/release.md b/doc/release.md index 9052927b4f..25c87bbe57 100644 --- a/doc/release.md +++ b/doc/release.md @@ -1,6 +1,6 @@ -# Releasing an astroid version +# Releasing a pylint version -So, you want to release the `X.Y.Z` version of astroid ? +So, you want to release the `X.Y.Z` version of pylint ? ## Releasing a major or minor version @@ -16,6 +16,8 @@ the maintenance branch. If so, release a last patch release first. See - Bump the version and release by using `tbump X.Y.0 --no-push --no-tag`. (For example: `tbump 2.4.0 --no-push --no-tag`) - Check the commit created with `git show` amend the commit if required. +- Create a new `What's new in Pylint X.Y+1` document. Add it to `doc/index.rst`. Take a + look at the examples from `doc/whatsnew`. Commit that with `git commit -am "wip"`. - Move the `main` branch up to a dev version with `tbump`: ```bash @@ -30,7 +32,8 @@ tbump 2.5.0-dev0 --no-tag --no-push git commit -am "Upgrade the version to 2.5.0-dev0 following 2.4.0 release" ``` -Check the commit and then push to a release branch +Check the commit, fixup the 'wip' commit with the what's new then push to a release +branch - Open a merge request with the two commits (no one can push directly on `main`) - Trigger the "release tests" workflow in GitHub Actions. From 40d9eae15e6727b9b6dca82da2b984b4223cc4a3 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Thu, 24 Mar 2022 13:41:18 +0100 Subject: [PATCH 087/473] Fix copyright in doc/test_messages_documentation.py --- doc/test_messages_documentation.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/test_messages_documentation.py b/doc/test_messages_documentation.py index 06c71d725c..8cc311a705 100644 --- a/doc/test_messages_documentation.py +++ b/doc/test_messages_documentation.py @@ -1,3 +1,7 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt + """Functional tests for the code examples in the messages documentation.""" from collections import Counter From 6bbb56539f27347fc8f69733e0ebbccd2318f287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Thu, 24 Mar 2022 15:48:21 +0100 Subject: [PATCH 088/473] Add documentation for access-member-before-definition (#5958) Co-authored-by: Vladyslav Krylasov --- doc/data/messages/a/access-member-before-definition/bad.py | 5 +++++ doc/data/messages/a/access-member-before-definition/good.py | 5 +++++ pylint/checkers/classes/class_checker.py | 6 +++++- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 doc/data/messages/a/access-member-before-definition/bad.py create mode 100644 doc/data/messages/a/access-member-before-definition/good.py diff --git a/doc/data/messages/a/access-member-before-definition/bad.py b/doc/data/messages/a/access-member-before-definition/bad.py new file mode 100644 index 0000000000..cb17c86eef --- /dev/null +++ b/doc/data/messages/a/access-member-before-definition/bad.py @@ -0,0 +1,5 @@ +class Foo: + def __init__(self, param): + if self.param: # [access-member-before-definition] + pass + self.param = param diff --git a/doc/data/messages/a/access-member-before-definition/good.py b/doc/data/messages/a/access-member-before-definition/good.py new file mode 100644 index 0000000000..b2c877a4bd --- /dev/null +++ b/doc/data/messages/a/access-member-before-definition/good.py @@ -0,0 +1,5 @@ +class Foo: + def __init__(self, param): + self.param = param + if self.param: + pass diff --git a/pylint/checkers/classes/class_checker.py b/pylint/checkers/classes/class_checker.py index 91343a5d26..7492c9b42c 100644 --- a/pylint/checkers/classes/class_checker.py +++ b/pylint/checkers/classes/class_checker.py @@ -830,7 +830,11 @@ def _check_typing_final(self, node: nodes.ClassDef) -> None: node=node, ) - @check_messages("unused-private-member", "attribute-defined-outside-init") + @check_messages( + "unused-private-member", + "attribute-defined-outside-init", + "access-member-before-definition", + ) def leave_classdef(self, node: nodes.ClassDef) -> None: """Checker for Class nodes. From bb8e098f5a8c18ac68cebdae12d48138bab858b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Thu, 24 Mar 2022 16:28:53 +0100 Subject: [PATCH 089/473] Make ``arguments-differ`` check extra parameters for default values (#5539) Co-authored-by: Pierre Sassoulas Co-authored-by: Jacob Walls --- ChangeLog | 5 +++ doc/whatsnew/2.13.rst | 5 +++ pylint/checkers/classes/class_checker.py | 44 ++++++++++++++++++++---- tests/functional/a/arguments_differ.py | 32 +++++++++++++++++ tests/functional/a/arguments_differ.txt | 11 +++--- tests/functional/a/arguments_renamed.py | 4 +-- tests/functional/a/arguments_renamed.txt | 3 +- 7 files changed, 88 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index b82e345bb0..b75fe9515a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -480,6 +480,11 @@ Release date: TBA * The ``testutils`` for unittests now accept ``end_lineno`` and ``end_column``. Tests without these will trigger a ``DeprecationWarning``. +* ``arguments-differ`` will no longer complain about method redefinitions with extra parameters + that have default values. + + Closes #1556, #5338 + * Fixed false positive ``unexpected-keyword-arg`` for decorators. Closes #258 diff --git a/doc/whatsnew/2.13.rst b/doc/whatsnew/2.13.rst index a47516e528..47e78e5207 100644 --- a/doc/whatsnew/2.13.rst +++ b/doc/whatsnew/2.13.rst @@ -470,6 +470,11 @@ Other Changes * The ``testutils`` for unittests now accept ``end_lineno`` and ``end_column``. Tests without these will trigger a ``DeprecationWarning``. +* ``arguments-differ`` will no longer complain about method redefinitions with extra parameters + that have default values. + + Closes #1556, #5338 + * Disables for ``deprecated-module`` and similar warnings for stdlib features deprecated in newer versions of Python no longer raise ``useless-suppression`` when linting with older Python interpreters where those features are not yet deprecated. diff --git a/pylint/checkers/classes/class_checker.py b/pylint/checkers/classes/class_checker.py index 7492c9b42c..e258f6642a 100644 --- a/pylint/checkers/classes/class_checker.py +++ b/pylint/checkers/classes/class_checker.py @@ -191,15 +191,21 @@ def _has_different_parameters( overridden: List[nodes.AssignName], dummy_parameter_regex: Pattern, ) -> List[str]: - result = [] + result: List[str] = [] zipped = zip_longest(original, overridden) for original_param, overridden_param in zipped: - params = (original_param, overridden_param) - if not all(params): + if not overridden_param: return ["Number of parameters "] + if not original_param: + try: + overridden_param.parent.default_value(overridden_param.name) + continue + except astroid.NoDefault: + return ["Number of parameters "] + # check for the arguments' name - names = [param.name for param in params] + names = [param.name for param in (original_param, overridden_param)] if any(dummy_parameter_regex.match(name) for name in names): continue if original_param.name != overridden_param.name: @@ -211,6 +217,29 @@ def _has_different_parameters( return result +def _has_different_keyword_only_parameters( + original: List[nodes.AssignName], + overridden: List[nodes.AssignName], +) -> List[str]: + """Determine if the two methods have different keyword only parameters.""" + original_names = [i.name for i in original] + overridden_names = [i.name for i in overridden] + + if any(name not in overridden_names for name in original_names): + return ["Number of parameters "] + + for name in overridden_names: + if name in original_names: + continue + + try: + overridden[0].parent.default_value(name) + except astroid.NoDefault: + return ["Number of parameters "] + + return [] + + def _different_parameters( original: nodes.FunctionDef, overridden: nodes.FunctionDef, @@ -253,8 +282,8 @@ def _different_parameters( different_positional = _has_different_parameters( original_parameters, overridden_parameters, dummy_parameter_regex ) - different_kwonly = _has_different_parameters( - original_kwonlyargs, overridden.args.kwonlyargs, dummy_parameter_regex + different_kwonly = _has_different_keyword_only_parameters( + original_kwonlyargs, overridden.args.kwonlyargs ) if different_kwonly and different_positional: if "Number " in different_positional[0] and "Number " in different_kwonly[0]: @@ -483,7 +512,8 @@ def _has_same_layout_slots(slots, assigned_value): "%s %s %r method", "arguments-differ", "Used when a method has a different number of arguments than in " - "the implemented interface or in an overridden method.", + "the implemented interface or in an overridden method. Extra arguments " + "with default values are ignored.", ), "W0222": ( "Signature differs from %s %r method", diff --git a/tests/functional/a/arguments_differ.py b/tests/functional/a/arguments_differ.py index d6689d9202..1dbd40086e 100644 --- a/tests/functional/a/arguments_differ.py +++ b/tests/functional/a/arguments_differ.py @@ -252,6 +252,7 @@ def meth(self, _arg, dummy): import typing # pylint: disable=wrong-import-position from typing import Dict # pylint: disable=wrong-import-position + class ParentT1: def func(self, user_input: Dict[str, int]) -> None: pass @@ -326,3 +327,34 @@ class Foo2(AbstractFoo): def kwonly_6(self, first, *args, **kwargs): # valid override "One positional with the rest variadics to pass through parent params" + + +# Adding arguments with default values to a child class is valid +# See: +# https://github.com/PyCQA/pylint/issues/1556 +# https://github.com/PyCQA/pylint/issues/5338 + + +class BaseClass: + def method(self, arg: str): + print(self, arg) + + +class DerivedClassWithAnnotation(BaseClass): + def method(self, arg: str, param1: int = 42, *, param2: int = 42): + print(arg, param1, param2) + + +class DerivedClassWithoutAnnotation(BaseClass): + def method(self, arg, param1=42, *, param2=42): + print(arg, param1, param2) + + +class AClass: + def method(self, *, arg1): + print(self) + + +class ClassWithNewNonDefaultKeywordOnly(AClass): + def method(self, *, arg2, arg1=None): # [arguments-differ] + ... diff --git a/tests/functional/a/arguments_differ.txt b/tests/functional/a/arguments_differ.txt index 07ef79a0f9..bb1abb2eb9 100644 --- a/tests/functional/a/arguments_differ.txt +++ b/tests/functional/a/arguments_differ.txt @@ -5,8 +5,9 @@ arguments-differ:68:4:68:18:VarargsChild.has_kwargs:Variadics removed in overrid arguments-renamed:71:4:71:17:VarargsChild.no_kwargs:Parameter 'args' has been renamed to 'arg' in overridden 'VarargsChild.no_kwargs' method:UNDEFINED arguments-differ:144:4:144:12:StaticmethodChild2.func:Number of parameters was 1 in 'Staticmethod.func' and is now 2 in overridden 'StaticmethodChild2.func' method:UNDEFINED arguments-differ:180:4:180:12:SecondChangesArgs.test:Number of parameters was 2 in 'FirstHasArgs.test' and is now 4 in overridden 'SecondChangesArgs.test' method:UNDEFINED -arguments-differ:306:4:306:16:Foo.kwonly_1:Number of parameters was 4 in 'AbstractFoo.kwonly_1' and is now 3 in overridden 'Foo.kwonly_1' method:UNDEFINED -arguments-differ:309:4:309:16:Foo.kwonly_2:Number of parameters was 3 in 'AbstractFoo.kwonly_2' and is now 2 in overridden 'Foo.kwonly_2' method:UNDEFINED -arguments-differ:312:4:312:16:Foo.kwonly_3:Number of parameters was 3 in 'AbstractFoo.kwonly_3' and is now 3 in overridden 'Foo.kwonly_3' method:UNDEFINED -arguments-differ:315:4:315:16:Foo.kwonly_4:Number of parameters was 3 in 'AbstractFoo.kwonly_4' and is now 3 in overridden 'Foo.kwonly_4' method:UNDEFINED -arguments-differ:318:4:318:16:Foo.kwonly_5:Variadics removed in overridden 'Foo.kwonly_5' method:UNDEFINED +arguments-differ:307:4:307:16:Foo.kwonly_1:Number of parameters was 4 in 'AbstractFoo.kwonly_1' and is now 3 in overridden 'Foo.kwonly_1' method:UNDEFINED +arguments-differ:310:4:310:16:Foo.kwonly_2:Number of parameters was 3 in 'AbstractFoo.kwonly_2' and is now 2 in overridden 'Foo.kwonly_2' method:UNDEFINED +arguments-differ:313:4:313:16:Foo.kwonly_3:Number of parameters was 3 in 'AbstractFoo.kwonly_3' and is now 3 in overridden 'Foo.kwonly_3' method:UNDEFINED +arguments-differ:316:4:316:16:Foo.kwonly_4:Number of parameters was 3 in 'AbstractFoo.kwonly_4' and is now 3 in overridden 'Foo.kwonly_4' method:UNDEFINED +arguments-differ:319:4:319:16:Foo.kwonly_5:Variadics removed in overridden 'Foo.kwonly_5' method:UNDEFINED +arguments-differ:359:4:359:14:ClassWithNewNonDefaultKeywordOnly.method:Number of parameters was 2 in 'AClass.method' and is now 3 in overridden 'ClassWithNewNonDefaultKeywordOnly.method' method:UNDEFINED diff --git a/tests/functional/a/arguments_renamed.py b/tests/functional/a/arguments_renamed.py index e24b670fda..2b5474c831 100644 --- a/tests/functional/a/arguments_renamed.py +++ b/tests/functional/a/arguments_renamed.py @@ -40,7 +40,7 @@ class Child(Parent): def test(self, arg1): # [arguments-renamed] return arg1 + 1 - def kwargs_test(self, arg, *, value1, var2): #[arguments-renamed] + def kwargs_test(self, arg, *, value1, var2): #[arguments-differ] print(f"keyword parameters are {value1} and {var2}.") class Child2(Parent): @@ -48,7 +48,7 @@ class Child2(Parent): def test(self, var): # [arguments-renamed] return var + 1 - def kwargs_test(self, *, var1, kw2): #[arguments-renamed, arguments-differ] + def kwargs_test(self, *, var1, kw2): #[arguments-differ] print(f"keyword parameters are {var1} and {kw2}.") class ParentDefaults(object): diff --git a/tests/functional/a/arguments_renamed.txt b/tests/functional/a/arguments_renamed.txt index 7f6466ba8d..47d4188dd2 100644 --- a/tests/functional/a/arguments_renamed.txt +++ b/tests/functional/a/arguments_renamed.txt @@ -2,10 +2,9 @@ arguments-renamed:17:4:17:12:Orange.brew:Parameter 'fruit_name' has been renamed arguments-renamed:20:4:20:26:Orange.eat_with_condiment:Parameter 'fruit_name' has been renamed to 'orange_name' in overridden 'Orange.eat_with_condiment' method:UNDEFINED arguments-differ:27:4:27:26:Banana.eat_with_condiment:Number of parameters was 3 in 'Fruit.eat_with_condiment' and is now 4 in overridden 'Banana.eat_with_condiment' method:UNDEFINED arguments-renamed:40:4:40:12:Child.test:Parameter 'arg' has been renamed to 'arg1' in overridden 'Child.test' method:UNDEFINED -arguments-renamed:43:4:43:19:Child.kwargs_test:Parameter 'var1' has been renamed to 'value1' in overridden 'Child.kwargs_test' method:UNDEFINED +arguments-differ:43:4:43:19:Child.kwargs_test:Number of parameters was 4 in 'Parent.kwargs_test' and is now 4 in overridden 'Child.kwargs_test' method:UNDEFINED arguments-renamed:48:4:48:12:Child2.test:Parameter 'arg' has been renamed to 'var' in overridden 'Child2.test' method:UNDEFINED arguments-differ:51:4:51:19:Child2.kwargs_test:Number of parameters was 4 in 'Parent.kwargs_test' and is now 3 in overridden 'Child2.kwargs_test' method:UNDEFINED -arguments-renamed:51:4:51:19:Child2.kwargs_test:Parameter 'var2' has been renamed to 'kw2' in overridden 'Child2.kwargs_test' method:UNDEFINED arguments-renamed:67:4:67:13:ChildDefaults.test1:Parameter 'barg' has been renamed to 'param2' in overridden 'ChildDefaults.test1' method:UNDEFINED arguments-renamed:95:8:95:16:FruitOverrideConditional.brew:Parameter 'fruit_name' has been renamed to 'orange_name' in overridden 'FruitOverrideConditional.brew' method:UNDEFINED arguments-differ:99:12:99:34:FruitOverrideConditional.eat_with_condiment:Number of parameters was 3 in 'FruitConditional.eat_with_condiment' and is now 4 in overridden 'FruitOverrideConditional.eat_with_condiment' method:UNDEFINED From fd91d04a2f946c6fe8b31b6f9217a61caab55c7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Thu, 24 Mar 2022 16:30:02 +0100 Subject: [PATCH 090/473] Create a ``TypeVar`` style for ``invalid-name`` (#5894) Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> --- ChangeLog | 5 ++ doc/user_guide/options.rst | 17 ++++ doc/whatsnew/2.13.rst | 5 ++ pylint/checkers/base.py | 87 ++++++++++++------- pylint/constants.py | 1 + pylint/utils/linterstats.py | 7 ++ pylintrc | 3 + tests/checkers/unittest_base.py | 4 +- .../t/typevar_naming_style_default.py | 49 +++++++++++ .../t/typevar_naming_style_default.txt | 12 +++ .../functional/t/typevar_naming_style_rgx.py | 15 ++++ .../functional/t/typevar_naming_style_rgx.rc | 2 + .../functional/t/typevar_naming_style_rgx.txt | 3 + 13 files changed, 176 insertions(+), 34 deletions(-) create mode 100644 tests/functional/t/typevar_naming_style_default.py create mode 100644 tests/functional/t/typevar_naming_style_default.txt create mode 100644 tests/functional/t/typevar_naming_style_rgx.py create mode 100644 tests/functional/t/typevar_naming_style_rgx.rc create mode 100644 tests/functional/t/typevar_naming_style_rgx.txt diff --git a/ChangeLog b/ChangeLog index b75fe9515a..22cd0aed30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -522,6 +522,11 @@ Release date: TBA Insert your changelog randomly, it will reduce merge conflicts (Ie. not necessarily at the end) +* Improve ``invalid-name`` check for ``TypeVar`` names. + The accepted pattern can be customized with ``--typevar-rgx``. + + Closes #3401 + * Added new checker ``typevar-name-missing-variance``. Emitted when a covariant or contravariant ``TypeVar`` does not end with ``_co`` or ``_contra`` respectively or when a ``TypeVar`` is not either but has a suffix. diff --git a/doc/user_guide/options.rst b/doc/user_guide/options.rst index 898c7a60a7..6e1535e249 100644 --- a/doc/user_guide/options.rst +++ b/doc/user_guide/options.rst @@ -39,6 +39,8 @@ name is found in, and not the type of object assigned. +--------------------+---------------------------------------------------------------------------------------------------+ | ``inlinevar`` | Loop variables in list comprehensions and generator expressions. | +--------------------+---------------------------------------------------------------------------------------------------+ +| ``typevar`` | Type variable declared with ``TypeVar``. | ++--------------------+---------------------------------------------------------------------------------------------------+ Default behavior ~~~~~~~~~~~~~~~~ @@ -82,6 +84,19 @@ Following options are exposed: .. option:: --inlinevar-naming-style=