diff --git a/.github/workflows/pyright.yml b/.github/workflows/pyright.yml index bb25f1ba827..38fb910d850 100644 --- a/.github/workflows/pyright.yml +++ b/.github/workflows/pyright.yml @@ -9,7 +9,7 @@ on: - gh-readonly-queue/** tags: # required if branches-ignore is supplied (jaraco/skeleton#103) - - '**' + - "**" pull_request: workflow_dispatch: @@ -24,15 +24,17 @@ env: # pin pyright version so a new version doesn't suddenly cause the CI to fail, # until types-setuptools is removed from typeshed. # For help with static-typing issues, or pyright update, ping @Avasam + # + # An exact version from https://github.com/microsoft/pyright/releases or "latest" PYRIGHT_VERSION: "1.1.377" # Environment variable to support color support (jaraco/skeleton#66) FORCE_COLOR: 1 # Suppress noisy pip warnings - PIP_DISABLE_PIP_VERSION_CHECK: 'true' - PIP_NO_PYTHON_VERSION_WARNING: 'true' - PIP_NO_WARN_SCRIPT_LOCATION: 'true' + PIP_DISABLE_PIP_VERSION_CHECK: "true" + PIP_NO_PYTHON_VERSION_WARNING: "true" + PIP_NO_WARN_SCRIPT_LOCATION: "true" jobs: pyright: @@ -65,7 +67,7 @@ jobs: else echo '> pip install pyright==${{ env.PYRIGHT_VERSION }}' fi - echo 'pyright --threads' + echo '> pyright --threads' shell: bash - name: Run pyright uses: jakebailey/pyright-action@v2 diff --git a/pyrightconfig.json b/pyrightconfig.json index cd04c33371e..27a329e1694 100644 --- a/pyrightconfig.json +++ b/pyrightconfig.json @@ -1,12 +1,14 @@ { "$schema": "https://raw.githubusercontent.com/microsoft/pyright/main/packages/vscode-pyright/schemas/pyrightconfig.schema.json", "exclude": [ + // Avoid scanning Python files in generated folders "build", ".tox", ".eggs", - "**/_vendor", // Vendored - "setuptools/_distutils", // Vendored - "setuptools/config/_validate_pyproject/**", // Auto-generated + "setuptools/config/_validate_pyproject/**", + // These are vendored + "**/_vendor", + "setuptools/_distutils", ], // Our testing setup doesn't allow passing CLI arguments, so local devs have to set this manually. // "pythonVersion": "3.8", @@ -15,15 +17,13 @@ "typeCheckingMode": "basic", // Too many issues caused by dynamic patching, still worth fixing when we can "reportAttributeAccessIssue": "warning", - // Fails on Python 3.12 due to missing distutils and on cygwin CI tests - "reportAssignmentType": "warning", + // Fails on Python 3.12 due to missing distutils "reportMissingImports": "warning", - "reportOptionalCall": "warning", // FIXME: A handful of reportOperatorIssue spread throughout the codebase "reportOperatorIssue": "warning", // Deferred initialization (initialize_options/finalize_options) causes many "potentially None" issues - // TODO: Fix with type-guards or by changing how it's initialized - "reportArgumentType": "warning", // A lot of these are caused by jaraco.path.build's spec argument not being a Mapping https://github.com/jaraco/jaraco.path/pull/3 + // TODO: Fix with type-guards, by changing how it's initialized, or by casting initial assignments + "reportArgumentType": "warning", "reportCallIssue": "warning", "reportGeneralTypeIssues": "warning", "reportOptionalIterable": "warning",