From nobody Thu Apr 25 23:58:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1602771612; cv=none; d=zohomail.com; s=zohoarc; b=N7PoEwMhc1w+JNZW0vYcE3xjHqDFZ6v5KvvjY24NlN+Anx6Wr6JKVHj8VRpIv6isoV+B1ePGMKd0JVjsk9DiwcBGIQTXhNGL2HKq4E8KeovFa7slYDtp+WI1KRmbIuSCbUbuSMDr3PsMBf+OPZb5J4z6mE7LtY1W8YOiiJ+AbDU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602771612; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=KJw2kGF0SWuttTIPIfhoyPVFYdzUB9AKxu0McAVgWnI=; b=AI1gLRpp7epGOAoSDath5iyREkhsH3fODBBD98YQ3L7AlhlqOWVjnlKRsDl/qI+xbmCkhFKXdvCh2+oBOx8330XK01/jFdnlhuGW6c+SWh/WzsanGMSo+VxKPGbqV3tiWAVCmd+SN0+2CBea5m6MAQ0qynj3mPnhRHiwu9QIPFE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1602771612549456.6688151519653; Thu, 15 Oct 2020 07:20:12 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-279--BcbUywpPfmHnzVZXyol1Q-1; Thu, 15 Oct 2020 10:20:08 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 090BF18A0764; Thu, 15 Oct 2020 14:20:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D7FEA5D9D5; Thu, 15 Oct 2020 14:20:02 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 901695810D; Thu, 15 Oct 2020 14:20:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 09FEK1cr007372 for ; Thu, 15 Oct 2020 10:20:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 80B685D9E8; Thu, 15 Oct 2020 14:20:01 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 01CDA5D9DD for ; Thu, 15 Oct 2020 14:19:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602771611; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=KJw2kGF0SWuttTIPIfhoyPVFYdzUB9AKxu0McAVgWnI=; b=H3PEWKlGo8bG77w8/ynFc1htuAGqfnTI42NMzEf4t06JgxPjEBP3shIxCU8sx4bDyg5MIV EZVisgxVuIS2KNE8fosJburDQAc+ZHrlsgJP/qVFnfoF0R4hKhgd4PHf8isXG+tKTi/rlS ot+En7ueM0Qzs+8X0hNWGcKoMV9dgzQ= X-MC-Unique: -BcbUywpPfmHnzVZXyol1Q-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2] docs: Document camelCase preference for XML elements and attributes Date: Thu, 15 Oct 2020 16:19:48 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Recently I've merged a patch that used hyphens in an attribute name. I fixed it later, but turned out we don't document our preference which is camelCase. Suggested-by: Erik Skultety Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- diff to v1: - Extended coding style too. docs/api_extension.html.in | 6 ++++++ docs/coding-style.rst | 15 +++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/docs/api_extension.html.in b/docs/api_extension.html.in index 6c64e83314..d7696056ac 100644 --- a/docs/api_extension.html.in +++ b/docs/api_extension.html.in @@ -110,6 +110,12 @@ src/libvirt_public.syms

=20 +

+ Please note that single word names for attributes and elements is + preferred. But if you have to use two ore more words please join the= m in + camelCase style. +

+

This task is in many ways the most important to get right, since once the API has been committed to the repository, it's libvirt's policy diff --git a/docs/coding-style.rst b/docs/coding-style.rst index 44e5265a60..cfd7b16638 100644 --- a/docs/coding-style.rst +++ b/docs/coding-style.rst @@ -960,3 +960,18 @@ git): cleanup: /* ... do other stuff ... */ } + + +XML element and attribute naming +-------------------------------- + +New elements and/or attributes should be short and descriptive. +In general, they should reflect what the feature does instead of +how exactly it is named in given hypervisor because this creates +an abstraction that other drivers can benefit from (for instance +if the same feature is named differently in two hypervisors). +That is not to say an element or attribute can't have the same +name as in a hypervisor, but proceed with caution. + +Single worded names are preferred, but if more words must be +used then they shall be joined in camelCase style. --=20 2.26.2