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

Re: [PATCH] CODING_STYLE: Add a section of the naming convention


  • To: Julien Grall <julien@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Mon, 4 Dec 2023 11:46:19 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • 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=2; 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=SH786Qtaz73U3Uy/0RWfSRhyfkNXha2QcuCH9A5W2ho=; b=b7z6+88Yy61KclfbWYJ4mqIfxDlJZn3Z3Y0TMd+17x3Xd6ISP/JA70xJ0cinORkz5nj2Je0HkMGJKtzS9Dz8P/3aJH+zgJ18G4E/qw93sZWUHCPGGEb1HZ9EQho2pHVKEhrN6H8Lu4ck4tLXB1P8Pmjj7NQLfeWqGm10f8x6grr7QquPGQI2yCQuSF/ZJnT2qOU7bz0Knk/eDXRJmUmgXuTk74eAsxwJURfTMaiT8jupfIcnbb1Jq7Yf8ejERjTpiS+jLzG+/4uqbKr2xavA97kcFo1OuJHOT8867lcnXDaoCoAbwo9GD9nALTSzaZMwSos06TK2V0LUVlgZo7//Fw==
  • 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=SH786Qtaz73U3Uy/0RWfSRhyfkNXha2QcuCH9A5W2ho=; b=HvjjlyKfoPSdJffDu6ujHHjjfySj+V6AlMGzP4EPtXT+bOUPYks2DPE2/BdYffJDQPdX2+ASP5je6coAeJN9E6DKLAHkLyuuy4F0WxTUluqtvPE3mvg9blHvZAAAZhZs2tT/9Ukfr/10Xter71ZhyUffTWC+Emn6sHtseyRmiuJxOuZ0p1IFeSXowLNCxq8Gvb974tFkYkSqx5i1XjpLIgwKvhKXpRXiymr+5t/1Qo0uMSAl76KKYRWwCxTPBn1cZSDRxZRxtwQ8mMlDZI+nkUiAuPpeBlObu3oqYhbnlTDh1KFyCXxcYqb/jLSIL71kmkotV9gIa1Rkv8g91+p3uA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=ISfpEJ/F75lkpHwHno327eWarUpCXlAD7458PCGbQPLFAgFR/dkblm10U+flK6vu+DVgqVz9+rPgFdZCPzTqm9AOyXyv+pVfpBi2eP/JaAx/Lk8DLydT9o+kJRRZX2YM/w+tpk52jyal3XKhXEo7BwFcPf0o5fa8SY8G8LoaS9Jg3A0v9YRoUo9/iwPHzuAtXNwGNOf4hLcfDVS0A0bomgy1WPKZl4y9lDZSUV/dZftHUzvP9n+nQSQlfbeHlEXkcf36OEmWdOTVKOOGuwGNarrISay5BzPvr6drfuLgLvJgIOkhrgJA5/mnljuQHQlxyvo4kS6x2Vb9HDQ7twm2yw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PoOn4PnyZxnw4tSjvjs7rKvXtO+rN2ugIdLkn60MtTZxEP9gOwdVJ05wI5yxq8r2/ZipDYbnyHnbIyna0UtaTohLzwYVoJ8QaF6/eS8xJAU6FJo2BkgmpsWqmNZfA5aqdwkuwyJivaKUb08+sdbrtDuB05gH5Nj+fGjzZE4L76Dm74nlbtmxlzSdE4lUVcfcQH1N99koW6A9R22aMBok0SwE/Uc+4nC+J1f0uyI6wdpL4DtAm6J9ATXn98S+ZETdbvRixUYXMkrWDPFRWbEEXHIvEgI9kM2dkKKq4C2/LRBrwJjLC9tOvDXigTnFTqBg6yqna1aZ8pexAp2wTL7x4w==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 04 Dec 2023 11:47:14 +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: AQHaJIbmwHP4nuD1ZUiv2fi04v+voLCUxT2AgAQ5aoCAAAMKAIAABDEA
  • Thread-topic: [PATCH] CODING_STYLE: Add a section of the naming convention


> On 4 Dec 2023, at 11:31, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Luca,
> 
> On 04/12/2023 11:20, Luca Fancellu wrote:
>>> On 1 Dec 2023, at 18:49, Julien Grall <julien@xxxxxxx> wrote:
>>> 
>>> 
>>> 
>>> On 01/12/2023 18:47, Julien Grall wrote:
>>>> From: Julien Grall <jgrall@xxxxxxxxxx>
>>>> Several maintainers have expressed a stronger preference
>>>> to use '-' when in filename and option that contains multiple
>>>> words.
>>>> So document it in CODING_STYLE.
>>>> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
>>>> ---
>>>>  CODING_STYLE | 9 +++++++++
>>>>  1 file changed, 9 insertions(+)
>>>> diff --git a/CODING_STYLE b/CODING_STYLE
>>>> index ced3ade5a6fb..afd09177745b 100644
>>>> --- a/CODING_STYLE
>>>> +++ b/CODING_STYLE
>>>> @@ -144,6 +144,15 @@ separate lines and each line should begin with a 
>>>> leading '*'.
>>>>   * Note beginning and end markers on separate lines and leading '*'.
>>>>   */
>>>>  +Naming convention
>>>> +-----------------
>>>> +
>>>> +When command line option or filename contain multiple words, a '-'
>>>> +should be to separate them. E.g. 'timer-works'.
>>>> +
>>>> +Note that some of the option and filename are using '_'. This is now
>>>> +deprecated.
>>> 
>>> Urgh, I sent the wrong draft :(. This is the wording I wanted to propose:
>>> 
>>> +Naming convention
>>> +-----------------
>>> +
>>> +'-' should be used to separate words in commandline options and filenames.
>>> +E.g. timer-works.
>>> +
>>> +Note that some of the options and filenames are using '_'. This is now
>>> +deprecated.
>>> +
>>> 
>> Hi Julien,
>> Can we make an exception for python files that are meant to be used as 
>> module?
>> Because modules containing ‘-‘ cannot be imported using ‘import’ keyword and
>> needs another way to do them which is not conventional
> 
> I am not sure this needs to be written down explicitely. At the top of the 
> file we have:
> 
> "The Xen coding style described below is the coding style used by the
> Xen hypervisor itself (xen/*) as well as various associated low-level
> libraries (e.g. tools/libxc/*).
> 
> An exception is made for files which are imported from an external
> source. In these cases the prevailing coding style of the upstream
> source is generally used (commonly the Linux coding style).
> 
> Other parts of the code base may use other coding styles, sometimes
> explicitly (e.g. tools/libxl/CODING_STYLE) but often implicitly (Linux
> coding style is fairly common). In general you should copy the style
> of the surrounding code. If you are unsure please ask."
> 
> and I would not describe Python as low-level.

Ok makes sense to me! Thanks


> 
> Cheers,
> 
> -- 
> Julien Grall


 


Rackspace

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