diff --git a/news/1 Enhancements/2906.md b/news/1 Enhancements/2906.md new file mode 100644 index 000000000000..209e19264d78 --- /dev/null +++ b/news/1 Enhancements/2906.md @@ -0,0 +1,2 @@ +Use Pylint message names instead of codes +(thanks to [Roman Kornev](https://github.com/RomanKornev/)) diff --git a/src/client/linters/pylint.ts b/src/client/linters/pylint.ts index ef015a260c46..250b8a182647 100644 --- a/src/client/linters/pylint.ts +++ b/src/client/linters/pylint.ts @@ -15,6 +15,8 @@ import { ILintMessage } from './types'; const pylintrc = 'pylintrc'; const dotPylintrc = '.pylintrc'; +const REGEX = '(?\\d+),(?-?\\d+),(?\\w+),(?[\\w-]+):(?.*)\\r?(\\n|$)'; + export class Pylint extends BaseLinter { private fileSystem: IFileSystem; private platformService: IPlatformService; @@ -67,12 +69,12 @@ export class Pylint extends BaseLinter { ]; } const args = [ - '--msg-template=\'{line},{column},{category},{msg_id}:{msg}\'', + '--msg-template=\'{line},{column},{category},{symbol}:{msg}\'', '--reports=n', '--output-format=text', uri.fsPath ]; - const messages = await this.run(minArgs.concat(args), document, cancellation); + const messages = await this.run(minArgs.concat(args), document, cancellation, REGEX); messages.forEach(msg => { msg.severity = this.parseMessagesSeverity(msg.type, this.pythonSettings.linting.pylintCategorySeverity); });