Hu Tao
2014-Nov-25 05:10 UTC
[Libguestfs] [PATCH] generator: force longdesc to begin with uppercase
As contrast to shortdesc which is forced to begin with lowercase, this patch forces longdesc to begin with uppercase. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> --- generator/checks.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generator/checks.ml b/generator/checks.ml index b57134b..376de3b 100644 --- a/generator/checks.ml +++ b/generator/checks.ml @@ -157,7 +157,9 @@ let () List.iter ( fun { name = name; longdesc = longdesc } -> if longdesc.[String.length longdesc-1] = '\n' then - failwithf "long description of %s should not end with \\n." name + failwithf "long description of %s should not end with \\n." name; + if longdesc.[0] <> Char.uppercase longdesc.[0] then + failwithf "long description of %s should begin with uppercase." name ) (all_functions @ fish_commands); (* Check proc_nrs. *) -- 1.9.3
Richard W.M. Jones
2014-Nov-25 14:36 UTC
Re: [Libguestfs] [PATCH] generator: force longdesc to begin with uppercase
On Tue, Nov 25, 2014 at 01:10:43PM +0800, Hu Tao wrote:> As contrast to shortdesc which is forced to begin with lowercase, this > patch forces longdesc to begin with uppercase. > > Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> > --- > generator/checks.ml | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/generator/checks.ml b/generator/checks.ml > index b57134b..376de3b 100644 > --- a/generator/checks.ml > +++ b/generator/checks.ml > @@ -157,7 +157,9 @@ let () > List.iter ( > fun { name = name; longdesc = longdesc } -> > if longdesc.[String.length longdesc-1] = '\n' then > - failwithf "long description of %s should not end with \\n." name > + failwithf "long description of %s should not end with \\n." name; > + if longdesc.[0] <> Char.uppercase longdesc.[0] then > + failwithf "long description of %s should begin with uppercase." name > ) (all_functions @ fish_commands); > > (* Check proc_nrs. *)ACK - I will push this shortly. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Reasonably Related Threads
- [PATCH 0/4] generator: Some work to split large C files
- [PATCH] generator: Add visibility to action struct
- [PATCH 1/2] Convert all TABs-as-indentation to spaces.
- [PATCH] generator: Add an explicit Cancellable flag
- [PATCH 0/6] Allow non-optargs functions to gain optional arguments.