Skip to content

python.linting.ignorePatterns config value is ignored even if python.analysis.ignore is not set #4100

@debonte

Description

@debonte

Environment data

  • Language Server version: 2023.3.23

Code Snippet

test.py

x: int = "str"

settings.json

"python.linting.ignorePatterns": ["test.py"]

Repro Steps

  1. Create Python file that generates any diagnostics. Example above.
  2. Ignore that file via python.linting.ignorePatterns in settings.json. Ensure python.analysis.ignore is not set.

Expected behavior

No diagnostics reported for Python file.

Actual behavior

Diagnostics. Looks like the problem is that python.analysis.ignore defaults to an empty list, so the following assignment does not cause serverSettings.ignoreFileSpecs to be set to the python.linting.ignorePatterns value as expected:

serverSettings.ignoreFileSpecs = tryGetStringValues(
    pythonAnalysisSection.ignore ?? pythonSection?.linting?.ignorePatterns
);

Metadata

Metadata

Assignees

Labels

fixed in next version (main)A fix has been implemented and will appear in an upcoming version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions