Skip to content

Commit e8b109c

Browse files
authored
Delete Jedi-related settings, and update default Pylint settings (#17428)
* Set pylintEnabled default to false, closes #3007 * Delete python.linting.pylintUseMinimalCheckers * Delete jediPath and jediMemoryLimit settings * Update news * Remove minimal checkers, closes #7025 * Remove minimal checkers test * Emable build workflow to test it * Do not prompt to enable pylint * Update news entry * Undo testing of the build workflow * Remove more pylint minimal checkers related code * env files not supported in Jedi * Remove unused telemetry
1 parent 913aa7a commit e8b109c

27 files changed

Lines changed: 19 additions & 1707 deletions

.github/test_plan.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ SPAM='hello ${WHO}'
115115
**ALWAYS**:
116116

117117
- Make sure to use `Reload Window` between tests to reset your environment
118-
- Note that environment files only apply under the debugger and Jedi
118+
- Note that environment files only apply under the debugger
119119

120120
- [ ] Environment variables in a `.env` file are exposed when running under the debugger
121-
- [ ] `"python.envFile"` allows for specifying an environment file manually (e.g. Jedi picks up `PYTHONPATH` changes)
121+
- [ ] `"python.envFile"` allows for specifying an environment file manually
122122
- [ ] `envFile` in a `launch.json` configuration works
123123
- [ ] simple variable substitution works
124124

@@ -162,7 +162,6 @@ foo = 42 # Marked as a disallowed name.
162162
- [ ] Uses `--user` for system-install of Python
163163
- [ ] Installs into a virtual environment environment directly
164164
- [ ] Pylint works
165-
- [ ] `"python.linting.pylintUseMinimalCheckers": false` turns off the default rules w/ no `pylintrc` file present
166165
- [ ] The existence of a `pylintrc` file turns off the default rules
167166

168167
#### Other linters

news/1 Enhancements/11995.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Phase out Jedi 0.17, and use Jedi behind a language server protocol as the Jedi option.
1+
Phase out Jedi 0.17, and use Jedi behind a language server protocol as the Jedi option. Remove Jedi-related settings `python.jediMemoryLimit` and `python.jediPath`, since they are not used with the new language server implementation.

news/1 Enhancements/3007.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Set the default value of `python.linting.pylintEnabled` to `false`.

package.json

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -750,18 +750,6 @@
750750
"scope": "application",
751751
"type": "string"
752752
},
753-
"python.jediMemoryLimit": {
754-
"default": 0,
755-
"description": "Memory limit for the Jedi completion engine in megabytes. Zero (default) means 3072 MB. -1 means unlimited (disable memory limit check)",
756-
"scope": "resource",
757-
"type": "number"
758-
},
759-
"python.jediPath": {
760-
"default": "",
761-
"description": "Path to directory containing the Jedi library (this path will contain the 'Jedi' sub directory). Note: since Jedi depends on Parso, if using this setting you will need to ensure a suitable version of Parso is available. This setting only works with \"languageServer=Jedi\" and not JediLSP.",
762-
"scope": "resource",
763-
"type": "string"
764-
},
765753
"python.languageServer": {
766754
"default": "Default",
767755
"description": "Defines type of the language server.",
@@ -1121,7 +1109,7 @@
11211109
"type": "string"
11221110
},
11231111
"python.linting.pylintEnabled": {
1124-
"default": true,
1112+
"default": false,
11251113
"description": "Whether to lint Python files using pylint.",
11261114
"scope": "resource",
11271115
"type": "boolean"
@@ -1132,12 +1120,6 @@
11321120
"scope": "resource",
11331121
"type": "string"
11341122
},
1135-
"python.linting.pylintUseMinimalCheckers": {
1136-
"default": true,
1137-
"description": "Whether to run Pylint with minimal set of rules.",
1138-
"scope": "resource",
1139-
"type": "boolean"
1140-
},
11411123
"python.logging.level": {
11421124
"default": "error",
11431125
"description": "The logging level the extension logs at, defaults to 'error'",

resources/report_issue_user_settings.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"defaultInterpreterPath": "placeholder",
66
"defaultLS": true,
77
"downloadLanguageServer": true,
8-
"jediPath": false,
9-
"jediMemoryLimit": false,
108
"envFile": "placeholder",
119
"venvPath": "placeholder",
1210
"venvFolders": "placeholder",
@@ -58,9 +56,8 @@
5856
"pylamaPath": "placeholder",
5957
"pylintArgs": "placeholder",
6058
"pylintCategorySeverity": false,
61-
"pylintEnabled": true,
62-
"pylintPath": "placeholder",
63-
"pylintUseMinimalCheckers": true
59+
"pylintEnabled": false,
60+
"pylintPath": "placeholder"
6461
},
6562
"analysis": {
6663
"completeFunctionParens": true,

src/client/common/configSettings.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,6 @@ export class PythonSettings implements IPythonSettings {
9494

9595
public downloadLanguageServer = true;
9696

97-
public jediPath = '';
98-
99-
public jediMemoryLimit = 3072;
100-
10197
public envFile = '';
10298

10399
public venvPath = '';
@@ -304,14 +300,6 @@ export class PythonSettings implements IPythonSettings {
304300
this.languageServerIsDefault = false;
305301
}
306302

307-
this.jediPath = systemVariables.resolveAny(pythonSettings.get<string>('jediPath'))!;
308-
if (typeof this.jediPath === 'string' && this.jediPath.length > 0) {
309-
this.jediPath = getAbsolutePath(systemVariables.resolveAny(this.jediPath), workspaceRoot);
310-
} else {
311-
this.jediPath = '';
312-
}
313-
this.jediMemoryLimit = pythonSettings.get<number>('jediMemoryLimit')!;
314-
315303
const envFileSetting = pythonSettings.get<string>('envFile');
316304
this.envFile = systemVariables.resolveAny(envFileSetting)!;
317305
sendSettingTelemetry(this.workspace, envFileSetting);
@@ -410,7 +398,6 @@ export class PythonSettings implements IPythonSettings {
410398
error: DiagnosticSeverity.Error,
411399
note: DiagnosticSeverity.Hint,
412400
},
413-
pylintUseMinimalCheckers: false,
414401
};
415402
this.linting.pylintPath = getAbsolutePath(systemVariables.resolveAny(this.linting.pylintPath), workspaceRoot);
416403
this.linting.flake8Path = getAbsolutePath(systemVariables.resolveAny(this.linting.flake8Path), workspaceRoot);

src/client/common/types.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ export interface IPythonSettings {
175175
readonly poetryPath: string;
176176
readonly insidersChannel: ExtensionChannels;
177177
readonly downloadLanguageServer: boolean;
178-
readonly jediPath: string;
179-
readonly jediMemoryLimit: number;
180178
readonly devOptions: string[];
181179
readonly linting: ILintingSettings;
182180
readonly formatting: IFormattingSettings;
@@ -269,7 +267,6 @@ export interface ILintingSettings {
269267
banditEnabled: boolean;
270268
banditArgs: string[];
271269
banditPath: string;
272-
readonly pylintUseMinimalCheckers: boolean;
273270
}
274271
export interface IFormattingSettings {
275272
readonly provider: string;

src/client/linters/linterAvailability.ts

Lines changed: 0 additions & 114 deletions
This file was deleted.

src/client/linters/linterManager.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { Pycodestyle } from './pycodestyle';
1818
import { PyDocStyle } from './pydocstyle';
1919
import { PyLama } from './pylama';
2020
import { Pylint } from './pylint';
21-
import { IAvailableLinterActivator, ILinter, ILinterInfo, ILinterManager, ILintMessage, LinterId } from './types';
21+
import { ILinter, ILinterInfo, ILinterManager, ILintMessage, LinterId } from './types';
2222

2323
class DisabledLinter implements ILinter {
2424
constructor(private configService: IConfigurationService) {}
@@ -37,10 +37,10 @@ export class LinterManager implements ILinterManager {
3737
private checkedForInstalledLinters = new Set<string>();
3838

3939
constructor(
40-
@inject(IServiceContainer) private serviceContainer: IServiceContainer,
40+
@inject(IServiceContainer) private readonly serviceContainer: IServiceContainer,
4141
@inject(IWorkspaceService) private readonly workspaceService: IWorkspaceService,
4242
) {
43-
this.configService = serviceContainer.get<IConfigurationService>(IConfigurationService);
43+
this.configService = this.serviceContainer.get<IConfigurationService>(IConfigurationService);
4444
// Note that we use unit tests to ensure all the linters are here.
4545
this.linters = [
4646
new LinterInfo(Product.bandit, LinterId.Bandit, this.configService),
@@ -143,7 +143,7 @@ export class LinterManager implements ILinterManager {
143143

144144
protected async enableUnconfiguredLinters(resource?: Uri): Promise<void> {
145145
const settings = this.configService.getSettings(resource);
146-
if (!settings.linting.pylintEnabled || !settings.linting.enabled) {
146+
if (!settings.linting.enabled) {
147147
return;
148148
}
149149
// If we've already checked during this session for the same workspace and Python path, then don't bother again.
@@ -152,10 +152,5 @@ export class LinterManager implements ILinterManager {
152152
return;
153153
}
154154
this.checkedForInstalledLinters.add(workspaceKey);
155-
156-
// only check & ask the user if they'd like to enable pylint
157-
const pylintInfo = this.linters.find((linter) => linter.id === 'pylint');
158-
const activator = this.serviceContainer.get<IAvailableLinterActivator>(IAvailableLinterActivator);
159-
await activator.promptIfLinterAvailable(pylintInfo!, resource);
160155
}
161156
}

0 commit comments

Comments
 (0)