[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] xen/cppcheck: sort alphabetically cppcheck report entries


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Mon, 9 Jan 2023 14:26:09 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+3bVSUkzFmxk0AlM4PzpGnlkh7s26gh58imKCbjKBkM=; b=HoYNfgN6Xm0gRCjf6z8/8OwuAVnty+ouRCY+F1B3hiFL+Lryh5v6hXKBrXetd7qQq1ZNnj0/s4otdoDC8K0EJOrO5fpjrtf8v3FVfornm/72uTW69So7DnZyFZepB9Aat+zFkdtcq8tX8793pDJ4/6WSCpANfhH+533yIqqZcmFeps/57kFK2o4i1IsXFr1ewlR5r2APcI3i7qHGgkVUTdITs5a2r08kH+Re8y0rbf7VOZxUuiLMeO2GvNUhE9/EXU2ZryUS/xdj2CTDCCij5lPpPkoJtHBM2m1uO1I39gThhHvssfyXlpfrIftEf8A+7G+SK9x/MNQ1HH/py3QcxA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aotWyTUWM/zHOa6IMaZd0fnPscRN+QscPodxHs4dvVDd0IbSAbn2IEOd/vmx57ao6j2p4xFoV5PxR1bthqt3GLYKTXW8WWfUHUkIKDI5Rzb5bsyrY+uxE68CAGQDf7vEXObaiVd1230m9KiuVPuXXST5vcypkz/yLMUL0/jOmSx8S/hPDYGMdFLnRb8soKjiN72Dq71xn0FfD+9/x+wLI5IZFzufwzD+VYsUE/pioJMn8gu3rSQiqJMaScQI00tnCoRY5YAjxu1SpIub00r1a9PKyCBvD9caOrdB9eDJ9k+Szx7rYip9Qo7R+O4XEJXoZ9t04Fo4LXNLIh+ZkpBtcw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Wei Chen <Wei.Chen@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 09 Jan 2023 14:26:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZIbt/3GyhUKyUOka+bjXcc10z+K6V88UAgAAHeACAAC3gAA==
  • Thread-topic: [PATCH 1/2] xen/cppcheck: sort alphabetically cppcheck report entries


> On 9 Jan 2023, at 11:41, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 09.01.2023 12:15, Michal Orzel wrote:
>> On 06/01/2023 11:41, Luca Fancellu wrote:
>>> Sort alphabetically cppcheck report entries when producing the text
>>> report, this will help comparing different reports and will group
>>> together findings from the same file.
>>> 
>>> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
>>> ---
>>> xen/scripts/xen_analysis/cppcheck_report_utils.py | 2 ++
>>> 1 file changed, 2 insertions(+)
>>> 
>>> diff --git a/xen/scripts/xen_analysis/cppcheck_report_utils.py 
>>> b/xen/scripts/xen_analysis/cppcheck_report_utils.py
>>> index 02440aefdfec..f02166ed9d19 100644
>>> --- a/xen/scripts/xen_analysis/cppcheck_report_utils.py
>>> +++ b/xen/scripts/xen_analysis/cppcheck_report_utils.py
>>> @@ -104,6 +104,8 @@ def cppcheck_merge_txt_fragments(fragments_list, 
>>> out_txt_file, strip_paths):
>>>                 for path in strip_paths:
>>>                     text_report_content[i] = text_report_content[i].replace(
>>>                                                                 path + "/", 
>>> "")
>>> +            # sort alphabetically the entries
>>> +            text_report_content.sort()
>>>             # Write the final text report
>>>             outfile.writelines(text_report_content)
>>>     except OSError as e:
>>> --
>>> 2.17.1
>>> 
>>> 
>> 

Hi Michal, Jan,

>> Having the report sorted is certainly a good idea. I am just thinking 
>> whether it should be done
>> per file or per finding (e.g. rule). When fixing MISRA issues, best approach 
>> is to try to fix all
>> the issues for a given rule (i.e. a series fixing one rule) rather than all 
>> the issues in a file
>> from different rules. Having a report sorted per finding would make this 
>> process easier. We could
>> add a custom key to sort function to take the second element (after 
>> splitting with ':' separator)
>> which is the name of the finding to achieve this goal. Let me know your 
>> thoughts.
> 
> +1 - sorting by file name wants to be the 2nd sorting criteria, i.e. only 
> among
> all instances of the same finding.

Yes both suggestions make sense to me.

> 
> Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.