[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 1/5] [WIP]misra: add entries to the excluded list
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Mon, 31 Jul 2023 15:11:56 +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=RyxGJmuhSR0pSU7rr9xzMVldaOtVAHUzhStjevrfrLY=; b=aKQMKoGUNbuCxf6smlnIjlMWghTzYoIiBu86wSYrikkAqMX1RpwLR1qd9DDonSxPlhraVUkCYvSfnJKrGejohuTd4Vwy6RjfLKNWC2GSSISltp9HW/SOI1q1SV7F7n2r0X9jsbPQI0RRiYOLA7u/Ow4rZZ9X04hyiW6D35R/gvgy5t23tVpU9ky2n2DVXF/74F6oopwXbslNWWvAfSEj6kIYokiRgxZViayBwgNkrE0EwVnJ53W3AiiomX2i1H0ya242kXCjwMkvix8pptJfmPva91iLMuNk/nOKIEdQZT6h4Q2dlWClHKXktG6E8ZJUX/Mj8T0Qiar5JD1cbC7whw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X1PislAWDjzMlxNbbrsbFZDqB1G+nDnE89IyA0sWVlO0gAekhQhdJj/c08KV6zlOZD+K3A+l7z602eYKHNyGi+puroCllxrnc1YqNeR/3LTyUXt/fRQTaqI48krFN7vq3Y/5Q64087jIo3Lz/As9/ubHgFX74cwPt55PDpF6uc3BW0RRNCdzzUPzUJ4CpBgX74V8UTdp67OcB2C0sr6IvoE3VAoB6rPJLMQQ0DddqEX17y3DUDHlRLPw/DXFTG/YrNumxiA6qjur48NsFmIb8W7DgB+XI+X+1i3Fgxp6mOARtDcF0jXmZBcGBla91+JV4e0iwGG+g+Pety6035DERg==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Mon, 31 Jul 2023 15:13:19 +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: AQHZwSs9042EQJWI+kCE6wP5BUPzKq/T/JsAgAADsAA=
- Thread-topic: [RFC PATCH 1/5] [WIP]misra: add entries to the excluded list
Hi Jan,
>> + {
>> + "rel_path": "arch/x86/include/asm/bug.h",
>> + "comment": "Includes mostly assembly macro"
>> + },
>
> Mind me asking why assembly macros wouldn't want maintaining in proper
> style?
From what I know (experts on CF correct me if I am wrong) clang-format is meant
to format only some languages
(C/C++/...) and assembly is not one of them, so what is happening is that most
of the time clang-format breaks
it, in fact we are formatting only .c and .h, but since we have some headers
with assembly macros, I’ve seen some issues
that ranges from really ugly formatting to build break.
One thing we could do, is to export the headers that contain only assembly
stuffs in dedicate headers (<header>_asm.h ?)
so that we could easily use a name regex to exclude "*_asm.h” from
clang-format? And also these headers could #error if
included when __ASSEMBLY__ is not defined?
But this requires some agreement on what is the best way I guess, you can know
better if it’s feasible or not.
>>
>> + {
>> + "rel_path": "include/public/**/**/*.h",
>> + "comment": "Public headers are quite sensitive to format tools"
>> + },
>> + {
>> + "rel_path": "include/public/**/*.h",
>> + "comment": "Public headers are quite sensitive to format tools"
>> + },
>
> The common meaning of ** that I know is "any level directories", but
> since you use **/**/ above that can't be it here. Could you clarify
> what the difference of */ and **/ is here (or maybe in JSON in general)?
Yes I’ve found that python glob, that we use to solve the wildcard, solves the
** only for one level,
maybe we could do something better to solve that, but for now I left it as it
is to focus on the
clang-format configuration side.
Cheers,
Luca
>
> Jan
|