Skip to content

Commit 601777c

Browse files
Fixed regex for Pylama output (#18339)
* Fixed regex for pylama output * added optional error code as it is not reported when using mypy * added news
1 parent 273cf57 commit 601777c

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

news/2 Fixes/15609.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixes Pylama and MyPy output parsing (thanks [Nicola Marella](https://github.com/nicolamarella))

src/client/linters/pylama.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { BaseLinter } from './baseLinter';
66
import { ILintMessage, LintMessageSeverity } from './types';
77

88
const REGEX =
9-
'(?<file>.py):(?<line>\\d+):(?<column>\\d+): \\[(?<type>\\w+)\\] (?<code>\\w\\d+):? (?<message>.*)\\r?(\\n|$)';
9+
'(?<file>.py):(?<line>\\d+):(?<column>\\d+):? \\[(?<type>\\w+)\\]( (?<code>\\w\\d+)?:?)? (?<message>.*)\\r?(\\n|$)';
1010
const COLUMN_OFF_SET = 1;
1111

1212
export class PyLama extends BaseLinter {

0 commit comments

Comments
 (0)