style_checker.js seems not to work

Bug #1175779 reported by Robert Bruce Park
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
WebApps: Applications Data
Fix Committed
High
Maxim Ermilov

Bug Description

Victor asked me to enable the new application branches to run style_checker.js in order to jslint the userscripts at build-time, specifically so that building packages will fail if they contain minor typos or other errors. I enabled this already (if you examine debian/rules in any webapps application branch[0], it runs style_checker.js)

However, I tried to introduce a basic syntactical error in one of the userscripts just to make sure that it was actually working, and it failed to report any error or halt the build. I was worried that perhaps some of my changes to the script (to allow installing it to the system) might have broken it, so I specifically branched lp:webapps-applications/13.04 and tried there, and found the same results: Arbitrary invalid garbage inserted into a userscript does not cause style_checker.js to report any errors or fail in any way. It always just silently approves whatever userscript you give it.

This problem is *particularly* strange because if you run style_checker.js on *itself* (ie, provide itself as the input for it to check), then it does manage to find and complain about an invalid syntax issue that it doesn't like. So this proves that the script is able to find *some* problems sometimes, but there is some issue preventing it from finding any issues inside the userscripts.

I spent a bit of time instrumenting style_checker.js with some printerr() statements so that I could see what it was doing at runtime, but I wasn't able to identify any real problems: it was always loading files correctly and passing strings into jslint correctly. So I've ruled out the possibility that it is failing to open files and then passing empty strings into jslint, which would pass as valid.

Because the problem exists in the /13.04 branch, that means that the problem wasn't introduced by my recent merge to trunk, and I checked in the bzr log when was the last commit to touch style_checker.js, and that was back in August, so as far as I can tell, this has been broken since August. If anybody is aware of a time since August that they saw style_checker.js report some error about any userscript, that could be helpful in identifying the cause of this issue.

[0] http://bazaar.launchpad.net/~webapps/unity-webapps-amazon/trunk/view/head:/debian/rules#L19

Changed in webapps-applications:
importance: Undecided → High
Revision history for this message
Maxim Ermilov (zaspire) wrote :

problem was not in style_checker.js.
It silent ignore errors in dependecies.
If there was too many errors, check stops.

I change this behaviour. style_checker.js report errors in dependencies scripts now.

Changed in webapps-applications:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.