Repository: pylint-dev/pylint (branch: nested-min-max-matrix)
Commit date: 2023-12-24T05:47:20Z

Workflow file: .github/workflows/checks.yaml (Checks)
name: Checks

on:
  push:
    branches:
      - main
      - "maintenance/**"
  pull_request:
    branches:
      - main
      - "maintenance/**"

env:
  CACHE_VERSION: '1'
  DEFAULT_PYTHON: '3.11'
  KEY_PREFIX: base-venv
  PIP_INDEX_URL: http://localhost:8629/2023-12-24
  PRE_COMMIT_CACHE: ~/.cache/pre-commit
  UV_INDEX_URL: http://localhost:8629/2023-12-24

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

permissions:
  contents: read

jobs:
  prepare-base:
    name: Prepare base dependencies
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    timeout-minutes: 10
    outputs:
      python-key: ${{ steps.generate-python-key.outputs.key }}
      pre-commit-key: ${{ steps.generate-pre-commit-key.outputs.key }}
    steps:
      - name: Check out code from GitHub
        uses: actions/checkout@v4.1.1
      - name: Set up Python ${{ env.DEFAULT_PYTHON }}
        id: python
        uses: actions/setup-python@v5.0.0
        with:
          python-version: ${{ env.DEFAULT_PYTHON }}
          check-latest: true
      - name: Generate partial Python venv restore key
        id: generate-python-key
        run: >-
          echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{
            hashFiles('pyproject.toml', 'requirements_test.txt',
          'requirements_test_min.txt', 'requirements_test_pre_commit.txt') }}" >>
          $GITHUB_OUTPUT
      - name: Restore Python virtual environment
        id: cache-venv
        uses: actions/cache@v3.3.2
        with:
          path: venv
          key: >-
            ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
            steps.generate-python-key.outputs.key }}
      - name: Create Python virtual environment
        if: steps.cache-venv.outputs.cache-hit != 'true'
        run: |
          python -m venv venv
          . venv/bin/activate
          python -m pip install -U pip setuptools wheel
          pip install -U -r requirements_test.txt
          pip install -U -r doc/requirements.txt
          pip install pre-commit
      - name: Generate pre-commit restore key
        id: generate-pre-commit-key
        run: >-
          echo "key=pre-commit-${{ env.CACHE_VERSION }}-${{
            hashFiles('.pre-commit-config.yaml') }}" >> $GITHUB_OUTPUT
      - name: Restore pre-commit environment
        id: cache-precommit
        uses: actions/cache@v3.3.2
        with:
          path: ${{ env.PRE_COMMIT_CACHE }}
          key: >-
            ${{ runner.os }}-${{ steps.generate-pre-commit-key.outputs.key }}
      - name: Install pre-commit dependencies
        if: steps.cache-precommit.outputs.cache-hit != 'true'
        run: |
          . venv/bin/activate
          pre-commit install --install-hooks

  pylint:
    name: pylint
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    timeout-minutes: 10
    needs: prepare-base
    steps:
      - name: Check out code from GitHub
        uses: actions/checkout@v4.1.1
      - name: Set up Python ${{ env.DEFAULT_PYTHON }}
        id: python
        uses: actions/setup-python@v5.0.0
        with:
          python-version: ${{ env.DEFAULT_PYTHON }}
          check-latest: true
      - name: Restore Python virtual environment
        id: cache-venv
        uses: actions/cache@v3.3.2
        with:
          path: venv
          fail-on-cache-miss: true
          key:
            ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
            needs.prepare-base.outputs.python-key }}
      - name: Restore pre-commit environment
        id: cache-precommit
        uses: actions/cache@v3.3.2
        with:
          path: ${{ env.PRE_COMMIT_CACHE }}
          fail-on-cache-miss: true
          key: ${{ runner.os }}-${{ needs.prepare-base.outputs.pre-commit-key }}
      - name: Install enchant and aspell
        run: |
          sudo apt-get update
          sudo apt-get install enchant-2 aspell-en
      - name: Run pylint checks
        run: |
          . venv/bin/activate
          pip install .
          pip list | grep 'astroid\|pylint'
          pre-commit run --hook-stage manual pylint-with-spelling --all-files

  spelling:
    name: spelling tests
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    timeout-minutes: 5
    needs: prepare-base
    steps:
      - name: Check out code from GitHub
        uses: actions/checkout@v4.1.1
      - name: Set up Python ${{ env.DEFAULT_PYTHON }}
        id: python
        uses: actions/setup-python@v5.0.0
        with:
          python-version: ${{ env.DEFAULT_PYTHON }}
          check-latest: true
      - name: Restore Python virtual environment
        id: cache-venv
        uses: actions/cache@v3.3.2
        with:
          path: venv
          fail-on-cache-miss: true
          key:
            ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
            needs.prepare-base.outputs.python-key }}
      - name: Run spelling checks
        run: |
          . venv/bin/activate
          pytest tests/ -k unittest_spelling

  documentation:
    name: documentation
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    timeout-minutes: 20
    needs: prepare-base
    steps:
      - name: Check out code from GitHub
        uses: actions/checkout@v4.1.1
      - name: Set up Python ${{ env.DEFAULT_PYTHON }}
        id: python
        uses: actions/setup-python@v5.0.0
        with:
          python-version: ${{ env.DEFAULT_PYTHON }}
          check-latest: true
      - name: Restore Python virtual environment
        id: cache-venv
        uses: actions/cache@v3.3.2
        with:
          path: venv
          fail-on-cache-miss: true
          key:
            ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
            needs.prepare-base.outputs.python-key }}
      - name: Run checks on documentation code examples
        run: |
          . venv/bin/activate
          tox -e test_doc
      - name: Check documentation build and links
        run: |
          . venv/bin/activate
          cd doc
          pre-commit run --hook-stage push sphinx-generated-doc --all-files || {
            git diff ; \
            echo "Make sure that there are no modifications locally when launching 'make html'" ; \
            exit 1; \
          }


