From 0194e094106bba97eed0cbe15b676abe5b5472fb Mon Sep 17 00:00:00 2001 From: valeros Date: Mon, 28 Oct 2019 18:37:14 +0200 Subject: [PATCH] Use simple abspath to get absolute path to file with defect --- platformio/commands/check/defect.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/platformio/commands/check/defect.py b/platformio/commands/check/defect.py index ca5d0e03..e864356e 100644 --- a/platformio/commands/check/defect.py +++ b/platformio/commands/check/defect.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from os.path import isabs, isfile, join, relpath +from os.path import abspath, relpath import click @@ -82,15 +82,11 @@ class DefectItem(object): raise Exception("Unknown severity label -> %s" % label) def as_dict(self): - filepath = self.file - if not isabs(filepath) and isfile(join(get_project_dir(), filepath)): - filepath = join(get_project_dir(), filepath) - return { "severity": self.SEVERITY_LABELS[self.severity], "category": self.category, "message": self.message, - "file": filepath, + "file": abspath(self.file), "line": self.line, "column": self.column, "callstack": self.callstack,