[dojo-contributors] A new build tool for style guide violation checking

Dustin Machi dmachi at dojotoolkit.org
Thu May 14 18:13:31 EDT 2009


ewps hit enter too early.  To work with hooks, when you create a  
repository there is already a hooks directory with the default hooks  
renamed to disable them, so you can just rename one and do a commit to  
the repo to see it in action.

Dustin

On May 14, 2009, at 6:02 PM, Shane O'Sullivan wrote:

> Hi All,
>
> I'm working on hooking up the checkstyle tool to an SVN hook, and need
> a little help.
>
> 1. How to I make a script fail a check?  If the .sh file calls a .js
> file using Rhino, how do I fail the svn hook check?  Print "Error" or
> something?
> 2. How/where to I work with SVN hooks? :-)
>
> Maybe someone else could handle #2 :-)  Any ideas?  Are there any
> other svn hooks in Dojo that I can copy as an example?
>
> Thanks
>
> Shane
>
> 2009/5/11 Shane O'Sullivan <shaneosullivan1 at gmail.com>:
>> I think keeping it simple for developers to use is quite worthwhile.
>> Also, while the errors being checked for can conceptually be grouped
>> into separate "types" of validation,  they all fall under the Dojo
>> style guide, and are all simple little things that developers can fix
>> quickly.  Having them all checked for, and listed, in the same place
>> makes sense to me.
>>
>> Pete, with regards to your suggestions for || and && surrounded by
>> spaces, that's been added and the patch updated.  The page at
>> http://skynet.ie/~sos/misc/dojoCheckstyle/util/buildscripts/checkstyleReport.html
>> has also been updated with the new errors, now at a grand total of
>> 6011.
>>
>> Thanks
>>
>> Shane
>>
>> 2009/5/11 Mike Wilcox <mwilcox at sitepen.com>:
>>>
>>>> Mike Wilcox wrote:
>>>>> It sounds like you are mixing two different validations - code
>>>>> integrity (braces in if statements)  and formating integrity  
>>>>> (proper
>>>>> tabbing and minimum whitespace).
>>>>>
>>>> Maybe I'm confused, but I'm talking about our "style guidelines".
>>>>
>>>> if (foo) { return; }
>>>>
>>>> should be:
>>>>
>>>> if(foo){ return; }
>>>>
>>>> and explicitly NOT:
>>>>
>>>> if(foo) return;
>>>
>>> Yes, but let me clarify what I saw as a problem - having the parser
>>> handle code validation and format validation. If hypothetically, we
>>> wanted to use JSLint, and remove our custom engine we would lose the
>>> validation of tabs and spaces, since JSLint doesn't do that.
>>>
>>> Basically, there is code style which applies to JavaScript, and  
>>> format
>>> style which applies to the docs and build/compression.
>>>
>>> I only suggest they be two different validation engines. Otherwise  
>>> its
>>> all good stuff.
>>>
>>>
>>> Mike
>>>
>>> _______________________________________________
>>> dojo-contributors mailing list
>>> dojo-contributors at mail.dojotoolkit.org
>>> http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors
>>>
>>
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors



More information about the dojo-contributors mailing list