Mercurial > repos > shellac > guppy_basecaller
comparison env/lib/python3.7/site-packages/cwltool/jshint/jshint_wrapper.js @ 2:6af9afd405e9 draft
"planemo upload commit 0a63dd5f4d38a1f6944587f52a8cd79874177fc1"
| author | shellac |
|---|---|
| date | Thu, 14 May 2020 14:56:58 -0400 |
| parents | 26e78fe6e8c4 |
| children |
comparison
equal
deleted
inserted
replaced
| 1:75ca89e9b81c | 2:6af9afd405e9 |
|---|---|
| 1 "use strict"; | |
| 2 // set a global object, in order for jshint to work | |
| 3 var global = this; | |
| 4 | |
| 5 function validateJS(input) { | |
| 6 var jshintGlobalsObj = {}; | |
| 7 input.globals.forEach(function (global) { | |
| 8 jshintGlobalsObj[global] = true; | |
| 9 }) | |
| 10 var includewarnings; | |
| 11 | |
| 12 if (input.options.includewarnings !== undefined) { | |
| 13 includewarnings = input.options.includewarnings; | |
| 14 delete input.options.includewarnings; | |
| 15 } | |
| 16 | |
| 17 JSHINT( | |
| 18 input.code, | |
| 19 input.options, | |
| 20 jshintGlobalsObj | |
| 21 ) | |
| 22 | |
| 23 var jshintData = JSHINT.data(); | |
| 24 if (jshintData.errors !== undefined) { | |
| 25 if (includewarnings !== undefined) { | |
| 26 jshintData.errors = jshintData.errors.filter(function (error) { | |
| 27 return includewarnings.indexOf(error.code) !== -1 || error.code[0] == "E"; | |
| 28 }) | |
| 29 } | |
| 30 | |
| 31 jshintData.errors.forEach(function (error) { | |
| 32 if (error.code == "W104" || error.code == "W119") { | |
| 33 if (error.code == "W104"){ | |
| 34 var jslint_suffix = " (use 'esversion: 6') or Mozilla JS extensions (use moz)." | |
| 35 } | |
| 36 else{ | |
| 37 var jslint_suffix = " (use 'esversion: 6')" | |
| 38 } | |
| 39 | |
| 40 error.reason = error.reason.slice(0, -jslint_suffix.length - 1) + | |
| 41 ". CWL only supports ES5.1"; | |
| 42 } | |
| 43 }) | |
| 44 } | |
| 45 | |
| 46 return jshintData; | |
| 47 } |
