mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
docs: Document camelCase preference for XML elements and attributes
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 <eskultet@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
6a0e0dc7ba
commit
da20178709
@ -110,6 +110,12 @@
|
|||||||
src/libvirt_public.syms
|
src/libvirt_public.syms
|
||||||
</code></p>
|
</code></p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Please consult our
|
||||||
|
<a href="coding-style.html#xml-element-and-attribute-naming">coding style</a>
|
||||||
|
guide on elements and attribute names.
|
||||||
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
This task is in many ways the most important to get right, since once
|
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
|
the API has been committed to the repository, it's libvirt's policy
|
||||||
|
@ -960,3 +960,18 @@ git):
|
|||||||
cleanup:
|
cleanup:
|
||||||
/* ... do other stuff ... */
|
/* ... 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.
|
||||||
|
Loading…
Reference in New Issue
Block a user