Skip to content

Commit

Permalink
Improve error messaging for linters
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiknadig committed Sep 14, 2023
1 parent b76f100 commit a673313
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/client/linters/errorHandlers/standard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@ export class StandardErrorHandler extends BaseErrorHandler {
const info = linterManager.getLinterInfo(execInfo.product!);

traceError(`There was an error in running the linter ${info.id}`, error);
if (info.id === LinterId.PyLint) {
traceError('Support for "pylint" is moved to ms-python.pylint extension.');
traceError(
'Please install the extension from: https://marketplace.visualstudio.com/items?itemName=ms-python.pylint',
);
} else if (info.id === LinterId.Flake8) {
traceError('Support for "flake8" is moved to ms-python.flake8 extension.');
traceError(
'Please install the extension from: https://marketplace.visualstudio.com/items?itemName=ms-python.flake8',
);
} else if (info.id === LinterId.MyPy) {
traceError('Support for "mypy" is moved to ms-python.mypy-type-checker extension.');
traceError(
'Please install the extension from: https://marketplace.visualstudio.com/items?itemName=ms-python.mypy-type-checker',
);
}
traceError(`If the error is due to missing ${info.id}, please install ${info.id} using pip manually.`);
traceError('Learn more here: https://aka.ms/AAlgvkb');
traceLog(`Linting with ${info.id} failed.`);
traceLog(error.toString());

Expand Down

0 comments on commit a673313

Please sign in to comment.