If we're going to store JavaScript gadgets and Lua modules in a central wiki (this is planned, I suppose), some coding guidelines would be certainly useful. Should a Request for Comment be created for that? We can reuse MediaWiki conventions for JavaScript, of course.
Moreover, I find that there should be a way to run linters automatically over JavaScript gadgets and Lua modules. Even though CodeEditor already has this feature, it would be helpful to have a service (on Labs?) that periodically analyzes scripts on a wiki and reports errors, maybe notifying the author of a breakage via e-mail. Here are some already existing tools for similar purposes: https://tools.wmflabs.org/stylize/ http://lintbridge.wmflabs.org
Slightly related request: https://bugzilla.wikimedia.org/show_bug.cgi?id=51651 (Auto-generated gadget documentation with JsDuck)
Helder
On 10 August 2014 00:51, Ricordisamoa ricordisamoa@openmailbox.org wrote:
If we're going to store JavaScript gadgets and Lua modules in a central wiki (this is planned, I suppose), some coding guidelines would be certainly useful.
We've talked a good deal about adding a "global" stash of things to be used across WMF wikis and more widely (see this RfC https://www.mediawiki.org/wiki/Requests_for_comment/Global_scripts for example).
We've talked a good deal about adding a proper code review integration for code written "in" a wiki (but there's not an RfC, because it's taken as given).
Ideally we'd do the two together (or the latter first) to make this sane for everyone.
A code review system could easily support (and indeed probably should) linting of content to help users. Note that our use of Ace in CodeEditor does warnings like this for JS, for example. In "real" code review we're encouraging the use of jscs to enforce coding style conventions, and it might be worth doing something like this?
Should a Request for Comment be created for that? We can reuse MediaWiki conventions for JavaScript, of course.
Maybe? I don't think it's necessary as a distinct RfC…
J.
On Mon, Aug 11, 2014 at 10:23 AM, James Forrester jforrester@wikimedia.org wrote:
On 10 August 2014 00:51, Ricordisamoa ricordisamoa@openmailbox.org wrote:
If we're going to store JavaScript gadgets and Lua modules in a central wiki (this is planned, I suppose), some coding guidelines would be certainly useful.
We've talked a good deal about adding a "global" stash of things to be used across WMF wikis and more widely (see this RfC https://www.mediawiki.org/wiki/Requests_for_comment/Global_scripts for example).
...and see also: https://meta.wikimedia.org/wiki/Global-Wiki https://meta.wikimedia.org/wiki/Requests_for_comment/Global_bits_and_pieces
We've talked a good deal about adding a proper code review integration for code written "in" a wiki (but there's not an RfC, because it's taken as given).
Ideally we'd do the two together (or the latter first) to make this sane for everyone.
A code review system could easily support (and indeed probably should) linting of content to help users. Note that our use of Ace in CodeEditor does warnings like this for JS, for example. In "real" code review we're encouraging the use of jscs to enforce coding style conventions, and it might be worth doing something like this?
+1.
Helder
wikitech-l@lists.wikimedia.org