[PATCH v2] coding-style: Document 100 chars limit for line length

Michal Privoznik posted 1 patch 3 years, 5 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/d02d53ab33965420f9441dcfff697a6fa300d6a1.1606920810.git.mprivozn@redhat.com
docs/coding-style.rst | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
[PATCH v2] coding-style: Document 100 chars limit for line length
Posted by Michal Privoznik 3 years, 5 months ago
The idea is to have it like a soft limit: if possible then break
lines, if not then have a long line instead of some creative
approach.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---

v2 of:

https://www.redhat.com/archives/libvir-list/2020-November/msg01600.html

 docs/coding-style.rst | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/docs/coding-style.rst b/docs/coding-style.rst
index cfd7b16638..b3ac070fac 100644
--- a/docs/coding-style.rst
+++ b/docs/coding-style.rst
@@ -131,7 +131,7 @@ around operators and keywords:
 
   indent-libvirt()
   {
-    indent -bad -bap -bbb -bli4 -br -ce -brs -cs -i4 -l75 -lc75 \
+    indent -bad -bap -bbb -bli4 -br -ce -brs -cs -i4 -l100 -lc100 \
            -sbi4 -psl -saf -sai -saw -sbi4 -ss -sc -cdw -cli4 -npcs -nbc \
            --no-tabs "$@"
   }
@@ -141,6 +141,9 @@ further, by piping it through ``expand -i``, since some leading
 TABs can get through. Usually they're in macro definitions or
 strings, and should be converted anyhow.
 
+The maximum permitted line length is 100 characters, but lines
+should aim to be approximately 80 characters.
+
 Libvirt requires a C99 compiler for various reasons. However, most
 of the code base prefers to stick to C89 syntax unless there is a
 compelling reason otherwise. For example, it is preferable to use
-- 
2.26.2

Re: [PATCH v2] coding-style: Document 100 chars limit for line length
Posted by Daniel P. Berrangé 3 years, 5 months ago
On Wed, Dec 02, 2020 at 03:54:28PM +0100, Michal Privoznik wrote:
> The idea is to have it like a soft limit: if possible then break
> lines, if not then have a long line instead of some creative
> approach.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
> 
> v2 of:
> 
> https://www.redhat.com/archives/libvir-list/2020-November/msg01600.html

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|