From patchwork Thu May 4 13:12:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Fancellu X-Patchwork-Id: 13231210 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 32AF7C77B7C for ; Thu, 4 May 2023 13:13:10 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.529728.824446 (Exim 4.92) (envelope-from ) id 1puYlZ-0004Tv-67; Thu, 04 May 2023 13:13:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 529728.824446; Thu, 04 May 2023 13:13:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1puYlY-0004SZ-UU; Thu, 04 May 2023 13:13:00 +0000 Received: by outflank-mailman (input) for mailman id 529728; Thu, 04 May 2023 13:12:59 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1puYlX-0003tK-OS for xen-devel@lists.xenproject.org; Thu, 04 May 2023 13:12:59 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-sth1.inumbo.com (Halon) with ESMTP id 64104f88-ea7d-11ed-b226-6b7b168915f2; Thu, 04 May 2023 15:12:59 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CC979139F; Thu, 4 May 2023 06:13:42 -0700 (PDT) Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 56C753F67D; Thu, 4 May 2023 06:12:57 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 64104f88-ea7d-11ed-b226-6b7b168915f2 From: Luca Fancellu To: xen-devel@lists.xenproject.org Cc: bertrand.marquis@arm.com, wei.chen@arm.com, Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH 3/3] xen/misra: xen-analysis.py: use the relative path from the ... Date: Thu, 4 May 2023 14:12:45 +0100 Message-Id: <20230504131245.2985400-4-luca.fancellu@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230504131245.2985400-1-luca.fancellu@arm.com> References: <20230504131245.2985400-1-luca.fancellu@arm.com> MIME-Version: 1.0 repository in the reports Currently the cppcheck report entries shows the relative file path from the /xen folder of the repository instead of the base folder. In order to ease the checks, for example, when looking a git diff output and the report, use the repository folder as base. Signed-off-by: Luca Fancellu Acked-by: Stefano Stabellini Tested-by: Stefano Stabellini --- xen/scripts/xen_analysis/cppcheck_analysis.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/scripts/xen_analysis/cppcheck_analysis.py b/xen/scripts/xen_analysis/cppcheck_analysis.py index c3783e8df343..c8abbe0fca79 100644 --- a/xen/scripts/xen_analysis/cppcheck_analysis.py +++ b/xen/scripts/xen_analysis/cppcheck_analysis.py @@ -149,7 +149,7 @@ def generate_cppcheck_deps(): --suppress='unusedStructMember:*' --include={}/include/xen/config.h -DCPPCHECK -""".format(settings.xen_dir, settings.outdir, settings.xen_dir) +""".format(settings.repo_dir, settings.outdir, settings.xen_dir) invoke_cppcheck = utils.invoke_command( "{} --version".format(settings.cppcheck_binpath), @@ -240,7 +240,7 @@ def generate_cppcheck_report(): try: cppcheck_report_utils.cppcheck_merge_txt_fragments(fragments, report_filename, - [settings.xen_dir]) + [settings.repo_dir]) except cppcheck_report_utils.CppcheckTXTReportError as e: raise CppcheckReportPhaseError(e) @@ -257,7 +257,7 @@ def generate_cppcheck_report(): try: cppcheck_report_utils.cppcheck_merge_xml_fragments(fragments, xml_filename, - settings.xen_dir, + settings.repo_dir, settings.outdir) except cppcheck_report_utils.CppcheckHTMLReportError as e: raise CppcheckReportPhaseError(e) @@ -265,7 +265,7 @@ def generate_cppcheck_report(): utils.invoke_command( "{} --file={} --source-dir={} --report-dir={}/html --title=Xen" .format(settings.cppcheck_htmlreport_binpath, xml_filename, - settings.xen_dir, html_report_dir), + settings.repo_dir, html_report_dir), False, CppcheckReportPhaseError, "Error occured generating Cppcheck HTML report:\n{}" ) @@ -273,7 +273,7 @@ def generate_cppcheck_report(): html_files = utils.recursive_find_file(html_report_dir, r'.*\.html$') try: cppcheck_report_utils.cppcheck_strip_path_html(html_files, - (settings.xen_dir, + (settings.repo_dir, settings.outdir)) except cppcheck_report_utils.CppcheckHTMLReportError as e: raise CppcheckReportPhaseError(e)