[openstack-dev] [horizon] Javascript checkstyle improvement

Matthias Runge mrunge at redhat.com
Fri Jan 3 07:17:41 UTC 2014


On 12/27/2013 03:52 PM, Maxime Vidori wrote:
> Hi all,
> 
> I send this mail to talk about Javascript coding style improvement, like python has pep8, it could be interesting to have some rules for javascript too. JSHint provides some rules to perform this and I think it could be a great idea to discuss about which rules could be integrated into Horizon.
> 
> According to http://www.jshint.com/docs/options/ here is a list of the rules which seems interesting:
>  - bitwise
>  - curly
>  - eqeqeq
>  - forin
>  - latedef
>  - noempty
>  - undef
>  - unused with vars
>  - trailing
> 
>  
> Here is a second list of options which can be integrated but need some discussion before:
>  - camelcase
>  - quotmark
> 
> I already made a first patch for the indentation: https://review.openstack.org/#/c/64272/
Thank you for driving this further!

I see pros and cons here. First of all, I really like style improvements
and unification of code and style.

But:
We're bundling foreign code (which is bad in general); now we need to
change/format that code too, to match our style conventions? That would
even generate a fork, like here[1], where the changes were just cosmetics.

A patch like[2] this one shouldn't pass any more, although it's code
like distributed by upstream. From a users standpoint there is nothing
wrong with [2].

It would be ideal to remove bundled code at all and to add an external
dependency.


Matthias



[1]
https://review.openstack.org/#/c/64272/5/horizon/static/horizon/js/angular/controllers/dummy.js
[2] https://review.openstack.org/#/c/64760/



More information about the OpenStack-dev mailing list