diff --git a/HISTORY.rst b/HISTORY.rst index 91a0d596..0088200b 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -54,6 +54,7 @@ Please check `Migration guide from 5.x to 6.0 `__ configuration file (`issue #4186 `_) - Added ability to override a tool version using the `platform_packages `__ option (`issue #3798 `_) + - Fixed an issue with improper handling of defects that don't specify a source file (`issue #4237 `_) * **Build System** diff --git a/platformio/commands/check/defect.py b/platformio/commands/check/defect.py index 5e907d3e..d271ab48 100644 --- a/platformio/commands/check/defect.py +++ b/platformio/commands/check/defect.py @@ -34,7 +34,7 @@ class DefectItem(object): severity, category, message, - file="unknown", + file=None, line=0, column=0, id=None, @@ -50,7 +50,7 @@ class DefectItem(object): self.callstack = callstack self.cwe = cwe self.id = id - self.file = file + self.file = file or "unknown" if file.lower().startswith(get_project_dir().lower()): self.file = os.path.relpath(file, get_project_dir())