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

Re: debian/upstream: How to verify valid yaml



Hello Andreas!

I think a lintian Error would be appropriate for the invalid YAML, with a helpful description of the resolution (quoting). For me it is no
problem to put the quotes, it would be a bigger challenge/barrier to have to research the solution (as I had to when I first stumbled over it).
So if lintian warns me about it and tells what to do (-i), that's all right in my view and it also educates us in the right direction.

Best,

Laszlo

On 29/02/12 08:39, Andreas Tille wrote:
> On Wed, Feb 29, 2012 at 09:47:28AM +0900, Charles Plessy wrote:
>> I actually missed that you tried to inject the whole files.
> 
> I do not want to inject whole files.  I just want to parse the original
> upstream files and the python-yaml parser failed for several of the
> available upstream files because these do not contain valid YAML syntax
> (and for all those I verified the String ': ' is responsible for the
> problem).
> 
>> On the gathering
>> part, I am preparing a trigger that will update each packages that are
>> newly uploaded to the archive, by monitoring debian-devel-changes.  I hope
>> to push this on upstream-metadata.debian.net this week-end.
>>
>>   http://git.debian.org/?p=users/plessy/umegaya.git
> 
> Fine.
>  
>> For the YAML syntax, I validate using the way I documented on the wiki:
>>
>>   http://wiki.debian.org/UpstreamMetadata
>>   perl -MYAML -e '$/="";  Load(<STDIN>)' < upstream  # needs the libyaml-perl package installed
>>
>> This can easily become a Lintian check.
>>
>> But where is your SeaView upstream file from ?  In SVN and Unstable, there is a
>> space between the colon and the number:
>>
>>    title: SeaView version 4 : a multiplatform graphical user interface for sequence alignment and phylogenetic tree building
> 
> It might be that I did some editing before quoting here.  Feel free to try
> what you find in SVN with the Syntax checker at
> 
>    http://yaml-online-parser.appspot.com/
> 
> Whether there is a space in front of the ': ' or not does not seem to
> matter and if we want to let people edit those strings they will forget
> those tricks (and from an estetical point of view the spae before the
> colon is terribly ugly).
>  
>> I see that the Perl module validates both versions with and without space
>> anyway.  If this module is too laxist, we need to recommend another one.
> 
> I also tried
> 
>    $ kwalify -f schema.yaml upstream 
> /usr/lib/ruby/1.8/yaml.rb:217:in `load_documents': syntax error on line 7, col 27: ` title: SeaView version 4 : a multiplatform graphical user interface for sequence alignment and phylogenetic tree building' (ArgumentError)
> 
> where
> 
> $ cat schema.yaml 
> type:   seq
> sequence:
>   - type:   str
> 
> So I think kwalify (written in Ruby) as well as Python parser agree that
> there is some problem here and when reading the specification I agree
> with this (even if I never touched YAML before and I'm far from
> pretending any knowledge in this topic).
> 
> The question is, what we should really do.  Trying to force people to
> learn how to type valid YAML will not increase the acceptance of
> debian/upstream so I would love to keep the current syntax.  If the
> YAML parser of Perl is more relaxed about this syntax I could try to
> find some means to call this as a filter before importing into Python
> (which seems to be necessary for UDD importers.
> 
> Alternatively we at least should enforce people to use quotes around
> titles containing ': ' strings (which works with the Python parser).
> 
> Kind regards
> 
>        Andreas.
> 


Reply to: