Skip to content

Commit 5d7eb65

Browse files
authored
Remove linting support (microsoft#22266)
1 parent c82702e commit 5d7eb65

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+7
-8212
lines changed

package.json

Lines changed: 0 additions & 436 deletions
Large diffs are not rendered by default.

package.nls.json

Lines changed: 0 additions & 123 deletions
Large diffs are not rendered by default.

src/client/common/configSettings.ts

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import * as fs from 'fs';
66
import {
77
ConfigurationChangeEvent,
88
ConfigurationTarget,
9-
DiagnosticSeverity,
109
Disposable,
1110
Event,
1211
EventEmitter,
@@ -29,7 +28,6 @@ import {
2928
IExperiments,
3029
IInterpreterPathService,
3130
IInterpreterSettings,
32-
ILintingSettings,
3331
IPythonSettings,
3432
ITensorBoardSettings,
3533
ITerminalSettings,
@@ -106,8 +104,6 @@ export class PythonSettings implements IPythonSettings {
106104

107105
public devOptions: string[] = [];
108106

109-
public linting!: ILintingSettings;
110-
111107
public autoComplete!: IAutoCompleteSettings;
112108

113109
public tensorBoard: ITensorBoardSettings | undefined;
@@ -304,94 +300,8 @@ export class PythonSettings implements IPythonSettings {
304300
this.devOptions = systemVariables.resolveAny(pythonSettings.get<any[]>('devOptions'))!;
305301
this.devOptions = Array.isArray(this.devOptions) ? this.devOptions : [];
306302

307-
const lintingSettings = systemVariables.resolveAny(pythonSettings.get<ILintingSettings>('linting'))!;
308-
if (this.linting) {
309-
Object.assign<ILintingSettings, ILintingSettings>(this.linting, lintingSettings);
310-
} else {
311-
this.linting = lintingSettings;
312-
}
313-
314303
this.globalModuleInstallation = pythonSettings.get<boolean>('globalModuleInstallation') === true;
315304

316-
// Support for travis.
317-
this.linting = this.linting
318-
? this.linting
319-
: {
320-
enabled: false,
321-
cwd: undefined,
322-
ignorePatterns: [],
323-
flake8Args: [],
324-
flake8Enabled: false,
325-
flake8Path: 'flake8',
326-
lintOnSave: false,
327-
maxNumberOfProblems: 100,
328-
mypyArgs: [],
329-
mypyEnabled: false,
330-
mypyPath: 'mypy',
331-
banditArgs: [],
332-
banditEnabled: false,
333-
banditPath: 'bandit',
334-
pycodestyleArgs: [],
335-
pycodestyleEnabled: false,
336-
pycodestylePath: 'pycodestyle',
337-
pylamaArgs: [],
338-
pylamaEnabled: false,
339-
pylamaPath: 'pylama',
340-
prospectorArgs: [],
341-
prospectorEnabled: false,
342-
prospectorPath: 'prospector',
343-
pydocstyleArgs: [],
344-
pydocstyleEnabled: false,
345-
pydocstylePath: 'pydocstyle',
346-
pylintArgs: [],
347-
pylintEnabled: false,
348-
pylintPath: 'pylint',
349-
pylintCategorySeverity: {
350-
convention: DiagnosticSeverity.Hint,
351-
error: DiagnosticSeverity.Error,
352-
fatal: DiagnosticSeverity.Error,
353-
refactor: DiagnosticSeverity.Hint,
354-
warning: DiagnosticSeverity.Warning,
355-
},
356-
pycodestyleCategorySeverity: {
357-
E: DiagnosticSeverity.Error,
358-
W: DiagnosticSeverity.Warning,
359-
},
360-
flake8CategorySeverity: {
361-
E: DiagnosticSeverity.Error,
362-
W: DiagnosticSeverity.Warning,
363-
// Per http://flake8.pycqa.org/en/latest/glossary.html#term-error-code
364-
// 'F' does not mean 'fatal as in PyLint but rather 'pyflakes' such as
365-
// unused imports, variables, etc.
366-
F: DiagnosticSeverity.Warning,
367-
},
368-
mypyCategorySeverity: {
369-
error: DiagnosticSeverity.Error,
370-
note: DiagnosticSeverity.Hint,
371-
},
372-
};
373-
this.linting.pylintPath = getAbsolutePath(systemVariables.resolveAny(this.linting.pylintPath), workspaceRoot);
374-
this.linting.flake8Path = getAbsolutePath(systemVariables.resolveAny(this.linting.flake8Path), workspaceRoot);
375-
this.linting.pycodestylePath = getAbsolutePath(
376-
systemVariables.resolveAny(this.linting.pycodestylePath),
377-
workspaceRoot,
378-
);
379-
this.linting.pylamaPath = getAbsolutePath(systemVariables.resolveAny(this.linting.pylamaPath), workspaceRoot);
380-
this.linting.prospectorPath = getAbsolutePath(
381-
systemVariables.resolveAny(this.linting.prospectorPath),
382-
workspaceRoot,
383-
);
384-
this.linting.pydocstylePath = getAbsolutePath(
385-
systemVariables.resolveAny(this.linting.pydocstylePath),
386-
workspaceRoot,
387-
);
388-
this.linting.mypyPath = getAbsolutePath(systemVariables.resolveAny(this.linting.mypyPath), workspaceRoot);
389-
this.linting.banditPath = getAbsolutePath(systemVariables.resolveAny(this.linting.banditPath), workspaceRoot);
390-
391-
if (this.linting.cwd) {
392-
this.linting.cwd = getAbsolutePath(systemVariables.resolveAny(this.linting.cwd), workspaceRoot);
393-
}
394-
395305
const testSettings = systemVariables.resolveAny(pythonSettings.get<ITestingSettings>('testing'))!;
396306
if (this.testing) {
397307
Object.assign<ITestingSettings, ITestingSettings>(this.testing, testSettings);

src/client/common/installer/moduleInstaller.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -238,26 +238,10 @@ export abstract class ModuleInstaller implements IModuleInstaller {
238238

239239
export function translateProductToModule(product: Product): string {
240240
switch (product) {
241-
case Product.mypy:
242-
return 'mypy';
243-
case Product.pylama:
244-
return 'pylama';
245-
case Product.prospector:
246-
return 'prospector';
247-
case Product.pylint:
248-
return 'pylint';
249241
case Product.pytest:
250242
return 'pytest';
251-
case Product.pycodestyle:
252-
return 'pycodestyle';
253-
case Product.pydocstyle:
254-
return 'pydocstyle';
255-
case Product.flake8:
256-
return 'flake8';
257243
case Product.unittest:
258244
return 'unittest';
259-
case Product.bandit:
260-
return 'bandit';
261245
case Product.tensorboard:
262246
return 'tensorboard';
263247
case Product.torchProfilerInstallName:

src/client/common/installer/productNames.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@
44
import { Product } from '../types';
55

66
export const ProductNames = new Map<Product, string>();
7-
ProductNames.set(Product.bandit, 'bandit');
8-
ProductNames.set(Product.flake8, 'flake8');
9-
ProductNames.set(Product.mypy, 'mypy');
10-
ProductNames.set(Product.pycodestyle, 'pycodestyle');
11-
ProductNames.set(Product.pylama, 'pylama');
12-
ProductNames.set(Product.prospector, 'prospector');
13-
ProductNames.set(Product.pydocstyle, 'pydocstyle');
14-
ProductNames.set(Product.pylint, 'pylint');
157
ProductNames.set(Product.pytest, 'pytest');
168
ProductNames.set(Product.tensorboard, 'tensorboard');
179
ProductNames.set(Product.torchProfilerInstallName, 'torch-tb-profiler');

src/client/common/installer/productPath.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { inject, injectable } from 'inversify';
77
import * as path from 'path';
88
import { Uri } from 'vscode';
99
import { IServiceContainer } from '../../ioc/types';
10-
import { ILinterManager } from '../../linters/types';
1110
import { ITestingService } from '../../testing/types';
1211
import { IConfigurationService, IInstaller, Product } from '../types';
1312
import { IProductPathService } from './types';
@@ -36,17 +35,6 @@ export abstract class BaseProductPathsService implements IProductPathService {
3635
}
3736
}
3837

39-
@injectable()
40-
export class LinterProductPathService extends BaseProductPathsService {
41-
constructor(@inject(IServiceContainer) serviceContainer: IServiceContainer) {
42-
super(serviceContainer);
43-
}
44-
public getExecutableNameFromSettings(product: Product, resource?: Uri): string {
45-
const linterManager = this.serviceContainer.get<ILinterManager>(ILinterManager);
46-
return linterManager.getLinterInfo(product).pathName(resource);
47-
}
48-
}
49-
5038
@injectable()
5139
export class TestFrameworkProductPathService extends BaseProductPathsService {
5240
constructor(@inject(IServiceContainer) serviceContainer: IServiceContainer) {

src/client/common/installer/productService.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ export class ProductService implements IProductService {
1212
private ProductTypes = new Map<Product, ProductType>();
1313

1414
constructor() {
15-
this.ProductTypes.set(Product.bandit, ProductType.Linter);
16-
this.ProductTypes.set(Product.flake8, ProductType.Linter);
17-
this.ProductTypes.set(Product.mypy, ProductType.Linter);
18-
this.ProductTypes.set(Product.pycodestyle, ProductType.Linter);
19-
this.ProductTypes.set(Product.prospector, ProductType.Linter);
20-
this.ProductTypes.set(Product.pydocstyle, ProductType.Linter);
21-
this.ProductTypes.set(Product.pylama, ProductType.Linter);
22-
this.ProductTypes.set(Product.pylint, ProductType.Linter);
2315
this.ProductTypes.set(Product.pytest, ProductType.TestFramework);
2416
this.ProductTypes.set(Product.unittest, ProductType.TestFramework);
2517
this.ProductTypes.set(Product.tensorboard, ProductType.DataScience);

src/client/common/installer/serviceRegistry.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ import { CondaInstaller } from './condaInstaller';
99
import { PipEnvInstaller } from './pipEnvInstaller';
1010
import { PipInstaller } from './pipInstaller';
1111
import { PoetryInstaller } from './poetryInstaller';
12-
import {
13-
DataScienceProductPathService,
14-
LinterProductPathService,
15-
TestFrameworkProductPathService,
16-
} from './productPath';
12+
import { DataScienceProductPathService, TestFrameworkProductPathService } from './productPath';
1713
import { ProductService } from './productService';
1814
import { IInstallationChannelManager, IModuleInstaller, IProductPathService, IProductService } from './types';
1915

@@ -24,7 +20,6 @@ export function registerTypes(serviceManager: IServiceManager) {
2420
serviceManager.addSingleton<IModuleInstaller>(IModuleInstaller, PoetryInstaller);
2521
serviceManager.addSingleton<IInstallationChannelManager>(IInstallationChannelManager, InstallationChannelManager);
2622
serviceManager.addSingleton<IProductService>(IProductService, ProductService);
27-
serviceManager.addSingleton<IProductPathService>(IProductPathService, LinterProductPathService, ProductType.Linter);
2823
serviceManager.addSingleton<IProductPathService>(
2924
IProductPathService,
3025
TestFrameworkProductPathService,

src/client/common/types.ts

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
CancellationToken,
99
ConfigurationChangeEvent,
1010
ConfigurationTarget,
11-
DiagnosticSeverity,
1211
Disposable,
1312
DocumentSymbolProvider,
1413
Event,
@@ -85,24 +84,14 @@ export enum ProductInstallStatus {
8584
}
8685

8786
export enum ProductType {
88-
Linter = 'Linter',
8987
TestFramework = 'TestFramework',
90-
RefactoringLibrary = 'RefactoringLibrary',
9188
DataScience = 'DataScience',
9289
Python = 'Python',
9390
}
9491

9592
export enum Product {
9693
pytest = 1,
97-
pylint = 3,
98-
flake8 = 4,
99-
pycodestyle = 5,
100-
pylama = 6,
101-
prospector = 7,
102-
pydocstyle = 8,
103-
mypy = 11,
10494
unittest = 12,
105-
bandit = 17,
10695
tensorboard = 24,
10796
torchProfilerInstallName = 25,
10897
torchProfilerImportName = 26,
@@ -179,7 +168,6 @@ export interface IPythonSettings {
179168
readonly pipenvPath: string;
180169
readonly poetryPath: string;
181170
readonly devOptions: string[];
182-
readonly linting: ILintingSettings;
183171
readonly testing: ITestingSettings;
184172
readonly autoComplete: IAutoCompleteSettings;
185173
readonly terminal: ITerminalSettings;
@@ -197,67 +185,10 @@ export interface ITensorBoardSettings {
197185
logDirectory: string | undefined;
198186
}
199187

200-
export interface IPylintCategorySeverity {
201-
readonly convention: DiagnosticSeverity;
202-
readonly refactor: DiagnosticSeverity;
203-
readonly warning: DiagnosticSeverity;
204-
readonly error: DiagnosticSeverity;
205-
readonly fatal: DiagnosticSeverity;
206-
}
207-
export interface IPycodestyleCategorySeverity {
208-
readonly W: DiagnosticSeverity;
209-
readonly E: DiagnosticSeverity;
210-
}
211-
212-
export interface Flake8CategorySeverity {
213-
readonly F: DiagnosticSeverity;
214-
readonly E: DiagnosticSeverity;
215-
readonly W: DiagnosticSeverity;
216-
}
217-
export interface IMypyCategorySeverity {
218-
readonly error: DiagnosticSeverity;
219-
readonly note: DiagnosticSeverity;
220-
}
221188
export interface IInterpreterSettings {
222189
infoVisibility: 'never' | 'onPythonRelated' | 'always';
223190
}
224191

225-
export interface ILintingSettings {
226-
readonly enabled: boolean;
227-
readonly ignorePatterns: string[];
228-
readonly prospectorEnabled: boolean;
229-
readonly prospectorArgs: string[];
230-
readonly pylintEnabled: boolean;
231-
readonly pylintArgs: string[];
232-
readonly pycodestyleEnabled: boolean;
233-
readonly pycodestyleArgs: string[];
234-
readonly pylamaEnabled: boolean;
235-
readonly pylamaArgs: string[];
236-
readonly flake8Enabled: boolean;
237-
readonly flake8Args: string[];
238-
readonly pydocstyleEnabled: boolean;
239-
readonly pydocstyleArgs: string[];
240-
readonly lintOnSave: boolean;
241-
readonly maxNumberOfProblems: number;
242-
readonly pylintCategorySeverity: IPylintCategorySeverity;
243-
readonly pycodestyleCategorySeverity: IPycodestyleCategorySeverity;
244-
readonly flake8CategorySeverity: Flake8CategorySeverity;
245-
readonly mypyCategorySeverity: IMypyCategorySeverity;
246-
cwd?: string;
247-
prospectorPath: string;
248-
pylintPath: string;
249-
pycodestylePath: string;
250-
pylamaPath: string;
251-
flake8Path: string;
252-
pydocstylePath: string;
253-
mypyEnabled: boolean;
254-
mypyArgs: string[];
255-
mypyPath: string;
256-
banditEnabled: boolean;
257-
banditArgs: string[];
258-
banditPath: string;
259-
}
260-
261192
export interface ITerminalSettings {
262193
readonly executeInFileDir: boolean;
263194
readonly focusAfterLaunch: boolean;

src/client/common/utils/localize.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -506,14 +506,3 @@ export namespace CreateEnv {
506506
export const disableCheckWorkspace = l10n.t('Disable (Workspace)');
507507
}
508508
}
509-
510-
export namespace ToolsExtensions {
511-
export const flake8PromptMessage = l10n.t(
512-
'Use the Flake8 extension to enable easier configuration and new features such as quick fixes.',
513-
);
514-
export const pylintPromptMessage = l10n.t(
515-
'Use the Pylint extension to enable easier configuration and new features such as quick fixes.',
516-
);
517-
export const installPylintExtension = l10n.t('Install Pylint extension');
518-
export const installFlake8Extension = l10n.t('Install Flake8 extension');
519-
}

0 commit comments

Comments
 (0)