Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.pylintrc not used #569

Closed
ai-learner-00 opened this issue Aug 20, 2024 · 1 comment
Closed

.pylintrc not used #569

ai-learner-00 opened this issue Aug 20, 2024 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Issue is not triaged.

Comments

@ai-learner-00
Copy link

Diagnostic Data

  • Python version (& distribution if applicable, e.g., Anaconda): Python 3.10
  • Type of virtual environment used (e.g., conda, venv, virtualenv, etc.): Dev container
  • Operating system (and version): Windows
  • Version of tool extension you are using: 2023.11.13481007

Behaviour

Expected Behavior

I added a .pylintrc to ignore the tests directory.

[MASTER]
ignore=tests

Actual Behavior

I still get warnings for a test file.
image

I tried specifying the rcfile, but it didn't work.

				"pylint.enabled": true,
				"pylint.args": [
					"--rcfile=.pylintrc"
				],

Also, I tried "pylint.enabled": false to see if settings were used, and the warnings still appeared.

Reproduction Steps:

pyproject.zip

  1. Open the following code, which installs the pylint extension, in a dev container
  2. Go to test_postal_codes.py to see if there are warnings.

Logs:

Click here for detailed logs

2024-08-20 16:00:31.613 [info] [Trace - 4:00:31 PM] Sending request 'textDocument/codeAction - (27)'.
2024-08-20 16:00:31.613 [info] Params: {
"textDocument": {
"uri": "file:///workspaces/Service-GreatExpectations/tests/unit/custom_expectations/test_postal_codes.py"
},
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 0,
"character": 0
}
},
"context": {
"diagnostics": [
{
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 0,
"character": 0
}
},
"message": "Missing module docstring",
"code": "C0114:missing-module-docstring",
"codeDescription": {
"href": "https://pylint.readthedocs.io/en/latest/user_guide/messages/convention/missing-module-docstring.html"
},
"severity": 3,
"source": "Pylint"
},
{
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 0,
"character": 36
}
},
"message": "Missing function or method docstring",
"code": "C0116:missing-function-docstring",
"codeDescription": {
"href": "https://pylint.readthedocs.io/en/latest/user_guide/messages/convention/missing-function-docstring.html"
},
"severity": 3,
"source": "Pylint"
}
],
"triggerKind": 2
}
}

2024-08-20 16:00:31.625 [info] [Trace - 4:00:31 PM] Received response 'textDocument/codeAction - (27)' in 12ms.
2024-08-20 16:00:31.625 [info] Result: []

2024-08-20 16:00:31.809 [info] [Trace - 4:00:31 PM] Sending request 'textDocument/codeAction - (28)'.
2024-08-20 16:00:31.809 [info] Params: {
"textDocument": {
"uri": "file:///workspaces/Service-GreatExpectations/tests/unit/custom_expectations/test_postal_codes.py"
},
"range": {
"start": {
"line": 2,
"character": 0
},
"end": {
"line": 2,
"character": 0
}
},
"context": {
"diagnostics": [],
"triggerKind": 2
}
}

2024-08-20 16:00:31.811 [info] [Trace - 4:00:31 PM] Received response 'textDocument/codeAction - (28)' in 2ms.
2024-08-20 16:00:31.811 [info] Result: []

2024-08-20 16:00:32.500 [info] [Trace - 4:00:32 PM] Sending request 'textDocument/codeAction - (29)'.
2024-08-20 16:00:32.501 [info] Params: {
"textDocument": {
"uri": "file:///workspaces/Service-GreatExpectations/tests/unit/custom_expectations/test_postal_codes.py"
},
"range": {
"start": {
"line": 1,
"character": 35
},
"end": {
"line": 1,
"character": 35
}
},
"context": {
"diagnostics": [],
"triggerKind": 2
}
}

2024-08-20 16:00:32.502 [info] [Trace - 4:00:32 PM] Received response 'textDocument/codeAction - (29)' in 2ms.
2024-08-20 16:00:32.502 [info] Result: []

Outcome When Attempting Debugging Steps:

Did running it from the command line work? With pylint tests, there are no warnings.

Extra Details

@ai-learner-00 ai-learner-00 added the bug Issue identified by VS Code Team member as probable bug label Aug 20, 2024
@github-actions github-actions bot added the triage-needed Issue is not triaged. label Aug 20, 2024
@karthiknadig
Copy link
Member

@ai-learner-00 This is because we explicitly ask for linting on a file. When you run pylint on a specific file, it does not use ignore. You can use pylint.ignorePatterns to tell the extension to not run linter on such files.

you can try this manually, run pylint tests\test_postal_codes.py and it should lint it.
image

@karthiknadig karthiknadig closed this as not planned Won't fix, can't repro, duplicate, stale Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Issue is not triaged.
Projects
None yet
Development

No branches or pull requests

2 participants