From adbe7f8e10aa6ba4683059b41b1768399fc9000e Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sat, 13 Apr 2019 11:31:27 +0200 Subject: [PATCH] Do not capture 'filename' phpmd resolves all paths to 'real' paths and uses such 'real' paths in the reports. Since we cannot map such a 'real' path back to a 'user' path, we MUST not capture these filename. Fixes #21 --- linter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linter.py b/linter.py index 2446a95..938dbfc 100644 --- a/linter.py +++ b/linter.py @@ -4,8 +4,10 @@ class Phpmd(Linter): cmd = ('phpmd', '${temp_file}', 'text') regex = ( - r'(?P.+):(?P\d+)' - r'\s*(?P.+)$' + # For now, do *NOT* capture 'filename' since phpmd reports 'real' + # paths, and Sublime and SL cannot map such paths to the original + # `view.file_name()`. + r'(.+):(?P\d+)\s*(?P.+)$' ) on_stderr = None # handle stderr via regex default_type = WARNING