Failed build logs:
step_name: pylint/7_Run pylint checks.txt
log: ##[group]Run . venv/bin/activate
[36;1m. venv/bin/activate[0m
[36;1mpip install .[0m
[36;1mpip list | grep 'astroid\|pylint'[0m
[36;1mpre-commit run --hook-stage manual pylint-with-spelling --all-files[0m
shell: /usr/bin/bash -e {0}
env:
  CACHE_VERSION: 1
  KEY_PREFIX: base-venv
  DEFAULT_PYTHON: 3.11
  PRE_COMMIT_CACHE: ~/.cache/pre-commit
  pythonLocation: /opt/hostedtoolcache/Python/3.11.7/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.7/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.7/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.7/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.7/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.7/x64/lib
##[endgroup]
Processing /home/runner/work/pylint/pylint
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: platformdirs>=2.2.0 in ./venv/lib/python3.11/site-packages (from pylint==3.1.0.dev0) (4.1.0)
Requirement already satisfied: astroid<=3.1.0-dev0,>=3.0.2 in ./venv/lib/python3.11/site-packages (from pylint==3.1.0.dev0) (3.0.2)
Requirement already satisfied: isort!=5.13.0,<6,>=4.2.5 in ./venv/lib/python3.11/site-packages (from pylint==3.1.0.dev0) (5.13.1)
Requirement already satisfied: mccabe<0.8,>=0.6 in ./venv/lib/python3.11/site-packages (from pylint==3.1.0.dev0) (0.7.0)
Requirement already satisfied: tomlkit>=0.10.1 in ./venv/lib/python3.11/site-packages (from pylint==3.1.0.dev0) (0.11.8)
Requirement already satisfied: dill>=0.3.6 in ./venv/lib/python3.11/site-packages (from pylint==3.1.0.dev0) (0.3.7)
Building wheels for collected packages: pylint
  Building wheel for pylint (pyproject.toml): started
  Building wheel for pylint (pyproject.toml): finished with status 'done'
  Created wheel for pylint: filename=pylint-3.1.0.dev0-py3-none-any.whl size=514430 sha256=db7e3c76f36ec30e4e1c43c9ae58874e22c3211dc22bb045beaded567449b492
  Stored in directory: /tmp/pip-ephem-wheel-cache-libboaxs/wheels/28/6f/a2/f1ddc6eb86131657c068cb2bffe5fc77d929f0c0dfdc66abfb
Successfully built pylint
Installing collected packages: pylint
  Attempting uninstall: pylint
    Found existing installation: pylint 3.1.0.dev0
    Uninstalling pylint-3.1.0.dev0:
      Successfully uninstalled pylint-3.1.0.dev0
Successfully installed pylint-3.1.0.dev0

[notice] A new release of pip is available: 23.3.1 -> 23.3.2
[notice] To update, run: pip install --upgrade pip

[notice] A new release of pip is available: 23.3.1 -> 23.3.2
[notice] To update, run: pip install --upgrade pip
astroid                       3.0.2
pylint                        3.1.0.dev0
pylint...................................................................Failed
- hook id: pylint
- exit code: 16

************* Module pylint.checkers.nested_min_max
pylint/checkers/nested_min_max.py:70:0: C0401: Wrong spelling of a word 'redunant' in a comment:
# Meaning, redunant call only if parent max call has more than 1 arg.
           ^^^^^^^^
Did you mean: ''redundant' or 'redundancy''? (wrong-spelling-in-comment)

##[error]Process completed with exit code 1.


Changed files:
pylint/checkers/nested_min_max.py

Fix diff:
diff --git a/pylint/checkers/nested_min_max.py b/pylint/checkers/nested_min_max.py
index ccee2e68e..c8231fe7d 100644
--- a/pylint/checkers/nested_min_max.py
+++ b/pylint/checkers/nested_min_max.py
@@ -67,7 +67,7 @@ class NestedMinMaxChecker(BaseChecker):
                 and arg.func.name == node.func.name
                 # Nesting is useful for finding the maximum in a matrix.
                 # Allow: max(max([[1, 2, 3], [4, 5, 6]]))
-                # Meaning, redunant call only if parent max call has more than 1 arg.
+                # Meaning, redundant call only if parent max call has more than 1 arg.
                 and len(arg.parent.args) > 1
             )
         ]