mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 01:57:13 +02:00
Export full path to file with defect
This commit is contained in:
@ -159,10 +159,10 @@ def cli(
|
|||||||
click.echo("No defects found")
|
click.echo("No defects found")
|
||||||
print_processing_footer(result)
|
print_processing_footer(result)
|
||||||
|
|
||||||
if json_output:
|
if json_output:
|
||||||
click.echo(dump_json_to_unicode(results_to_json(results)))
|
click.echo(dump_json_to_unicode(results_to_json(results)))
|
||||||
elif not silent:
|
elif not silent:
|
||||||
print_check_summary(results)
|
print_check_summary(results)
|
||||||
|
|
||||||
command_failed = any(r.get("succeeded") is False for r in results)
|
command_failed = any(r.get("succeeded") is False for r in results)
|
||||||
if command_failed:
|
if command_failed:
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from os.path import relpath
|
from os.path import isabs, isfile, join, relpath
|
||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
@ -82,11 +82,15 @@ class DefectItem(object):
|
|||||||
raise Exception("Unknown severity label -> %s" % label)
|
raise Exception("Unknown severity label -> %s" % label)
|
||||||
|
|
||||||
def as_dict(self):
|
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 {
|
return {
|
||||||
"severity": self.SEVERITY_LABELS[self.severity],
|
"severity": self.SEVERITY_LABELS[self.severity],
|
||||||
"category": self.category,
|
"category": self.category,
|
||||||
"message": self.message,
|
"message": self.message,
|
||||||
"file": self.file,
|
"file": filepath,
|
||||||
"line": self.line,
|
"line": self.line,
|
||||||
"column": self.column,
|
"column": self.column,
|
||||||
"callstack": self.callstack,
|
"callstack": self.callstack,
|
||||||
|
Reference in New Issue
Block a user