Forrest Wu wrote:
>> Rich and I were discussing it and we thought it might make sense to 
>> split a new Keywords module, and have the presence-of-keywords 
>> detection moved to there, and only have HdrChk check the 
>> position/style of keywords.  This way - Teamware users continue to 
>> invoke 'wx keywords' which calls the old keywords check (which can 
>> assume Teamware), and we invoke Keywords via the Cadmium extension 
>> (which can then assume Mercurial) which saves us having to do the SCM 
>> detection.
> If we add another wrapper file for Mercurial, why not add one argument 
> for function hdrchk in HdrChd.py as well?  This new argument can be used 
> to identify what kind of rule the tools should follow to check file 
> head. Teamware or Mercurial? Currently, HdrChk.py check presence of 
> keywords, also if keywords are put to the right position according to 
> specified condition. For example, 'hdrchk -a' will allow 'ident' before 
> file head guard. For Teamware, tool keywords need to check if ident is 
> presented correctly according to if the file has been checked out or 
> not.  However, the 'ident' rule for Mercurial is really simple, just no 
> 'ident' any more.
> 
> So, how about changing it like this way:
> 1. Add one argument noident for function hdrchk(fh, filename=None, 
> lenient=False, noident=False) in Check/HdrChk.py
> 2. Add one new wrapper script/Hdrchk.py to call function hdrchk(..., 
> ..., ..., noident=True).
> 
> In this way, any existing interfaces don't need to be modified. Also, 
> both Teamware and Mercurial share the check module code. The user 
> interface like:
> Teamware: wx hdrchk
> Mercurial : Cadmium Hdrchk
> 
> Anything I am missing, please give me your feedback.
> 

That sounds like a reasonable solution; though my only qualm with it is 
that hdrchk is nominally only supposed to be checking header files (or 
at least that's what its name implies), whereas keywords are a universal 
thing.

cheers,
steve


-- 
stephen lau // stevel at sun.com | 650.786.0845 | http://whacked.net
opensolaris // solaris kernel development

Reply via email to