javascriptlint-commit Mailing List for JavaScript Lint (Page 5)
Status: Beta
Brought to you by:
matthiasmiller
You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
(42) |
Apr
(15) |
May
(2) |
Jun
|
Jul
|
Aug
(33) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
(43) |
Nov
(4) |
Dec
(1) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(20) |
Oct
(23) |
Nov
|
Dec
(1) |
2014 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(18) |
2018 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(8) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mat...@us...> - 2009-10-22 15:40:02
|
Revision: 287 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=287&view=rev Author: matthiasmiller Date: 2009-10-22 15:39:55 +0000 (Thu, 22 Oct 2009) Log Message: ----------- www: indicate correct error position when the file contains tabs Modified Paths: -------------- trunk/www/_jsl_online.inc Modified: trunk/www/_jsl_online.inc =================================================================== --- trunk/www/_jsl_online.inc 2009-10-22 13:34:10 UTC (rev 286) +++ trunk/www/_jsl_online.inc 2009-10-22 15:39:55 UTC (rev 287) @@ -147,6 +147,11 @@ return $enc; } + function expandTabs($text) + { + return str_replace("\t", str_pad("", 4/*tab width*/, " "), $text); + } + function OutputLintHTML($engine) { ?> @@ -184,7 +189,7 @@ { /* format code */ $text = $engine->getLineText($lineno); - $text = str_replace("\t", str_pad("", 4/*tab width*/, " "), $text); + $text = expandTabs($text); echo getEncodedText(str_pad($lineno+1, $widthOfLineNo, " ", STR_PAD_LEFT) . ' ' . $text . "\n"); /* show errors */ @@ -201,7 +206,13 @@ /* point to the error position, if available */ if ($Error->getChar() > -1) - echo getEncodedText($lineNoSpacer . str_pad("", $Error->getChar()-1, "=") . "^\n"); + { + $indent = $engine->getLineText($lineno); + $indent = substr($indent, 0, max(0, $Error->getChar()-1)); + $indent = expandTabs($indent); + $indent = str_pad("", strlen($indent), "="); + echo getEncodedText($lineNoSpacer . $indent . "^\n"); + } /* output error type/message */ echo getEncodedText($lineNoSpacer) . '<span>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-22 13:34:16
|
Revision: 286 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=286&view=rev Author: matthiasmiller Date: 2009-10-22 13:34:10 +0000 (Thu, 22 Oct 2009) Log Message: ----------- #1516656: Add test. Added Paths: ----------- trunk/tests/errors/syntax_error_3.js Added: trunk/tests/errors/syntax_error_3.js =================================================================== --- trunk/tests/errors/syntax_error_3.js (rev 0) +++ trunk/tests/errors/syntax_error_3.js 2009-10-22 13:34:10 UTC (rev 286) @@ -0,0 +1,8 @@ +/* +This failed in cjsl but is working in pyjsl. +https://sourceforge.net/tracker/?func=detail&aid=2146544&group_id=168518&atid=847185 +*/ +function syntax_error_3() { + return /^{([^}]*)}$/; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-22 13:30:59
|
Revision: 285 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=285&view=rev Author: matthiasmiller Date: 2009-10-22 13:30:51 +0000 (Thu, 22 Oct 2009) Log Message: ----------- 1516656: Add warning about identifiers hiding an identifier in a parent scope. Modified Paths: -------------- trunk/javascriptlint/jsparse.py trunk/javascriptlint/lint.py trunk/javascriptlint/warnings.py trunk/tests/control_comments/declare.js trunk/tests/warnings/var_hides_arg.js Added Paths: ----------- trunk/tests/warnings/identifier_hides_another.js Modified: trunk/javascriptlint/jsparse.py =================================================================== --- trunk/javascriptlint/jsparse.py 2009-10-22 11:52:52 UTC (rev 284) +++ trunk/javascriptlint/jsparse.py 2009-10-22 13:30:51 UTC (rev 285) @@ -174,7 +174,7 @@ start_pos = node_positions.from_offset(start_offset) end_pos = node_positions.from_offset(end_offset) kwargs = { - 'type': 'COMMENT', + 'kind': 'COMMENT', 'atom': comment_text, 'opcode': opcode, '_start_line': start_pos.line, Modified: trunk/javascriptlint/lint.py =================================================================== --- trunk/javascriptlint/lint.py 2009-10-22 11:52:52 UTC (rev 284) +++ trunk/javascriptlint/lint.py 2009-10-22 13:30:51 UTC (rev 285) @@ -117,13 +117,14 @@ if self._parent: return self._parent.resolve_identifier(name) return None - def get_unreferenced_and_undeclared_identifiers(self): + def get_identifier_warnings(self): """ Returns a tuple of unreferenced and undeclared, where each is a list of (scope, name, node) tuples. """ unreferenced = {} undeclared = [] - self._find_unreferenced_and_undeclared(unreferenced, undeclared, False) + obstructive = [] + self._find_warnings(unreferenced, undeclared, obstructive, False) # Convert "unreferenced" from a dictionary of: # { (scope, name): node } @@ -134,15 +135,22 @@ in unreferenced.items()] unreferenced.sort(key=lambda x: x[2].start_pos()) - return unreferenced, undeclared - def _find_unreferenced_and_undeclared(self, unreferenced, undeclared, - is_in_with_scope): + return { + 'unreferenced': unreferenced, + 'undeclared': undeclared, + 'obstructive': obstructive, + } + def _find_warnings(self, unreferenced, undeclared, obstructive, + is_in_with_scope): """ unreferenced is a dictionary, such that: (scope, name): node } undeclared is a list, such that: [ (scope, name, node) ] + obstructive is a list, such that: [ + (scope, name, node) + ] """ if self._node and self._node.kind == tok.WITH: is_in_with_scope = True @@ -153,6 +161,12 @@ for name, info in self._identifiers.items(): unreferenced[(self, name)] = info['node'] + # Check for variables that hide an identifier in a parent scope. + if self._parent: + for name, info in self._identifiers.items(): + if self._parent.resolve_identifier(name): + obstructive.append((self, name, info['node'])) + # Remove all declared variables from the "unreferenced" set; add all # undeclared variables to the "undeclared" list. for name, node in self._references: @@ -170,8 +184,8 @@ undeclared.append((self, name, node)) for child in self._kids: - child._find_unreferenced_and_undeclared(unreferenced, undeclared, - is_in_with_scope) + child._find_warnings(unreferenced, undeclared, obstructive, + is_in_with_scope) def find_scope(self, node): for kid in self._kids: scope = kid.find_scope(node) @@ -432,10 +446,7 @@ for name, node in declares: declare_scope = script_cache.scope.find_scope(node) - if declare_scope.get_identifier(name): - report(node, 'redeclared_var', name=name) - else: - declare_scope.add_declaration(name, node, 'var') + _warn_or_declare(declare_scope, name, 'var', node, report) def _lint_script_parts(script_parts, script_cache, lint_error, conf, import_callback): def report_lint(node, errname, pos=None, **errargs): @@ -466,15 +477,15 @@ report_native, report_lint, import_callback) scope = script_cache.scope - unreferenced, undeclared = scope.get_unreferenced_and_undeclared_identifiers() - for decl_scope, name, node in undeclared: + identifier_warnings = scope.get_identifier_warnings() + for decl_scope, name, node in identifier_warnings['undeclared']: if name in conf['declarations']: continue if name in _globals: continue if not script_cache.hasglobal(name): report_lint(node, 'undeclared_identifier', name=name) - for ref_scope, name, node in unreferenced: + for ref_scope, name, node in identifier_warnings['unreferenced']: # Ignore the outer scope. if ref_scope != scope: type_ = ref_scope.get_identifier_type(name) @@ -486,6 +497,8 @@ report_lint(node, 'unreferenced_variable', name=name) else: assert False, 'Unrecognized identifier type: %s' % type_ + for ref_scope, name, node in identifier_warnings['obstructive']: + report_lint(node, 'identifier_hides_another', name=name) def _getreporter(visitor, report): def onpush(node): @@ -504,12 +517,14 @@ def _warn_or_declare(scope, name, type_, node, report): parent_scope, other = scope.resolve_identifier(name) or (None, None) - if other and other.kind == tok.FUNCTION and name in other.fn_args: - report(node, 'var_hides_arg', name=name) - elif other and parent_scope == scope: - report(node, 'redeclared_var', name=name) + if other and parent_scope == scope: + # Only warn about duplications in this scope. + # Other scopes will be checked later. + if other.kind == tok.FUNCTION and name in other.fn_args: + report(node, 'var_hides_arg', name=name) + else: + report(node, 'redeclared_var', name=name) else: - # TODO: Warn when hiding a variable in a parent scope. scope.add_declaration(name, node, type_) def _get_scope_checks(scope, report): Modified: trunk/javascriptlint/warnings.py =================================================================== --- trunk/javascriptlint/warnings.py 2009-10-22 11:52:52 UTC (rev 284) +++ trunk/javascriptlint/warnings.py 2009-10-22 13:30:51 UTC (rev 285) @@ -82,6 +82,7 @@ 'nested_comment': 'nested comment', 'legacy_cc_not_understood': 'couldn\'t understand control comment using /*@keyword@*/ syntax', 'var_hides_arg': 'variable {name} hides argument', + 'identifier_hides_another': 'identifer {name} hides an identifier in a parent scope', 'duplicate_formal': 'duplicate formal argument {name}', 'missing_semicolon': 'missing semicolon', 'missing_semicolon_for_lambda': 'missing semicolon for lambda assignment', Modified: trunk/tests/control_comments/declare.js =================================================================== --- trunk/tests/control_comments/declare.js 2009-10-22 11:52:52 UTC (rev 284) +++ trunk/tests/control_comments/declare.js 2009-10-22 13:30:51 UTC (rev 285) @@ -1,4 +1,5 @@ /*jsl:option explicit*/ +/*conf:-identifier_hides_another*/ function declare() { window.alert('http://www.javascriptlint.com/'); /*jsl:declare window*/ /*warning:redeclared_var*/ Added: trunk/tests/warnings/identifier_hides_another.js =================================================================== --- trunk/tests/warnings/identifier_hides_another.js (rev 0) +++ trunk/tests/warnings/identifier_hides_another.js 2009-10-22 13:30:51 UTC (rev 285) @@ -0,0 +1,43 @@ +// Test each combination of arg, var, function, and jsl:declare. +function identifier_hides_another(arg_hides_arg, + function_hides_arg, + var_hides_arg, + declare_hides_arg) { + + function arg_hides_function() { return true; } + function function_hides_function() { return true; } + function var_hides_function() { return true; } + function declare_hides_function() { return true; } + + var arg_hides_var; + var function_hides_var; + var var_hides_var; + var declare_hides_var; + + /*jsl:declare arg_hides_declare*/ + /*jsl:declare function_hides_declare*/ + /*jsl:declare var_hides_declare*/ + /*jsl:declare declare_hides_declare*/ + + function inner(arg_hides_arg, + arg_hides_function, + arg_hides_var, + arg_hides_declare) { /*warning:identifier_hides_another*//*warning:identifier_hides_another*//*warning:identifier_hides_another*//*warning:identifier_hides_another*/ + + function function_hides_arg() { return true; } /*warning:identifier_hides_another*/ + function function_hides_function() { return true; } /*warning:identifier_hides_another*/ + function function_hides_var() { return true; } /*warning:identifier_hides_another*/ + function function_hides_declare() { return true; } /*warning:identifier_hides_another*/ + + var var_hides_arg; /*warning:identifier_hides_another*/ + var var_hides_function; /*warning:identifier_hides_another*/ + var var_hides_var; /*warning:identifier_hides_another*/ + var var_hides_declare; /*warning:identifier_hides_another*/ + + /*jsl:declare declare_hides_arg*/ /*warning:identifier_hides_another*/ + /*jsl:declare declare_hides_function*/ /*warning:identifier_hides_another*/ + /*jsl:declare declare_hides_var*/ /*warning:identifier_hides_another*/ + /*jsl:declare declare_hides_declare*/ /*warning:identifier_hides_another*/ + } +} + Property changes on: trunk/tests/warnings/identifier_hides_another.js ___________________________________________________________________ Added: svn:mergeinfo + Modified: trunk/tests/warnings/var_hides_arg.js =================================================================== --- trunk/tests/warnings/var_hides_arg.js 2009-10-22 11:52:52 UTC (rev 284) +++ trunk/tests/warnings/var_hides_arg.js 2009-10-22 13:30:51 UTC (rev 285) @@ -2,6 +2,6 @@ function var_hides_arg(duplicate1, duplicate2) { var duplicate1; /*warning:var_hides_arg*/ function inner() { - var duplicate2; /*warning:var_hides_arg*/ + var duplicate2; /*warning:identifier_hides_another*/ } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-22 11:53:04
|
Revision: 284 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=284&view=rev Author: matthiasmiller Date: 2009-10-22 11:52:52 +0000 (Thu, 22 Oct 2009) Log Message: ----------- #1523100: Warn about unreached variable assignments. Modified Paths: -------------- trunk/javascriptlint/warnings.py Added Paths: ----------- trunk/tests/warnings/unreachable_code_2.js Modified: trunk/javascriptlint/warnings.py =================================================================== --- trunk/javascriptlint/warnings.py 2009-10-22 11:43:08 UTC (rev 283) +++ trunk/javascriptlint/warnings.py 2009-10-22 11:52:52 UTC (rev 284) @@ -414,7 +414,16 @@ def unreachable_code(node): if node.parent.kind == tok.LC: for sibling in node.parent.kids[node.node_index+1:]: - if not sibling.kind in (tok.VAR, tok.FUNCTION): + if sibling.kind == tok.VAR: + # Look for a variable assignment + for variable in sibling.kids: + value, = variable.kids + if value: + raise LintWarning, value + elif sibling.kind == tok.FUNCTION: + # Functions are always declared. + pass + else: raise LintWarning, sibling @lookfor(tok.FOR) Added: trunk/tests/warnings/unreachable_code_2.js =================================================================== --- trunk/tests/warnings/unreachable_code_2.js (rev 0) +++ trunk/tests/warnings/unreachable_code_2.js 2009-10-22 11:52:52 UTC (rev 284) @@ -0,0 +1,33 @@ +function unreachable_code_2() { + + // Function declarations are never unreachable. + function scope_a() + { + return inner(); + function inner() { + return 10; + } + } + + // Variable declarations are never unreachable. + function scope_b() + { + return value; + var value; + } + + // Variable assignments are, however. + function scope_c() + { + return value_a; + var value_a = 10; /*warning:unreachable_code*/ + } + + // Test multiple variables. + function scope_d() + { + return value_a; + var value_a, value_b = 10, value_c; /*warning:unreachable_code*/ + } +} + Property changes on: trunk/tests/warnings/unreachable_code_2.js ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-22 11:43:15
|
Revision: 283 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=283&view=rev Author: matthiasmiller Date: 2009-10-22 11:43:08 +0000 (Thu, 22 Oct 2009) Log Message: ----------- #1534046: Add test. Added Paths: ----------- trunk/tests/control_comments/cpp_style_comments.js Added: trunk/tests/control_comments/cpp_style_comments.js =================================================================== --- trunk/tests/control_comments/cpp_style_comments.js (rev 0) +++ trunk/tests/control_comments/cpp_style_comments.js 2009-10-22 11:43:08 UTC (rev 283) @@ -0,0 +1,9 @@ +/* Allow C++ style control comments. +https://sourceforge.net/tracker/?func=detail&aid=1534046&group_id=168518&atid=847185 +*/ +function control_comments() { + //jsl:declare undeclared_a + undeclared_a = 1; + undeclared_b = 2; /*warning:undeclared_identifier*/ +} + Property changes on: trunk/tests/control_comments/cpp_style_comments.js ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-22 11:33:32
|
Revision: 282 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=282&view=rev Author: matthiasmiller Date: 2009-10-22 11:33:24 +0000 (Thu, 22 Oct 2009) Log Message: ----------- #2861271: Add a test. Added Paths: ----------- trunk/tests/errors/syntax_error_2.js Added: trunk/tests/errors/syntax_error_2.js =================================================================== --- trunk/tests/errors/syntax_error_2.js (rev 0) +++ trunk/tests/errors/syntax_error_2.js 2009-10-22 11:33:24 UTC (rev 282) @@ -0,0 +1,9 @@ +/* +This failed in cjsl but is working in pyjsl. +http://sourceforge.net/tracker/?func=detail&aid=2861271&group_id=168518&atid=847185 +*/ +function syntax_error_2() { + var o = {}; + o.for = 10; +} + Property changes on: trunk/tests/errors/syntax_error_2.js ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-22 09:17:40
|
Revision: 281 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=281&view=rev Author: matthiasmiller Date: 2009-10-22 09:17:33 +0000 (Thu, 22 Oct 2009) Log Message: ----------- www: fix typo Modified Paths: -------------- trunk/www/news/020 Modified: trunk/www/news/020 =================================================================== --- trunk/www/news/020 2009-10-22 06:55:23 UTC (rev 280) +++ trunk/www/news/020 2009-10-22 09:17:33 UTC (rev 281) @@ -6,6 +6,6 @@ ## [JavaScript Lint 0.2.6 Released](__BASENAME__) _Sat, 29 Apr 2006 15:07:13 +0000_ -JavaScript Lint now has a `/*jsl:ignoreall*\` keyword to allow entire files to easily be ignored. Additionally, it no longer complains about blank JavaScript files. +JavaScript Lint now has a `/*jsl:ignoreall*/` keyword to allow entire files to easily be ignored. Additionally, it no longer complains about blank JavaScript files. Available from the [download page](/download.htm). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-22 06:55:31
|
Revision: 280 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=280&view=rev Author: matthiasmiller Date: 2009-10-22 06:55:23 +0000 (Thu, 22 Oct 2009) Log Message: ----------- Refactor pyspidermonkey's code to load JS runtime and context. Modified Paths: -------------- trunk/javascriptlint/pyspidermonkey/pyspidermonkey.c Modified: trunk/javascriptlint/pyspidermonkey/pyspidermonkey.c =================================================================== --- trunk/javascriptlint/pyspidermonkey/pyspidermonkey.c 2009-10-22 05:09:12 UTC (rev 279) +++ trunk/javascriptlint/pyspidermonkey/pyspidermonkey.c 2009-10-22 06:55:23 UTC (rev 280) @@ -382,6 +382,36 @@ return NULL; } +/* Returns NULL on success. Otherwise, it returns an error. + * If the error is blank, an exception will be set. + */ +static const char* create_jscontext(void* ctx_data, + JSRuntime** runtime, JSContext** context, + JSObject** global) +{ + *runtime = JS_NewRuntime(8L * 1024L * 1024L); + if (*runtime == NULL) + return"cannot create runtime"; + + *context = JS_NewContext(*runtime, 8192); + if (*context == NULL) + return "cannot create context"; + + JS_SetErrorReporter(*context, error_reporter); + JS_SetContextPrivate(*context, ctx_data); + JS_ToggleOptions(*context, JSOPTION_STRICT); + + *global = JS_NewObject(*context, NULL, NULL, NULL); + if (*global == NULL) + return "cannot create global object"; + + if (!JS_InitStandardClasses(*context, *global)) + return "cannot initialize standard classes"; + + return NULL; +} + + static PyObject* module_parse(PyObject *self, PyObject *args) { struct { @@ -419,38 +449,16 @@ return NULL; } - m.runtime = JS_NewRuntime(8L * 1024L * 1024L); - if (m.runtime == NULL) { - error = "cannot create runtime"; + error = create_jscontext(&m.ctx_data, &m.runtime, &m.context, &m.global); + if (error) goto cleanup; - } - m.context = JS_NewContext(m.runtime, 8192); - if (m.context == NULL) { - error = "cannot create context"; - goto cleanup; - } - JS_SetErrorReporter(m.context, error_reporter); - JS_SetContextPrivate(m.context, &m.ctx_data); - JS_ToggleOptions(m.context, JSOPTION_STRICT); - m.contents = JS_NewStringCopyZ(m.context, m.script); if (m.contents == NULL) { error = "cannot create script contents"; goto cleanup; } - m.global = JS_NewObject(m.context, NULL, NULL, NULL); - if (m.global == NULL) { - error = "cannot create global object"; - goto cleanup; - } - - if (!JS_InitStandardClasses(m.context, m.global)) { - error = "cannot initialize standard classes"; - goto cleanup; - } - m.token_stream = js_NewBufferTokenStream(m.context, JS_GetStringChars(m.contents), JS_GetStringLength(m.contents)); if (!m.token_stream) { error = "cannot create token stream"; @@ -505,29 +513,10 @@ if (!PyArg_ParseTuple(args, "s", &m.script)) return NULL; - m.runtime = JS_NewRuntime(8L * 1024L * 1024L); - if (m.runtime == NULL) { - error = "cannot create runtime"; + error = create_jscontext(NULL, &m.runtime, &m.context, &m.global); + if (error) goto cleanup; - } - m.context = JS_NewContext(m.runtime, 8192); - if (m.context == NULL) { - error = "cannot create context"; - goto cleanup; - } - - m.global = JS_NewObject(m.context, NULL, NULL, NULL); - if (m.global == NULL) { - error = "cannot create global object"; - goto cleanup; - } - - if (!JS_InitStandardClasses(m.context, m.global)) { - error = "cannot initialize standard classes"; - goto cleanup; - } - m.is_compilable = JS_BufferIsCompilableUnit(m.context, m.global, m.script, strlen(m.script)); error = NULL; @@ -539,7 +528,8 @@ JS_DestroyRuntime(m.runtime); if (error) { - PyErr_SetString(PyExc_StandardError, error); + if (*error) + PyErr_SetString(PyExc_StandardError, error); return NULL; } if (m.is_compilable) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-22 05:09:32
|
Revision: 279 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=279&view=rev Author: matthiasmiller Date: 2009-10-22 05:09:12 +0000 (Thu, 22 Oct 2009) Log Message: ----------- htmlparse should not have JavaScript-specific logic. Modified Paths: -------------- trunk/javascriptlint/htmlparse.py trunk/javascriptlint/jsl.py trunk/javascriptlint/lint.py Modified: trunk/javascriptlint/htmlparse.py =================================================================== --- trunk/javascriptlint/htmlparse.py 2009-10-13 01:29:52 UTC (rev 278) +++ trunk/javascriptlint/htmlparse.py 2009-10-22 05:09:12 UTC (rev 279) @@ -2,88 +2,50 @@ import HTMLParser import unittest -import jsparse - class _Parser(HTMLParser.HTMLParser): def __init__(self): HTMLParser.HTMLParser.__init__(self) - self._node_positions = jsparse.NodePositions('') - self._script = None - self._scripts = [] + self._tags = [] def handle_starttag(self, tag, attributes): - if tag.lower() == 'script' and not self._script: - offset = self._getoffset() + len(self.get_starttag_text()) - self._script = self._script or { - 'start': offset, - 'attributes': attributes - } + if tag.lower() == 'script': + attr = dict(attributes) + self._tags.append({ + 'type': 'start', + 'lineno': self.lineno, + 'offset': self.offset, + 'len': len(self.get_starttag_text()), + 'attr': attr + }) def handle_endtag(self, tag): - if tag.lower() == 'script' and self._script: - start = self._script['start'] - end = self._getoffset() - script = self.rawdata[start:end] - if jsparse.is_compilable_unit(script): - attr = dict(self._script['attributes']) - self._scripts.append({ - 'script': script, - 'startoffset': start, - 'endoffset': end, - 'startpos': self._node_positions.from_offset(start), - 'endpos': self._node_positions.from_offset(end), - 'src': attr.get('src'), - 'type': attr.get('type') - }) - self._script = None + if tag.lower() == 'script': + self._tags.append({ + 'type': 'end', + 'lineno': self.lineno, + 'offset': self.offset, + }) - def feed(self, data): - self._node_positions = jsparse.NodePositions(self.rawdata + data) - HTMLParser.HTMLParser.feed(self, data) - def unknown_decl(self, data): # Ignore unknown declarations instead of raising an exception. pass - def getscripts(self): - return self._scripts + def gettags(self): + return self._tags - def _getnodepos(self): - line, col = self.getpos() - return jsparse.NodePos(line - 1, col) - - def _getoffset(self): - return self._node_positions.to_offset(self._getnodepos()) - -def findscripts(s): +def findscripttags(s): + """ Note that the lineno is 1-based. + """ parser = _Parser() parser.feed(s) parser.close() - return parser.getscripts() + return parser.gettags() class TestHTMLParse(unittest.TestCase): - def testFindScript(self): - html = """ -<html><body> -<script src=test.js></script> -hi&b -a<script><!-- -var s = '<script></script>'; ---></script> -ok& -..</script> -ok& -</body> -</html> -""" - scripts = [x['script'] for x in findscripts(html)] - self.assertEquals(scripts, [ - "", - "<!--\nvar s = '<script></script>';\n-->" - ]) def testConditionalComments(self): html = """ <!--[if IE]>This is Internet Explorer.<![endif]--> <![if !IE]>This is not Internet Explorer<![endif]> """ - findscripts(html) + findscripttags(html) + Modified: trunk/javascriptlint/jsl.py =================================================================== --- trunk/javascriptlint/jsl.py 2009-10-13 01:29:52 UTC (rev 278) +++ trunk/javascriptlint/jsl.py 2009-10-22 05:09:12 UTC (rev 279) @@ -104,7 +104,7 @@ if options.unittest: suite = unittest.TestSuite(); - for module in [conf, htmlparse, jsparse, util]: + for module in [conf, htmlparse, jsparse, lint, util]: suite.addTest(unittest.findTestCases(module)) runner = unittest.TextTestRunner(verbosity=options.verbosity) Modified: trunk/javascriptlint/lint.py =================================================================== --- trunk/javascriptlint/lint.py 2009-10-13 01:29:52 UTC (rev 278) +++ trunk/javascriptlint/lint.py 2009-10-22 05:09:12 UTC (rev 279) @@ -8,6 +8,7 @@ import jsparse import visitation import warnings +import unittest import util from spidermonkey import tok, op @@ -213,6 +214,45 @@ if global_: return global_ +def _findhtmlscripts(contents): + starttag = None + nodepos = jsparse.NodePositions(contents) + for tag in htmlparse.findscripttags(contents): + if tag['type'] == 'start': + # Ignore nested start tags. + if not starttag: + starttag = tag + src = tag['attr'].get('src') + if src: + yield { + 'type': 'external', + 'src': src + } + elif tag['type'] == 'end': + if not starttag: + continue + + # htmlparse returns 1-based line numbers. Calculate the + # position of the script's contents. + tagpos = jsparse.NodePos(starttag['lineno']-1, starttag['offset']) + tagoffset = nodepos.to_offset(tagpos) + startoffset = tagoffset + starttag['len'] + startpos = nodepos.from_offset(startoffset) + endpos = jsparse.NodePos(tag['lineno']-1, tag['offset']) + endoffset = nodepos.to_offset(endpos) + script = contents[startoffset:endoffset] + + if jsparse.is_compilable_unit(script): + starttag = None + if script.strip(): + yield { + 'type': 'inline', + 'pos': startpos, + 'contents': script, + } + else: + assert False, 'Invalid internal tag type %s' % tag['type'] + def lint_files(paths, lint_error, conf=conf.Conf()): def lint_file(path, kind): def import_script(import_path): @@ -235,12 +275,15 @@ if kind == 'js': script_parts.append((None, contents)) elif kind == 'html': - for script in htmlparse.findscripts(contents): - if script['src']: + for script in _findhtmlscripts(contents): + if script['type'] == 'external': other = import_script(script['src']) lint_cache[normpath].importscript(other) - if script['script'].strip(): - script_parts.append((script['startpos'], script['script'])) + elif script['type'] == 'inline': + script_parts.append((script['pos'], script['contents'])) + else: + assert False, 'Invalid internal script type %s' % \ + script['type'] else: assert False, 'Unsupported file kind: %s' % kind @@ -521,3 +564,24 @@ visitor(node) +class TestLint(unittest.TestCase): + def testFindScript(self): + html = """ +<html><body> +<script src=test.js></script> +hi&b +a<script><!-- +var s = '<script></script>'; +--></script> +ok& +..</script> +ok& +</body> +</html> +""" + scripts = [(x.get('src'), x.get('contents')) + for x in _findhtmlscripts(html)] + self.assertEquals(scripts, [ + ('test.js', None), + (None, "<!--\nvar s = '<script></script>';\n-->") + ]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-13 01:30:02
|
Revision: 278 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=278&view=rev Author: matthiasmiller Date: 2009-10-13 01:29:52 +0000 (Tue, 13 Oct 2009) Log Message: ----------- Tweaks to the Windows build. Modified Paths: -------------- trunk/Makefile.SpiderMonkey trunk/setup.py Modified: trunk/Makefile.SpiderMonkey =================================================================== --- trunk/Makefile.SpiderMonkey 2009-10-08 14:06:47 UTC (rev 277) +++ trunk/Makefile.SpiderMonkey 2009-10-13 01:29:52 UTC (rev 278) @@ -20,7 +20,8 @@ ORIG_LIB=$(SPIDERMONKEY_SRC)/$(OBJDIR)/$(JS_LIB) COPY_LIB=$(BUILD_DIR)/$(JS_LIB) ORIG_DLL=$(SPIDERMONKEY_SRC)/$(OBJDIR)/js32.dll -COPY_DLL=$(DISTUTILS_DIR)/javascriptlint/js32.dll +COPY_DLL_DIR=$(DISTUTILS_DIR)/javascriptlint +COPY_DLL_PATH=$(COPY_DLL_DIR)/js32.dll OS_HEADER=$(BUILD_DIR)/js_operating_system.h ORIG_JSAUTOCFG_H=$(SPIDERMONKEY_SRC)/$(OBJDIR)/jsautocfg.h COPY_JSAUTOCFG_H=$(BUILD_DIR)/jsautocfg.h @@ -31,7 +32,7 @@ endif ifeq ($(SPIDERMONKEY_OS),XP_WIN) -ALL_TARGETS+=$(COPY_DLL) +ALL_TARGETS+=$(COPY_DLL_PATH) endif all: $(ALL_TARGETS) @@ -46,8 +47,9 @@ $(COPY_LIB): $(BUILD_DIR) $(ORIG_LIB) cp $(ORIG_LIB) $(COPY_LIB) -$(COPY_DLL): $(ORIG_DLL) - cp $(ORIG_DLL) $(COPY_DLL) +$(COPY_DLL_PATH): $(ORIG_DLL) + mkdir -p $(COPY_DLL_DIR) + cp $(ORIG_DLL) $(COPY_DLL_PATH) $(OS_HEADER): $(BUILD_DIR) echo "#define $(SPIDERMONKEY_OS)" > $(OS_HEADER) Modified: trunk/setup.py =================================================================== --- trunk/setup.py 2009-10-08 14:06:47 UTC (rev 277) +++ trunk/setup.py 2009-10-13 01:29:52 UTC (rev 278) @@ -17,9 +17,10 @@ if target: args.append(target) - # First build SpiderMonkey. + # First build SpiderMonkey. Force it to link statically against the CRT to + # make deployment easier. ret = subprocess.call(['make', '-f', 'Makefile.ref', '-C', - 'spidermonkey/src'] + args) + 'spidermonkey/src', 'XCFLAGS=-MT'] + args) if ret != 0: raise _MakefileError, 'Error running make.' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-08 14:06:53
|
Revision: 277 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=277&view=rev Author: matthiasmiller Date: 2009-10-08 14:06:47 +0000 (Thu, 08 Oct 2009) Log Message: ----------- www: add favicon Modified Paths: -------------- trunk/www.py Added Paths: ----------- trunk/www/favicon.ico Added: trunk/www/favicon.ico =================================================================== (Binary files differ) Property changes on: trunk/www/favicon.ico ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/www.py =================================================================== --- trunk/www.py 2009-10-08 13:54:28 UTC (rev 276) +++ trunk/www.py 2009-10-08 14:06:47 UTC (rev 277) @@ -260,13 +260,15 @@ return settings, md.convert(source) def _transform_file(host, path): - source = open(path).read() + source = open(path, 'rb').read() if path.endswith('.css'): return 'text/css', source elif path.endswith('.gif'): return 'image/gif', source elif path.endswith('.png'): return 'image/png', source + elif path.endswith('.ico'): + return 'image/x-icon', source elif path.endswith('.inc'): return 'text/plain', source elif path.endswith('.rss'): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-08 13:54:36
|
Revision: 276 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=276&view=rev Author: matthiasmiller Date: 2009-10-08 13:54:28 +0000 (Thu, 08 Oct 2009) Log Message: ----------- www: implement the online lint Modified Paths: -------------- trunk/www/online_lint.php trunk/www.py Added Paths: ----------- trunk/www/_jsl_online.inc trunk/www/_lint_front.inc Added: trunk/www/_jsl_online.inc =================================================================== --- trunk/www/_jsl_online.inc (rev 0) +++ trunk/www/_jsl_online.inc 2009-10-08 13:54:28 UTC (rev 276) @@ -0,0 +1,221 @@ +<?php + /* This script assumes the following configuration settings: + * +output-format __LINE__,__COL__,__ERROR_NAME__,__ERROR_PREFIX__,__ERROR_MSGENC__ + * + * Example Code: + * require_once("_jsl_online.php"); + * $engine = new JSLEngine('.priv/jsl', '.priv/jsl.server.conf'); + * $result = $engine->Lint($g_sScript); + * if ($result === true) + * OutputLintHTML($engine); + * else + * echo '<b>' . htmlentities($result) . '</b>'; + * + * Suggestions or revisions can be sent to In...@Ja... + */ + + class JSLMessage { + var $_line; + var $_char; + var $_errname; + var $_type; + var $_message; + + function JSLMessage($line) { + $info = explode(",", $line); + if (count($info) >= 4) { + $this->_line = ($info[0]*1); + $this->_char = is_numeric($info[1]) ? ($info[1]*1) : -1; + $this->_errname = $info[2]; + $this->_type = $info[3]; + $this->_message = implode(",", array_slice($info, 4)); + } + } + + function getLine() { return $this->_line; } + function getChar() { return $this->_char; } + function getErrName() { return $this->_errname; } + function getType() { return $this->_type; } + function getMessage() { return $this->_message; } + } + + class JSLEngine { + var $_binarypath, $_confpath; + var $_scriptlines, $_scriptmsgsGeneral, $_scriptmsgsSpecific; + + function JSLEngine($binarypath, $confpath) { + $this->_binarypath = $binarypath; + $this->_confpath = $confpath; + + $this->_scriptlines = Array(); + $this->_scriptmsgsGeneral = Array(); + $this->_scriptmsgsSpecific = Array(); + } + + /* returns error on failure; returns true on success */ + function Lint($code, $maxCodeLengthKB=128) { + if (strlen($code) > $maxCodeLengthKB*1024) + return 'Please limit scripts to ' . $maxCodeLengthKB . 'KB'; + + if (!$this->_launchLintBinary($code, $output)) + return 'The JavaScript Lint online service is currently unavailable.'; + + /* parse the script */ + $this->_scriptlines = explode("\n", str_replace("\r\n", "\n", $code)); + + /* parse the output */ + $output_lines = explode("\n", str_replace("\r\n", "\n", $output)); + foreach ($output_lines as $line) { + /* skip blank lines */ + if (strlen($line) > 0) { + /* store in associative array by 0-based line number */ + $msg = new JSLMessage($line); + + if ($msg->getChar() == -1) + $this->_scriptmsgsGeneral[$msg->getLine()-1][] = $msg; + else + $this->_scriptmsgsSpecific[$msg->getLine()-1][] = $msg; + } + } + + return true; + } + + function getNumLines() { + return count($this->_scriptlines); + } + + function getLineText($i) { + return $this->_scriptlines[$i]; + } + + function getLineMessages($i) { + /* messages that do not point to a specific character should come first */ + if (isset($this->_scriptmsgsGeneral[$i]) && + isset($this->_scriptmsgsSpecific[$i])) { + return array_merge($this->_scriptmsgsGeneral[$i], $this->_scriptmsgsSpecific[$i]); + } + + if (isset($this->_scriptmsgsGeneral[$i])) + return $this->_scriptmsgsGeneral[$i]; + + if (isset($this->_scriptmsgsSpecific[$i])) + return $this->_scriptmsgsSpecific[$i]; + + return Array(); + } + + /* assumes path and that SERVER_SOFTWARE env is set */ + function _launchLintBinary($input, &$output) { + $descriptorspec = array( + 0 => array("pipe", "r"), // stdin is a pipe that the child will read from + 1 => array("pipe", "w"), // stdout is a pipe that the child will write to + 2 => array("pipe", "w") + ); + + /* launch process */ + $path = escapeshellcmd($this->_binarypath) . ' --nologo --nosummary --stdin -context --conf ' . escapeshellarg($this->_confpath); + $process = proc_open($path, $descriptorspec, $pipes); + if (!is_resource($process)) + return false; + + // $pipes now looks like this: + // 0 => writeable handle connected to child stdin + // 1 => readable handle connected to child stdout + // 2 => readable handle connected to child stdout + fwrite($pipes[0], $input); + fclose($pipes[0]); + + $output = ''; + while (!feof($pipes[1])) + $output .= fgets($pipes[1], 1024); + fclose($pipes[1]); + fclose($pipes[2]); + + // It is important that you close any pipes before calling + // proc_close in order to avoid a deadlock + $return_value = proc_close($process); + return true; + } + }; + + function getEncodedText($text) + { + $enc = htmlentities($text); + $enc = str_replace("\n", '<br/>', $enc); + $enc = str_replace(' ', ' ', $enc); + return $enc; + } + + function OutputLintHTML($engine) + { +?> + <style type="text/css"> + div#code + { + color: #999; + font-family: monospace; + } + div#code div + { + color: black; + background-color: #EEE; + } + div#code div span + { + font-weight: bold; + font-family: Arial; + white-space: auto; + font-size: .9em; + color: #F00; + } + </style> +<?php + + /* output script */ + $hasWarnedSemicolon = false; + + $numlines = $engine->getNumLines(); + $widthOfLineNo = strlen($numlines); + $lineNoSpacer = str_pad("", $widthOfLineNo, " ") . ' '; + + echo '<div id="code">'; + for ($lineno = 0; $lineno < $numlines; $lineno++) + { + /* format code */ + $text = $engine->getLineText($lineno); + $text = str_replace("\t", str_pad("", 4/*tab width*/, " "), $text); + echo getEncodedText(str_pad($lineno+1, $widthOfLineNo, " ", STR_PAD_LEFT) . ' ' . $text . "\n"); + + /* show errors */ + $errors = $engine->getLineMessages($lineno); + foreach ($errors as $Error) { + /* only show this warning once */ + if (strcasecmp($Error->getErrName(), "missing_semicolon") == 0) { + if ($hasWarnedSemicolon) + continue; + $hasWarnedSemicolon = true; + } + + echo '<div>'; + + /* point to the error position, if available */ + if ($Error->getChar() > -1) + echo getEncodedText($lineNoSpacer . str_pad("", $Error->getChar()-1, "=") . "^\n"); + + /* output error type/message */ + echo getEncodedText($lineNoSpacer) . '<span>'; + if ($Error->getType()) + echo getEncodedText($Error->getType() . ': '); + echo getEncodedText($Error->getMessage()); + echo '</span>' . getEncodedText("\n"); + + echo '</div>'; + } + + if ($lineno % 1000 == 0) + flush(); + } + echo '</div>'; + } +?> Property changes on: trunk/www/_jsl_online.inc ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/_lint_front.inc =================================================================== --- trunk/www/_lint_front.inc (rev 0) +++ trunk/www/_lint_front.inc 2009-10-08 13:54:28 UTC (rev 276) @@ -0,0 +1,64 @@ +<?php + // Get the posted script/URL + if (isset($_POST['script'])) + $_Script = stripslashes($_POST['script']); + else + $_Script = ""; + + function _DownloadURL($url) { + $cUrl = curl_init(); + curl_setopt($cUrl, CURLOPT_URL, $url); + curl_setopt($cUrl, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($cUrl, CURLOPT_TIMEOUT, 5); + $PageContent = curl_exec($cUrl); + if (curl_errno($cUrl)) + return false; + return $PageContent; + } + + function _OutputError($error) { + echo '<p style="color: #F00; font-weight: bold">' . htmlentities($error) . '</p>'; + } + + function _isURL($url) { + if (strstr($url, "\n") !== FALSE) + return false; + if (strstr($url, "\r\n") !== FALSE) + return false; + if (!preg_match('!^((ht|f)tps?\:\/\/)?([\w\-]+\.)+([\w]{2,5})((/(.*))?)$!i', $url)) + return false; + return true; + } + + function outputscript() { + global $_Script; + echo htmlentities($_Script); + } + + function outputlint() { + global $_Script; + if (strlen($_Script) > 0) { + // set up the new engine + require_once("_jsl_online.inc"); + $engine = new JSLEngine('../jsl-cgi-bin/jsl', '../jsl-cgi-bin/jsl.server.conf'); + + if (_isURL(trim($_Script))) { + // Download and lint the URL + $code = _DownloadURL(trim($_Script)); + if ($code !== false) + $result = $engine->Lint($code); + else + $result = "The URL could not be downloaded: " . $_Script; + } + else + $result = $engine->Lint($_Script); + + // output the results + if ($result === true) + OutputLintHTML($engine); + else + _OutputError($result); + } + } +?> + Property changes on: trunk/www/_lint_front.inc ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/www/online_lint.php =================================================================== --- trunk/www/online_lint.php 2009-10-08 13:31:52 UTC (rev 275) +++ trunk/www/online_lint.php 2009-10-08 13:54:28 UTC (rev 276) @@ -3,6 +3,8 @@ @title=The Online Lint --> +<?php require('_lint_front.inc') ?> + Online Lint =========== @@ -14,10 +16,12 @@ <form method="POST" action=""> <p>Paste your JavaScript, HTML, or URL into the box below:</p> <p> - <textarea name="script" rows="15" cols="75" style="width: 100%"></textarea> + <textarea name="script" rows="15" cols="75" style="width: 100%"><?php outputscript(); ?></textarea> </p> <p> <input type="submit" value="Lint"/> +</p> -</p> +<?php outputlint(); ?> + </form> Modified: trunk/www.py =================================================================== --- trunk/www.py 2009-10-08 13:31:52 UTC (rev 275) +++ trunk/www.py 2009-10-08 13:54:28 UTC (rev 276) @@ -267,6 +267,8 @@ return 'image/gif', source elif path.endswith('.png'): return 'image/png', source + elif path.endswith('.inc'): + return 'text/plain', source elif path.endswith('.rss'): settings, source = _preprocess(path) return 'text/xml', _gen_rss(host, path, source, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-08 13:32:02
|
Revision: 275 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=275&view=rev Author: matthiasmiller Date: 2009-10-08 13:31:52 +0000 (Thu, 08 Oct 2009) Log Message: ----------- www: more refactoring Modified Paths: -------------- trunk/www/__template__ trunk/www/docs/running_from_your_ide.htm trunk/www.py Modified: trunk/www/__template__ =================================================================== --- trunk/www/__template__ 2009-10-08 09:41:26 UTC (rev 274) +++ trunk/www/__template__ 2009-10-08 13:31:52 UTC (rev 275) @@ -2,6 +2,7 @@ <head> <title>%(title)s</title> <link rel="stylesheet" type="text/css" href="/static/global.css" /> + <link rel="alternate" type="text/xml" title="RSS 2.0" href="/news/index.rss" /> </head> <body> <div id="title"> Modified: trunk/www/docs/running_from_your_ide.htm =================================================================== --- trunk/www/docs/running_from_your_ide.htm 2009-10-08 09:41:26 UTC (rev 274) +++ trunk/www/docs/running_from_your_ide.htm 2009-10-08 13:31:52 UTC (rev 275) @@ -44,7 +44,7 @@ > > `file.patterns.js=*.js;*.es` > > `command.compile.$(file.patterns.js)=/path/to/jsl conf /path/to/configuration/file process $(FileNameExt)` -> You will also need to change your JavaScript Lint configuration so that SciTE will correctly place a yellow dot at the beginning of the line corresponding to the current error [see screenshot](../images/jsl-SciTE-screenshot.png). Change the `output-format` setting to: +> You will also need to change your JavaScript Lint configuration so that SciTE will correctly place a yellow dot at the beginning of the line corresponding to the current error. Change the `output-format` setting to: > > `+output-format __FILE__:__LINE__: __ERROR__` Modified: trunk/www.py =================================================================== --- trunk/www.py 2009-10-08 09:41:26 UTC (rev 274) +++ trunk/www.py 2009-10-08 13:31:52 UTC (rev 275) @@ -2,7 +2,6 @@ # vim: ts=4 sw=4 expandtab import BaseHTTPServer import datetime -import md5 import re import os import sys @@ -22,18 +21,68 @@ ('/contact_support.htm', 'Contact'), ] -def _markdown2doc(source): +# RSS should use absolute URLs, but enable it for everything. Also +# use this post-processor to validate links. +class _URLPostProcessor(markdown.Postprocessor): + def __init__(self, host, filepath): + self._host = host + self._filepath = filepath + + def run(self, doc): + self._resolvelinks(doc.documentElement) + return doc + + def _resolvelinks(self, node): + if node.type != "element": + return + for child in node.childNodes: + self._resolvelinks(child) + linkattrs = { + 'a': 'href', + 'script': 'src', + 'link': 'href', + 'img': 'src', + } + if node.nodeName in linkattrs: + attrname = linkattrs[node.nodeName] + if not attrname in node.attribute_values: + return + + attrvalue = node.attribute_values[attrname] + if not attrvalue.startswith('http://'): + if not attrvalue.startswith('/'): + targetpath = _get_path_for_url(attrvalue, self._filepath) + if not targetpath: + raise ValueError, 'Could not resolve URL %s' % attrvalue + + # Get the folder of the parent path. + parenturl = _get_relurl_for_filepath(self._filepath) + assert parenturl.startswith('/') + parenturl = parenturl.rpartition('/')[0] + attrvalue = parenturl + '/' + attrvalue + assert _get_path_for_url(attrvalue, None) == targetpath + attrvalue = 'http://%s%s' % (self._host, attrvalue) + node.attribute_values[attrname] = attrvalue + +def _markdown2doc(host, filepath, source): class _PostProcessor(markdown.Postprocessor): def run(self, doc): self.doc = doc return doc + urlprocessor = _URLPostProcessor(host, filepath) postprocessor = _PostProcessor() md = markdown.Markdown() + md.postprocessors.append(urlprocessor) md.postprocessors.append(postprocessor) md.convert(source) return postprocessor.doc -def _resolve_url(url, parentpath): +def _get_relurl_for_filepath(filepath): + assert (filepath + os.sep).startswith(DOC_ROOT + os.sep) + relpath = filepath[len(DOC_ROOT + os.sep):] + return '/' + relpath.replace(os.sep, '/') + +def _get_path_for_url(url, parentpath): root = DOC_ROOT if not url.startswith('/'): if parentpath: @@ -54,7 +103,7 @@ def _get_nav(path): nav = [] for url, name in NAV: - navpath = _resolve_url(url, None) + navpath = _get_path_for_url(url, None) if navpath and navpath == path: nav.append('* <a class="active">%s</a>' % name) else: @@ -64,7 +113,7 @@ def _remove_comments(source): return re.sub('<!--[^>]*-->', '', source) -def _gen_rss(source, title, link, desc, linkbase): +def _gen_rss(host, path, source, title, link, desc, linkbase): def removeblanktextnodes(node): for i in range(len(node.childNodes)-1, -1, -1): child = node.childNodes[i] @@ -74,13 +123,14 @@ else: removeblanktextnodes(child) text = _remove_comments(source) - doc = _markdown2doc(text) + doc = _markdown2doc(host, path, text) oldDocElement = doc.documentElement removeblanktextnodes(oldDocElement) rss = doc.createElement("rss") rss.setAttribute('version', '2.0') + rss.setAttribute('xmlns:atom', 'http://www.w3.org/2005/Atom') doc.appendChild(rss) channel = doc.createElement("channel") @@ -122,9 +172,6 @@ # Combine the href with the linkbase. assert 'href' in link.attributes href = link.attribute_values['href'] - if '/' in href: - raise ValueError, 'The heading link should not reference ' + \ - 'directories: %s' % href if not linkbase.endswith('/'): raise ValueError, 'The @linkbase must be a directory: %s' % \ linkbase @@ -184,7 +231,7 @@ # When including a file, update global settings and replace # with contents. - includepath = _resolve_url(url, path) + includepath = _get_path_for_url(url, path) if not includepath: raise ValueError, 'Unmatched URL: %s' % match.group(1) settings, contents = _preprocess(includepath) @@ -203,7 +250,16 @@ source = source.replace('__BASENAME__', os.path.basename(path)) return settings, source -def _transform_file(path): +def _transform_markdown(host, path): + settings, source = _preprocess(path) + page = markdown.markdown(source) + + postprocessor = _URLPostProcessor(host, path) + md = markdown.Markdown() + md.postprocessors.append(postprocessor) + return settings, md.convert(source) + +def _transform_file(host, path): source = open(path).read() if path.endswith('.css'): return 'text/css', source @@ -213,14 +269,14 @@ return 'image/png', source elif path.endswith('.rss'): settings, source = _preprocess(path) - return 'text/xml', _gen_rss(source, settings.get('title'), + return 'text/xml', _gen_rss(host, path, source, + settings.get('title'), settings.get('link'), settings.get('desc'), settings.get('linkbase')) elif path.endswith('.htm') or path.endswith('.php') or \ not '.' in os.path.basename(path): - settings, source = _preprocess(path) - page = markdown.markdown(source) + settings, page = _transform_markdown(host, path) if 'template' in settings: # TODO: encode keywords keywords = dict(settings) @@ -235,10 +291,12 @@ class _Handler(BaseHTTPServer.BaseHTTPRequestHandler): def do_GET(self): - path = _resolve_url(self.path, None) + path = _get_path_for_url(self.path, None) if path: + host = '%s:%s' % (self.server.server_name, \ + self.server.server_port) try: - self._send_response(*_transform_file(path)) + self._send_response(*_transform_file(host, path)) except Exception: self.send_error(500, "TRACEBACK") raise @@ -276,8 +334,8 @@ relpath = abspath[len(searchroot + os.sep):] yield relpath - if host: - raise ValueError, 'Host is not yet implemented.' + if not host or '/' in host: + raise ValueError, 'Host must be sub.domain.com' for relpath in findfiles(DOC_ROOT): sourcepath = os.path.join(DOC_ROOT, relpath) @@ -285,7 +343,7 @@ if not os.path.isdir(os.path.dirname(destpath)): os.makedirs(os.path.dirname(destpath)) - content_type, contents = _transform_file(sourcepath) + content_type, contents = _transform_file(host, sourcepath) outfile = open(destpath, 'wb') try: outfile.write(contents) @@ -297,7 +355,7 @@ runserver(host) return if action == 'build': - build() + build(host) return print >>sys.stderr, """\ Usage: www.py [server|build] <host> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-08 09:41:34
|
Revision: 274 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=274&view=rev Author: matthiasmiller Date: 2009-10-08 09:41:26 +0000 (Thu, 08 Oct 2009) Log Message: ----------- www: enable backwards-compatibility links Modified Paths: -------------- trunk/www/news.php trunk/www/rss.php Modified: trunk/www/news.php =================================================================== --- trunk/www/news.php 2009-10-08 09:08:05 UTC (rev 273) +++ trunk/www/news.php 2009-10-08 09:41:26 UTC (rev 274) @@ -1,3 +1,7 @@ <?php -// ?: Header("Location: /news/" . str_pad(int($_GET['id']), 3, "0")); +$id = intval($_GET['id'], 10); +if ($id) + Header('Location: /news/' . str_pad(strval($id), 3, '0', STR_PAD_LEFT)); +else + Header('Location: /news/'); ?> Modified: trunk/www/rss.php =================================================================== --- trunk/www/rss.php 2009-10-08 09:08:05 UTC (rev 273) +++ trunk/www/rss.php 2009-10-08 09:41:26 UTC (rev 274) @@ -1,3 +1,3 @@ <?php -// Header('Location: /news/index.rss'); +Header('Location: /news/index.rss'); ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-08 09:08:12
|
Revision: 273 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=273&view=rev Author: matthiasmiller Date: 2009-10-08 09:08:05 +0000 (Thu, 08 Oct 2009) Log Message: ----------- www: work on cleaning up RSS Modified Paths: -------------- trunk/www/news/004 trunk/www/static/global.css trunk/www.py Modified: trunk/www/news/004 =================================================================== --- trunk/www/news/004 2009-10-08 08:25:11 UTC (rev 272) +++ trunk/www/news/004 2009-10-08 09:08:05 UTC (rev 273) @@ -4,7 +4,7 @@ --> ## [JavaScript Lint 0.1e Released](__BASENAME__) -_Tue, 31 Aug 2005 02:40:49 +0000_ +_Wed, 31 Aug 2005 02:40:49 +0000_ This release fixes a crash triggered by the following statement: _for(i = 0; i < 5; )_. (The Linux binary is not currently available for this release.) Modified: trunk/www/static/global.css =================================================================== --- trunk/www/static/global.css 2009-10-08 08:25:11 UTC (rev 272) +++ trunk/www/static/global.css 2009-10-08 09:08:05 UTC (rev 273) @@ -34,6 +34,7 @@ margin: 0.25em; padding: 0.25em; text-align: center; + width: 9em; -moz-border-radius: 5px; -webkit-border-radius: 5px; } @@ -58,7 +59,7 @@ #body { - margin-left: 9em; + margin-left: 11em; } #footer Modified: trunk/www.py =================================================================== --- trunk/www.py 2009-10-08 08:25:11 UTC (rev 272) +++ trunk/www.py 2009-10-08 09:08:05 UTC (rev 273) @@ -1,6 +1,7 @@ #!/usr/bin/python # vim: ts=4 sw=4 expandtab import BaseHTTPServer +import datetime import md5 import re import os @@ -92,7 +93,7 @@ raise ValueError, 'Missing @desc= setting.' channel.appendChild(doc.createElement('title', textNode=title)) channel.appendChild(doc.createElement('link', textNode=link)) - channel.appendChild(doc.createElement('desc', textNode=desc)) + channel.appendChild(doc.createElement('description', textNode=desc)) guids = [] @@ -152,9 +153,16 @@ if not emchild or emchild.type != 'text': raise ValueError, "The first paragraph's em must " + \ "contain only text." + pubdate = emchild.value - # TODO: Validate canonical date format. + format = "%a, %d %b %Y %H:%M:%S +0000" + dateobj = datetime.datetime.strptime(pubdate, format) + normalized = dateobj.strftime(format) + if normalized != pubdate: + raise ValueError, 'Encountered date %s but expected %s' % \ + (pubdate, normalized) + item.appendChild(doc.createElement('pubDate', emchild.value)) item_desc = doc.createElement("description") item.appendChild(item_desc) @@ -245,12 +253,17 @@ self.wfile.write(content) -def runserver(): - server_address = ('', 8000) - httpd = BaseHTTPServer.HTTPServer(server_address, _Handler) +def runserver(host): + if host: + addr, _, port = host.partition(':') + else: + addr = '' + port = 8000 + + httpd = BaseHTTPServer.HTTPServer((addr, port), _Handler) httpd.serve_forever() -def build(): +def build(host): def findfiles(searchroot): """ Returns relative paths in root. """ @@ -263,6 +276,9 @@ relpath = abspath[len(searchroot + os.sep):] yield relpath + if host: + raise ValueError, 'Host is not yet implemented.' + for relpath in findfiles(DOC_ROOT): sourcepath = os.path.join(DOC_ROOT, relpath) destpath = os.path.join(BUILD_DIR, relpath) @@ -276,15 +292,15 @@ finally: outfile.close() -def main(action=''): +def main(action='', host=''): if action == 'server': - runserver() + runserver(host) return if action == 'build': build() return print >>sys.stderr, """\ -Usage: www.py [server|build] +Usage: www.py [server|build] <host> server runs a test server on localhost build generates static HTML files from the markup This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-08 08:25:23
|
Revision: 272 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=272&view=rev Author: matthiasmiller Date: 2009-10-08 08:25:11 +0000 (Thu, 08 Oct 2009) Log Message: ----------- Updating build instructions for Windows. Modified Paths: -------------- trunk/INSTALL trunk/Makefile.SpiderMonkey trunk/setup.py Modified: trunk/INSTALL =================================================================== --- trunk/INSTALL 2009-10-08 06:53:09 UTC (rev 271) +++ trunk/INSTALL 2009-10-08 08:25:11 UTC (rev 272) @@ -1,20 +1,21 @@ BUILDING FROM THE SUBVERSION TRUNK * Windows Prequisites: - * Visual Studio 2003 - * Python + * Visual Studio 2008 Express + * Python 2.6 * py2exe * MozillaBuild (http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites) - Launch the MozillaBuild 7.1 batch file. (You may have to run this as an Administrator - on Windows Vista.) Run the commands in that shell. + Launch the MozillaBuild MSVC 9 batch file. (You may have to run this as an + Administrator on Windows Vista.) Run the commands in that shell. - If you don't have a copy of Visual Studio 2003, you can download the Python - source code and compile it yourself. Python C extensions must be built with - the same compiler as the Python interpreter. - On all platforms: $ python setup.py build To install on Unix: $ sudo python setup.py install + +WEBSITE + * Windows: http://pypi.python.org/pypi/Markdown/1.7 + * Linux: $ sudo apt-get install python-markdown + Modified: trunk/Makefile.SpiderMonkey =================================================================== --- trunk/Makefile.SpiderMonkey 2009-10-08 06:53:09 UTC (rev 271) +++ trunk/Makefile.SpiderMonkey 2009-10-08 08:25:11 UTC (rev 272) @@ -20,7 +20,7 @@ ORIG_LIB=$(SPIDERMONKEY_SRC)/$(OBJDIR)/$(JS_LIB) COPY_LIB=$(BUILD_DIR)/$(JS_LIB) ORIG_DLL=$(SPIDERMONKEY_SRC)/$(OBJDIR)/js32.dll -COPY_DLL=$(DISTUTILS_DIR)/js32.dll +COPY_DLL=$(DISTUTILS_DIR)/javascriptlint/js32.dll OS_HEADER=$(BUILD_DIR)/js_operating_system.h ORIG_JSAUTOCFG_H=$(SPIDERMONKEY_SRC)/$(OBJDIR)/jsautocfg.h COPY_JSAUTOCFG_H=$(BUILD_DIR)/jsautocfg.h Modified: trunk/setup.py =================================================================== --- trunk/setup.py 2009-10-08 06:53:09 UTC (rev 271) +++ trunk/setup.py 2009-10-08 08:25:11 UTC (rev 272) @@ -10,10 +10,12 @@ class _MakefileError(Exception): pass -def _runmakefiles(distutils_dir, build_opt=1, args=[]): +def _runmakefiles(distutils_dir, build_opt=1, target=None): args = ['BUILD_OPT=%i' % build_opt] if distutils_dir: args.append('DISTUTILS_DIR=%s' % distutils_dir) + if target: + args.append(target) # First build SpiderMonkey. ret = subprocess.call(['make', '-f', 'Makefile.ref', '-C', @@ -36,7 +38,7 @@ class _MyClean(distutils.command.clean.clean): def run(self): - _runmakefiles(None, args=['clean']) + _runmakefiles(None, target='clean') distutils.command.clean.clean.run(self) if __name__ == '__main__': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-08 06:53:23
|
Revision: 271 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=271&view=rev Author: matthiasmiller Date: 2009-10-08 06:53:09 +0000 (Thu, 08 Oct 2009) Log Message: ----------- www: add command-line parameter to generate static version Modified Paths: -------------- trunk/www.py Modified: trunk/www.py =================================================================== --- trunk/www.py 2009-10-07 20:01:13 UTC (rev 270) +++ trunk/www.py 2009-10-08 06:53:09 UTC (rev 271) @@ -9,6 +9,7 @@ import markdown DOC_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'www') +BUILD_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'build', 'www') TEMPLATE_PATH = os.path.join(DOC_ROOT, '__template__') NAV = [ @@ -249,11 +250,39 @@ httpd = BaseHTTPServer.HTTPServer(server_address, _Handler) httpd.serve_forever() +def build(): + def findfiles(searchroot): + """ Returns relative paths in root. + """ + for root, dirs, files in os.walk(searchroot): + if '.svn' in dirs: + dirs.remove('.svn') + for file in files: + abspath = os.path.join(root, file) + assert abspath.startswith(searchroot + os.sep) + relpath = abspath[len(searchroot + os.sep):] + yield relpath + + for relpath in findfiles(DOC_ROOT): + sourcepath = os.path.join(DOC_ROOT, relpath) + destpath = os.path.join(BUILD_DIR, relpath) + if not os.path.isdir(os.path.dirname(destpath)): + os.makedirs(os.path.dirname(destpath)) + + content_type, contents = _transform_file(sourcepath) + outfile = open(destpath, 'wb') + try: + outfile.write(contents) + finally: + outfile.close() + def main(action=''): if action == 'server': runserver() return - # TODO: Implement 'build'. + if action == 'build': + build() + return print >>sys.stderr, """\ Usage: www.py [server|build] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-07 20:01:26
|
Revision: 270 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=270&view=rev Author: matthiasmiller Date: 2009-10-07 20:01:13 +0000 (Wed, 07 Oct 2009) Log Message: ----------- www: remove more domain literals Modified Paths: -------------- trunk/www/news/006 trunk/www/news/007 trunk/www/news/008 trunk/www/news/009 trunk/www/news/010 trunk/www/news/011 trunk/www/news/012 trunk/www/news/013 trunk/www/news/014 trunk/www/news/015 trunk/www/news/016 trunk/www/news/017 trunk/www/news/018 trunk/www/news/019 trunk/www/news/020 trunk/www/news/023 Modified: trunk/www/news/006 =================================================================== --- trunk/www/news/006 2009-10-07 19:56:09 UTC (rev 269) +++ trunk/www/news/006 2009-10-07 20:01:13 UTC (rev 270) @@ -6,6 +6,6 @@ ## [JavaScript Lint Source Package Available](__BASENAME__) _Sat, 01 Oct 2005 17:06:22 +0000_ -JavaScript Lint source is now [available for download](http://www.javascriptlint.com/download.htm) as a single package. +JavaScript Lint source is now [available for download](/download.htm) as a single package. Modified: trunk/www/news/007 =================================================================== --- trunk/www/news/007 2009-10-07 19:56:09 UTC (rev 269) +++ trunk/www/news/007 2009-10-07 20:01:13 UTC (rev 270) @@ -8,6 +8,6 @@ This release includes a warning if the default case is missing from switch, a warning if a case is duplicated within a switch, better intelligence when checking for missing break statements, and a `/*@fallthru*@/` control comment (must always come at the very end of a case). -Available from the [download page](http://www.javascriptlint.com/download.htm). +Available from the [download page](/download.htm). Modified: trunk/www/news/008 =================================================================== --- trunk/www/news/008 2009-10-07 19:56:09 UTC (rev 269) +++ trunk/www/news/008 2009-10-07 20:01:13 UTC (rev 270) @@ -7,6 +7,6 @@ _Tue, 25 Oct 2005 19:16:04 +0000_ This release upgrades the SpiderMonkey JavaScript engine from a release candidate to the latest stable branch (version 1.5). -Available from the [download page](http://www.javascriptlint.com/download.htm). +Available from the [download page](/download.htm). Modified: trunk/www/news/009 =================================================================== --- trunk/www/news/009 2009-10-07 19:56:09 UTC (rev 269) +++ trunk/www/news/009 2009-10-07 20:01:13 UTC (rev 270) @@ -17,6 +17,6 @@ This release fixes a bug that caused a "Bus error" on Mac OS X and a segmentation fault on Solaris 5.9; JavaScript Lint has now been compiled and run on those operating systems. If Mac users are interested in precompiled binaries, I will consider making them available for download on the website. -Available from the [download page](http://www.javascriptlint.com/download.htm). +Available from the [download page](/download.htm). Modified: trunk/www/news/010 =================================================================== --- trunk/www/news/010 2009-10-07 19:56:09 UTC (rev 269) +++ trunk/www/news/010 2009-10-07 20:01:13 UTC (rev 270) @@ -8,8 +8,8 @@ This release fixes a bug in the "duplicate case" warning for numbers. Certain numbers were incorrectly reported as duplicates. (This bug is more likely to affect JavaScript programmers using big-endian processors.) -The [Online Lint](http://www.javascriptlint.com/online_lint.php) has also been updated to use a local CGI, making the script much more responsive. PHP source code for the Online Lint is included in the source package. +The [Online Lint](/online_lint.php) has also been updated to use a local CGI, making the script much more responsive. PHP source code for the Online Lint is included in the source package. -Available from the [download page](http://www.javascriptlint.com/download.htm). +Available from the [download page](/download.htm). Modified: trunk/www/news/011 =================================================================== --- trunk/www/news/011 2009-10-07 19:56:09 UTC (rev 269) +++ trunk/www/news/011 2009-10-07 20:01:13 UTC (rev 270) @@ -37,6 +37,6 @@ * Scripts with circular _import_ directives no longer incorrectly report undeclared identifiers. -Available from the [download page](http://www.javascriptlint.com/download.htm). +Available from the [download page](/download.htm). Modified: trunk/www/news/012 =================================================================== --- trunk/www/news/012 2009-10-07 19:56:09 UTC (rev 269) +++ trunk/www/news/012 2009-10-07 20:01:13 UTC (rev 270) @@ -10,6 +10,6 @@ This release also improves the use of the _fallthru_ control comment when used in the final case in a switch statement. The "undeclared identifier" fix in the 0.1k release is now applied to both global and local variables declarations. -Available from the [download page](http://www.javascriptlint.com/download.htm). +Available from the [download page](/download.htm). Modified: trunk/www/news/013 =================================================================== --- trunk/www/news/013 2009-10-07 19:56:09 UTC (rev 269) +++ trunk/www/news/013 2009-10-07 20:01:13 UTC (rev 270) @@ -8,6 +8,6 @@ This release fixes a bug with the "undeclared identifier" warnings when using the import control comment. -Available from the [download page](http://www.javascriptlint.com/download.htm). +Available from the [download page](/download.htm). Modified: trunk/www/news/014 =================================================================== --- trunk/www/news/014 2009-10-07 19:56:09 UTC (rev 269) +++ trunk/www/news/014 2009-10-07 20:01:13 UTC (rev 270) @@ -10,6 +10,6 @@ This release has a command-line parameter to disable the file listing in the output. -Available from the [download page](http://www.javascriptlint.com/download.htm). +Available from the [download page](/download.htm). Modified: trunk/www/news/015 =================================================================== --- trunk/www/news/015 2009-10-07 19:56:09 UTC (rev 269) +++ trunk/www/news/015 2009-10-07 20:01:13 UTC (rev 270) @@ -8,6 +8,6 @@ This release includes a configuration setting to completely disable legacy control comments. -Available from the [download page](http://www.javascriptlint.com/download.htm). +Available from the [download page](/download.htm). Modified: trunk/www/news/016 =================================================================== --- trunk/www/news/016 2009-10-07 19:56:09 UTC (rev 269) +++ trunk/www/news/016 2009-10-07 20:01:13 UTC (rev 270) @@ -8,6 +8,6 @@ This release includes a __FILENAME__ keyword for the output format. -Available from the [download page](http://www.javascriptlint.com/download.htm). +Available from the [download page](/download.htm). Modified: trunk/www/news/017 =================================================================== --- trunk/www/news/017 2009-10-07 19:56:09 UTC (rev 269) +++ trunk/www/news/017 2009-10-07 20:01:13 UTC (rev 270) @@ -7,6 +7,6 @@ _Thu, 16 Feb 2006 01:11:07 +0000_ Syntax errors in imported scripts were not being reported. -Available from the [download page](http://www.javascriptlint.com/download.htm). +Available from the [download page](/download.htm). Modified: trunk/www/news/018 =================================================================== --- trunk/www/news/018 2009-10-07 19:56:09 UTC (rev 269) +++ trunk/www/news/018 2009-10-07 20:01:13 UTC (rev 270) @@ -12,6 +12,6 @@ JavaScript files using "Unicode (UTF-8 with signature) - Codepage 65001" encoding, such as those created in Microsoft Visual Studio, no longer generate errors. -Available from the [download page](http://www.javascriptlint.com/download.htm). +Available from the [download page](/download.htm). Modified: trunk/www/news/019 =================================================================== --- trunk/www/news/019 2009-10-07 19:56:09 UTC (rev 269) +++ trunk/www/news/019 2009-10-07 20:01:13 UTC (rev 270) @@ -6,12 +6,12 @@ ## [JavaScript Lint 0.2.5 Released](__BASENAME__) _Sat, 08 Apr 2006 04:29:38 +0000_ -To facilitate integration into other applications, the output format can now be passed on the command line and the results can be encoded. The source package contains source files that can be used to easily [integrate JavaScript Lint into a Windows program](http://www.javascriptlint.com/docs/running_from_your_windows_program.htm). +To facilitate integration into other applications, the output format can now be passed on the command line and the results can be encoded. The source package contains source files that can be used to easily [integrate JavaScript Lint into a Windows program](/docs/running_from_your_windows_program.htm). -The [documentation](http://www.javascriptlint.com/docs/) on the website has been updated. +The [documentation](/docs/) on the website has been updated. The "Unicode (UTF-8 with signature) - Codepage 65001" encoding is now supported for configuration files. -Available from the [download page](http://www.javascriptlint.com/download.htm). +Available from the [download page](/download.htm). Modified: trunk/www/news/020 =================================================================== --- trunk/www/news/020 2009-10-07 19:56:09 UTC (rev 269) +++ trunk/www/news/020 2009-10-07 20:01:13 UTC (rev 270) @@ -8,4 +8,4 @@ JavaScript Lint now has a `/*jsl:ignoreall*\` keyword to allow entire files to easily be ignored. Additionally, it no longer complains about blank JavaScript files. -Available from the [download page](http://www.javascriptlint.com/download.htm). +Available from the [download page](/download.htm). Modified: trunk/www/news/023 =================================================================== --- trunk/www/news/023 2009-10-07 19:56:09 UTC (rev 269) +++ trunk/www/news/023 2009-10-07 20:01:13 UTC (rev 270) @@ -6,6 +6,6 @@ ## [IDE Integration](__BASENAME__) _Sat, 29 Sep 2007 22:08:21 +0000_ -The [documentation page](http://www.javascriptlint.com/docs/running_from_your_ide.htm) now contains instructions for integrating JavaScript Lint with TextMate, vim, and emacs. +The [documentation page](/docs/running_from_your_ide.htm) now contains instructions for integrating JavaScript Lint with TextMate, vim, and emacs. Improvements to the documentation are welcome. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-07 19:56:23
|
Revision: 269 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=269&view=rev Author: matthiasmiller Date: 2009-10-07 19:56:09 +0000 (Wed, 07 Oct 2009) Log Message: ----------- www: avoid hardcode URLs whenever possible Modified Paths: -------------- trunk/www/news/001 trunk/www/news/002 trunk/www/news/003 trunk/www/news/004 trunk/www/news/005 trunk/www/news/006 trunk/www/news/007 trunk/www/news/008 trunk/www/news/009 trunk/www/news/010 trunk/www/news/011 trunk/www/news/012 trunk/www/news/013 trunk/www/news/014 trunk/www/news/015 trunk/www/news/016 trunk/www/news/017 trunk/www/news/018 trunk/www/news/019 trunk/www/news/020 trunk/www/news/021 trunk/www/news/022 trunk/www/news/023 trunk/www/news/index.rss trunk/www.py Modified: trunk/www/news/001 =================================================================== --- trunk/www/news/001 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/001 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.1b Released](http://www.javascriptlint.com/news/001) +## [JavaScript Lint 0.1b Released](__BASENAME__) _Tue, 30 Aug 2005 15:37:08 +0000_ This release fixes a crash caused by certain syntax errors. For example: _if (a !=== b)_. Modified: trunk/www/news/002 =================================================================== --- trunk/www/news/002 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/002 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.1c Released](http://www.javascriptlint.com/news/002) +## [JavaScript Lint 0.1c Released](__BASENAME__) _Tue, 30 Aug 2005 18:54:06 +0000_ This release corrects problems with the wildcard feature. Modified: trunk/www/news/003 =================================================================== --- trunk/www/news/003 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/003 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.1d Released](http://www.javascriptlint.com/news/003) +## [JavaScript Lint 0.1d Released](__BASENAME__) _Tue, 30 Aug 2005 22:28:35 +0000_ This release fixes a crash caused by an incorrectly formed control comment. Modified: trunk/www/news/004 =================================================================== --- trunk/www/news/004 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/004 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.1e Released](http://www.javascriptlint.com/news/004) +## [JavaScript Lint 0.1e Released](__BASENAME__) _Tue, 31 Aug 2005 02:40:49 +0000_ This release fixes a crash triggered by the following statement: _for(i = 0; i < 5; )_. (The Linux binary is not currently available for this release.) Modified: trunk/www/news/005 =================================================================== --- trunk/www/news/005 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/005 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.1f Released](http://www.javascriptlint.com/news/005) +## [JavaScript Lint 0.1f Released](__BASENAME__) _Sat, 10 Sep 2005 14:59:43 +0000_ This release adds a separate warning for nested statements that don't use curly braces (nested _if_, _for_, _while_, etc.), a warning for useless assignments (x = x), and a configuration option to enable option-explicit across all files. Modified: trunk/www/news/006 =================================================================== --- trunk/www/news/006 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/006 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint Source Package Available](http://www.javascriptlint.com/news/006) +## [JavaScript Lint Source Package Available](__BASENAME__) _Sat, 01 Oct 2005 17:06:22 +0000_ JavaScript Lint source is now [available for download](http://www.javascriptlint.com/download.htm) as a single package. Modified: trunk/www/news/007 =================================================================== --- trunk/www/news/007 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/007 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.1g Released](http://www.javascriptlint.com/news/007) +## [JavaScript Lint 0.1g Released](__BASENAME__) _Sat, 08 Oct 2005 16:37:29 +0000_ This release includes a warning if the default case is missing from switch, a warning if a case is duplicated within a switch, better intelligence when checking for missing break statements, and a `/*@fallthru*@/` control comment (must always come at the very end of a case). Modified: trunk/www/news/008 =================================================================== --- trunk/www/news/008 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/008 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.1h Released](http://www.javascriptlint.com/news/008) +## [JavaScript Lint 0.1h Released](__BASENAME__) _Tue, 25 Oct 2005 19:16:04 +0000_ This release upgrades the SpiderMonkey JavaScript engine from a release candidate to the latest stable branch (version 1.5). Modified: trunk/www/news/009 =================================================================== --- trunk/www/news/009 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/009 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.1i Released](http://www.javascriptlint.com/news/009) +## [JavaScript Lint 0.1i Released](__BASENAME__) _Wed, 16 Nov 2005 14:28:54 +0000_ This release has a more specific warning for _else_ statements that may be intended for one of multiple _if_ statements (it previously warned that nested statements should use curly braces to resolve ambiguity): Modified: trunk/www/news/010 =================================================================== --- trunk/www/news/010 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/010 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.1j Released](http://www.javascriptlint.com/news/010) +## [JavaScript Lint 0.1j Released](__BASENAME__) _Mon, 05 Dec 2005 20:19:35 +0000_ This release fixes a bug in the "duplicate case" warning for numbers. Certain numbers were incorrectly reported as duplicates. (This bug is more likely to affect JavaScript programmers using big-endian processors.) Modified: trunk/www/news/011 =================================================================== --- trunk/www/news/011 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/011 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.1k Released](http://www.javascriptlint.com/news/011) +## [JavaScript Lint 0.1k Released](__BASENAME__) _Sat, 24 Dec 2005 18:56:35 +0000_ This release includes a number changes. Modified: trunk/www/news/012 =================================================================== --- trunk/www/news/012 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/012 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.1l Released](http://www.javascriptlint.com/news/012) +## [JavaScript Lint 0.1l Released](__BASENAME__) _Mon, 02 Jan 2006 22:05:25 +0000_ This release includes a new warning for useless comparisons (for example, x == x). Modified: trunk/www/news/013 =================================================================== --- trunk/www/news/013 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/013 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.1m Released](http://www.javascriptlint.com/news/013) +## [JavaScript Lint 0.1m Released](__BASENAME__) _Tue, 03 Jan 2006 17:31:25 +0000_ This release fixes a bug with the "undeclared identifier" warnings when using the import control comment. Modified: trunk/www/news/014 =================================================================== --- trunk/www/news/014 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/014 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.2.0 Released](http://www.javascriptlint.com/news/014) +## [JavaScript Lint 0.2.0 Released](__BASENAME__) _Wed, 04 Jan 2006 02:20:01 +0000_ This release includes cumulative changes through version 0.1m. Modified: trunk/www/news/015 =================================================================== --- trunk/www/news/015 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/015 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.2.1 Released](http://www.javascriptlint.com/news/015) +## [JavaScript Lint 0.2.1 Released](__BASENAME__) _Mon, 09 Jan 2006 14:18:24 +0000_ This release includes a configuration setting to completely disable legacy control comments. Modified: trunk/www/news/016 =================================================================== --- trunk/www/news/016 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/016 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.2.2 Released](http://www.javascriptlint.com/news/016) +## [JavaScript Lint 0.2.2 Released](__BASENAME__) _Tue, 24 Jan 2006 14:16:24 +0000_ This release includes a __FILENAME__ keyword for the output format. Modified: trunk/www/news/017 =================================================================== --- trunk/www/news/017 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/017 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.2.3 Released](http://www.javascriptlint.com/news/017) +## [JavaScript Lint 0.2.3 Released](__BASENAME__) _Thu, 16 Feb 2006 01:11:07 +0000_ Syntax errors in imported scripts were not being reported. Modified: trunk/www/news/018 =================================================================== --- trunk/www/news/018 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/018 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.2.4 Released](http://www.javascriptlint.com/news/018) +## [JavaScript Lint 0.2.4 Released](__BASENAME__) _Sat, 11 Mar 2006 02:55:51 +0000_ JavaScript within HTML files can now contain `</script>` in string literals and comments. Modified: trunk/www/news/019 =================================================================== --- trunk/www/news/019 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/019 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.2.5 Released](http://www.javascriptlint.com/news/019) +## [JavaScript Lint 0.2.5 Released](__BASENAME__) _Sat, 08 Apr 2006 04:29:38 +0000_ To facilitate integration into other applications, the output format can now be passed on the command line and the results can be encoded. The source package contains source files that can be used to easily [integrate JavaScript Lint into a Windows program](http://www.javascriptlint.com/docs/running_from_your_windows_program.htm). Modified: trunk/www/news/020 =================================================================== --- trunk/www/news/020 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/020 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.2.6 Released](http://www.javascriptlint.com/news/020) +## [JavaScript Lint 0.2.6 Released](__BASENAME__) _Sat, 29 Apr 2006 15:07:13 +0000_ JavaScript Lint now has a `/*jsl:ignoreall*\` keyword to allow entire files to easily be ignored. Additionally, it no longer complains about blank JavaScript files. Modified: trunk/www/news/021 =================================================================== --- trunk/www/news/021 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/021 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint SourceForge Project](http://www.javascriptlint.com/news/021) +## [JavaScript Lint SourceForge Project](__BASENAME__) _Fri, 26 May 2006 05:15:10 +0000_ JavaScript Lint now has its own [SourceForge project](http://sourceforge.net/projects/javascriptlint) with [discussion forums](http://sourceforge.net/forum/?group_id=168518), [bug/feature trackers](http://sourceforge.net/tracker/?group_id=168518), and a publicly-available [Subversion repository](http://sourceforge.net/svn/?group_id=168518). Modified: trunk/www/news/022 =================================================================== --- trunk/www/news/022 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/022 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [JavaScript Lint 0.3.0 Released](http://www.javascriptlint.com/news/022) +## [JavaScript Lint 0.3.0 Released](__BASENAME__) _Fri, 03 Nov 2006 20:32:42 +0000_ This version has also been released for Intel Macs. Modified: trunk/www/news/023 =================================================================== --- trunk/www/news/023 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/023 2009-10-07 19:56:09 UTC (rev 269) @@ -3,7 +3,7 @@ @title=News --> -## [IDE Integration](http://www.javascriptlint.com/news/023) +## [IDE Integration](__BASENAME__) _Sat, 29 Sep 2007 22:08:21 +0000_ The [documentation page](http://www.javascriptlint.com/docs/running_from_your_ide.htm) now contains instructions for integrating JavaScript Lint with TextMate, vim, and emacs. Modified: trunk/www/news/index.rss =================================================================== --- trunk/www/news/index.rss 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www/news/index.rss 2009-10-07 19:56:09 UTC (rev 269) @@ -3,6 +3,7 @@ @title=JavaScript Lint Project News @link=http://www.javascriptlint.com/ @desc=JavaScript Lint Project News +@linkbase=http://www.javascriptlint.com/news/ --> <!--@include index.htm--> Modified: trunk/www.py =================================================================== --- trunk/www.py 2009-10-07 19:39:23 UTC (rev 268) +++ trunk/www.py 2009-10-07 19:56:09 UTC (rev 269) @@ -62,7 +62,7 @@ def _remove_comments(source): return re.sub('<!--[^>]*-->', '', source) -def _gen_rss(source, title, link, desc): +def _gen_rss(source, title, link, desc, linkbase): def removeblanktextnodes(node): for i in range(len(node.childNodes)-1, -1, -1): child = node.childNodes[i] @@ -117,8 +117,16 @@ 'single text node.' heading = titlenode.value.strip() + # Combine the href with the linkbase. assert 'href' in link.attributes href = link.attribute_values['href'] + if '/' in href: + raise ValueError, 'The heading link should not reference ' + \ + 'directories: %s' % href + if not linkbase.endswith('/'): + raise ValueError, 'The @linkbase must be a directory: %s' % \ + linkbase + href = linkbase + href if href in guids: raise ValueError, "Duplicate link: %s" % href @@ -183,6 +191,7 @@ # The settings defined in the outer file will rule. settings = dict(re.findall(r'^@(\w+)=(.*)$', source, re.MULTILINE)) source = _remove_comments(source) + source = source.replace('__BASENAME__', os.path.basename(path)) return settings, source def _transform_file(path): @@ -197,7 +206,8 @@ settings, source = _preprocess(path) return 'text/xml', _gen_rss(source, settings.get('title'), settings.get('link'), - settings.get('desc')) + settings.get('desc'), + settings.get('linkbase')) elif path.endswith('.htm') or path.endswith('.php') or \ not '.' in os.path.basename(path): settings, source = _preprocess(path) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-07 19:39:31
|
Revision: 268 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=268&view=rev Author: matthiasmiller Date: 2009-10-07 19:39:23 +0000 (Wed, 07 Oct 2009) Log Message: ----------- www: disallow changing directory with inclusions, since links get confusing Modified Paths: -------------- trunk/www/__template__ trunk/www/rss.php trunk/www.py Added Paths: ----------- trunk/www/news/index.rss Removed Paths: ------------- trunk/www/news.rss Modified: trunk/www/__template__ =================================================================== --- trunk/www/__template__ 2009-10-07 19:32:04 UTC (rev 267) +++ trunk/www/__template__ 2009-10-07 19:39:23 UTC (rev 268) @@ -10,7 +10,7 @@ <div id="nav"> %(nav)s - <p align="center"><br/><a href="/news.rss"> + <p align="center"><br/><a href="/news/index.rss"> <img border="0" src="/static/feed-icon-32x32.png" width="32" height="32"></a></p> <p align="center"><br/><a href="http://sourceforge.net/projects/javascriptlint"> Copied: trunk/www/news/index.rss (from rev 267, trunk/www/news.rss) =================================================================== --- trunk/www/news/index.rss (rev 0) +++ trunk/www/news/index.rss 2009-10-07 19:39:23 UTC (rev 268) @@ -0,0 +1,8 @@ +<!-- +@output=rss +@title=JavaScript Lint Project News +@link=http://www.javascriptlint.com/ +@desc=JavaScript Lint Project News +--> + +<!--@include index.htm--> Property changes on: trunk/www/news/index.rss ___________________________________________________________________ Added: svn:mergeinfo + Added: svn:eol-style + native Deleted: trunk/www/news.rss =================================================================== --- trunk/www/news.rss 2009-10-07 19:32:04 UTC (rev 267) +++ trunk/www/news.rss 2009-10-07 19:39:23 UTC (rev 268) @@ -1,8 +0,0 @@ -<!-- -@output=rss -@title=JavaScript Lint Project News -@link=http://www.javascriptlint.com/ -@desc=JavaScript Lint Project News ---> - -<!--@include /news/--> Modified: trunk/www/rss.php =================================================================== --- trunk/www/rss.php 2009-10-07 19:32:04 UTC (rev 267) +++ trunk/www/rss.php 2009-10-07 19:39:23 UTC (rev 268) @@ -1,3 +1,3 @@ <?php -// Header('Location: /news.rss'); +// Header('Location: /news/index.rss'); ?> Modified: trunk/www.py =================================================================== --- trunk/www.py 2009-10-07 19:32:04 UTC (rev 267) +++ trunk/www.py 2009-10-07 19:39:23 UTC (rev 268) @@ -128,7 +128,7 @@ channel.appendChild(item) item.appendChild(doc.createElement("link", href)) item.appendChild(doc.createElement("title", heading)) - item.appendChild(doc.createElement("guid", guid)) + item.appendChild(doc.createElement("guid", href)) item_desc = None elif child.nodeName in ["p", "ul", "blockquote"] : @@ -159,9 +159,15 @@ def _preprocess(path): def _include(match): + # Disallow changing directories because of how links, etc + # will resolve. + url = match.group(1).strip() + if '/' in url: + raise ValueError, 'Inclusions cannot cross directories' + # When including a file, update global settings and replace # with contents. - includepath = _resolve_url(match.group(1).strip(), path) + includepath = _resolve_url(url, path) if not includepath: raise ValueError, 'Unmatched URL: %s' % match.group(1) settings, contents = _preprocess(includepath) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-07 19:32:12
|
Revision: 267 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=267&view=rev Author: matthiasmiller Date: 2009-10-07 19:32:04 +0000 (Wed, 07 Oct 2009) Log Message: ----------- www: break news into separate items and implement RSS support Modified Paths: -------------- trunk/www/__template__ trunk/www/news.php trunk/www/rss.php trunk/www.py Added Paths: ----------- trunk/www/news/ trunk/www/news/001 trunk/www/news/002 trunk/www/news/003 trunk/www/news/004 trunk/www/news/005 trunk/www/news/006 trunk/www/news/007 trunk/www/news/008 trunk/www/news/009 trunk/www/news/010 trunk/www/news/011 trunk/www/news/012 trunk/www/news/013 trunk/www/news/014 trunk/www/news/015 trunk/www/news/016 trunk/www/news/017 trunk/www/news/018 trunk/www/news/019 trunk/www/news/020 trunk/www/news/021 trunk/www/news/022 trunk/www/news/023 trunk/www/news/index.htm trunk/www/news.rss Modified: trunk/www/__template__ =================================================================== --- trunk/www/__template__ 2009-10-07 18:44:42 UTC (rev 266) +++ trunk/www/__template__ 2009-10-07 19:32:04 UTC (rev 267) @@ -10,7 +10,7 @@ <div id="nav"> %(nav)s - <p align="center"><br/><a href="/rss.php"> + <p align="center"><br/><a href="/news.rss"> <img border="0" src="/static/feed-icon-32x32.png" width="32" height="32"></a></p> <p align="center"><br/><a href="http://sourceforge.net/projects/javascriptlint"> Added: trunk/www/news/001 =================================================================== --- trunk/www/news/001 (rev 0) +++ trunk/www/news/001 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,9 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.1b Released](http://www.javascriptlint.com/news/001) +_Tue, 30 Aug 2005 15:37:08 +0000_ + +This release fixes a crash caused by certain syntax errors. For example: _if (a !=== b)_. Property changes on: trunk/www/news/001 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/002 =================================================================== --- trunk/www/news/002 (rev 0) +++ trunk/www/news/002 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,9 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.1c Released](http://www.javascriptlint.com/news/002) +_Tue, 30 Aug 2005 18:54:06 +0000_ + +This release corrects problems with the wildcard feature. Property changes on: trunk/www/news/002 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/003 =================================================================== --- trunk/www/news/003 (rev 0) +++ trunk/www/news/003 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,9 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.1d Released](http://www.javascriptlint.com/news/003) +_Tue, 30 Aug 2005 22:28:35 +0000_ + +This release fixes a crash caused by an incorrectly formed control comment. Property changes on: trunk/www/news/003 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/004 =================================================================== --- trunk/www/news/004 (rev 0) +++ trunk/www/news/004 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,11 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.1e Released](http://www.javascriptlint.com/news/004) +_Tue, 31 Aug 2005 02:40:49 +0000_ + +This release fixes a crash triggered by the following statement: _for(i = 0; i < 5; )_. (The Linux binary is not currently available for this release.) + + Property changes on: trunk/www/news/004 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/005 =================================================================== --- trunk/www/news/005 (rev 0) +++ trunk/www/news/005 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,11 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.1f Released](http://www.javascriptlint.com/news/005) +_Sat, 10 Sep 2005 14:59:43 +0000_ + +This release adds a separate warning for nested statements that don't use curly braces (nested _if_, _for_, _while_, etc.), a warning for useless assignments (x = x), and a configuration option to enable option-explicit across all files. + + Property changes on: trunk/www/news/005 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/006 =================================================================== --- trunk/www/news/006 (rev 0) +++ trunk/www/news/006 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,11 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint Source Package Available](http://www.javascriptlint.com/news/006) +_Sat, 01 Oct 2005 17:06:22 +0000_ + +JavaScript Lint source is now [available for download](http://www.javascriptlint.com/download.htm) as a single package. + + Property changes on: trunk/www/news/006 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/007 =================================================================== --- trunk/www/news/007 (rev 0) +++ trunk/www/news/007 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,13 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.1g Released](http://www.javascriptlint.com/news/007) +_Sat, 08 Oct 2005 16:37:29 +0000_ + +This release includes a warning if the default case is missing from switch, a warning if a case is duplicated within a switch, better intelligence when checking for missing break statements, and a `/*@fallthru*@/` control comment (must always come at the very end of a case). + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + Property changes on: trunk/www/news/007 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/008 =================================================================== --- trunk/www/news/008 (rev 0) +++ trunk/www/news/008 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,12 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.1h Released](http://www.javascriptlint.com/news/008) +_Tue, 25 Oct 2005 19:16:04 +0000_ + +This release upgrades the SpiderMonkey JavaScript engine from a release candidate to the latest stable branch (version 1.5). +Available from the [download page](http://www.javascriptlint.com/download.htm). + + Property changes on: trunk/www/news/008 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/009 =================================================================== --- trunk/www/news/009 (rev 0) +++ trunk/www/news/009 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,22 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.1i Released](http://www.javascriptlint.com/news/009) +_Wed, 16 Nov 2005 14:28:54 +0000_ + +This release has a more specific warning for _else_ statements that may be intended for one of multiple _if_ statements (it previously warned that nested statements should use curly braces to resolve ambiguity): + +> + `if (i)` + `if (j) func1();` + `else func2();` + +The warning against duplicate case statements now correctly handles case statements with string literals. + +This release fixes a bug that caused a "Bus error" on Mac OS X and a segmentation fault on Solaris 5.9; JavaScript Lint has now been compiled and run on those operating systems. If Mac users are interested in precompiled binaries, I will consider making them available for download on the website. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + Property changes on: trunk/www/news/009 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/010 =================================================================== --- trunk/www/news/010 (rev 0) +++ trunk/www/news/010 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,15 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.1j Released](http://www.javascriptlint.com/news/010) +_Mon, 05 Dec 2005 20:19:35 +0000_ + +This release fixes a bug in the "duplicate case" warning for numbers. Certain numbers were incorrectly reported as duplicates. (This bug is more likely to affect JavaScript programmers using big-endian processors.) + +The [Online Lint](http://www.javascriptlint.com/online_lint.php) has also been updated to use a local CGI, making the script much more responsive. PHP source code for the Online Lint is included in the source package. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + Property changes on: trunk/www/news/010 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/011 =================================================================== --- trunk/www/news/011 (rev 0) +++ trunk/www/news/011 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,42 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.1k Released](http://www.javascriptlint.com/news/011) +_Sat, 24 Dec 2005 18:56:35 +0000_ + +This release includes a number changes. + +__Enhancements:__ + +* JavaScript Lint warns if the default case is not at the end of the switch statement. + +* Control comments can now use the `/*jsl:keyword*/` syntax in addition to the `/*@keyword@*/` syntax. The new syntax is recommended for interoperability with JScript conditional compilation, although the traditional syntax is still supported. + +* The "missing break" warning can be disabled for the last case in a switch statement. The presence of this _break_ is merely stylistic preference. + +* The "missing semicolon" warning can be disabled when anonymous functions are assigned to variables and properties (such as function prototypes). Code such as the following can optionally be allowed: + +> + function Coord() { + this.x = function() { + return 1; + } + } + Coord.prototype.y = function() { + return 0; + } + +__Bug Fixes:__ + +* The "undeclared identifier" warning for variables has been updated to reflect the ECMA specification. The following code no longer issues a warning: + > + function getX() { return x; } + var x; + +* Scripts with circular _import_ directives no longer incorrectly report undeclared identifiers. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + Property changes on: trunk/www/news/011 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/012 =================================================================== --- trunk/www/news/012 (rev 0) +++ trunk/www/news/012 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,15 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.1l Released](http://www.javascriptlint.com/news/012) +_Mon, 02 Jan 2006 22:05:25 +0000_ + +This release includes a new warning for useless comparisons (for example, x == x). + +This release also improves the use of the _fallthru_ control comment when used in the final case in a switch statement. The "undeclared identifier" fix in the 0.1k release is now applied to both global and local variables declarations. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + Property changes on: trunk/www/news/012 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/013 =================================================================== --- trunk/www/news/013 (rev 0) +++ trunk/www/news/013 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,13 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.1m Released](http://www.javascriptlint.com/news/013) +_Tue, 03 Jan 2006 17:31:25 +0000_ + +This release fixes a bug with the "undeclared identifier" warnings when using the import control comment. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + Property changes on: trunk/www/news/013 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/014 =================================================================== --- trunk/www/news/014 (rev 0) +++ trunk/www/news/014 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,15 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.2.0 Released](http://www.javascriptlint.com/news/014) +_Wed, 04 Jan 2006 02:20:01 +0000_ + +This release includes cumulative changes through version 0.1m. + +This release has a command-line parameter to disable the file listing in the output. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + Property changes on: trunk/www/news/014 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/015 =================================================================== --- trunk/www/news/015 (rev 0) +++ trunk/www/news/015 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,13 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.2.1 Released](http://www.javascriptlint.com/news/015) +_Mon, 09 Jan 2006 14:18:24 +0000_ + +This release includes a configuration setting to completely disable legacy control comments. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + Property changes on: trunk/www/news/015 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/016 =================================================================== --- trunk/www/news/016 (rev 0) +++ trunk/www/news/016 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,13 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.2.2 Released](http://www.javascriptlint.com/news/016) +_Tue, 24 Jan 2006 14:16:24 +0000_ + +This release includes a __FILENAME__ keyword for the output format. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + Property changes on: trunk/www/news/016 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/017 =================================================================== --- trunk/www/news/017 (rev 0) +++ trunk/www/news/017 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,12 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.2.3 Released](http://www.javascriptlint.com/news/017) +_Thu, 16 Feb 2006 01:11:07 +0000_ + +Syntax errors in imported scripts were not being reported. +Available from the [download page](http://www.javascriptlint.com/download.htm). + + Property changes on: trunk/www/news/017 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/018 =================================================================== --- trunk/www/news/018 (rev 0) +++ trunk/www/news/018 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,17 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.2.4 Released](http://www.javascriptlint.com/news/018) +_Sat, 11 Mar 2006 02:55:51 +0000_ + +JavaScript within HTML files can now contain `</script>` in string literals and comments. + +When referencing an external script, the _script_ start and end tags no longer need to be on the same line. + +JavaScript files using "Unicode (UTF-8 with signature) - Codepage 65001" encoding, such as those created in Microsoft Visual Studio, no longer generate errors. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + Property changes on: trunk/www/news/018 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/019 =================================================================== --- trunk/www/news/019 (rev 0) +++ trunk/www/news/019 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,17 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.2.5 Released](http://www.javascriptlint.com/news/019) +_Sat, 08 Apr 2006 04:29:38 +0000_ + +To facilitate integration into other applications, the output format can now be passed on the command line and the results can be encoded. The source package contains source files that can be used to easily [integrate JavaScript Lint into a Windows program](http://www.javascriptlint.com/docs/running_from_your_windows_program.htm). + +The [documentation](http://www.javascriptlint.com/docs/) on the website has been updated. + +The "Unicode (UTF-8 with signature) - Codepage 65001" encoding is now supported for configuration files. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + Property changes on: trunk/www/news/019 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/020 =================================================================== --- trunk/www/news/020 (rev 0) +++ trunk/www/news/020 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,11 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.2.6 Released](http://www.javascriptlint.com/news/020) +_Sat, 29 Apr 2006 15:07:13 +0000_ + +JavaScript Lint now has a `/*jsl:ignoreall*\` keyword to allow entire files to easily be ignored. Additionally, it no longer complains about blank JavaScript files. + +Available from the [download page](http://www.javascriptlint.com/download.htm). Property changes on: trunk/www/news/020 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/021 =================================================================== --- trunk/www/news/021 (rev 0) +++ trunk/www/news/021 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,9 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint SourceForge Project](http://www.javascriptlint.com/news/021) +_Fri, 26 May 2006 05:15:10 +0000_ + +JavaScript Lint now has its own [SourceForge project](http://sourceforge.net/projects/javascriptlint) with [discussion forums](http://sourceforge.net/forum/?group_id=168518), [bug/feature trackers](http://sourceforge.net/tracker/?group_id=168518), and a publicly-available [Subversion repository](http://sourceforge.net/svn/?group_id=168518). Property changes on: trunk/www/news/021 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/022 =================================================================== --- trunk/www/news/022 (rev 0) +++ trunk/www/news/022 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,30 @@ +<!-- +@template=__template__ +@title=News +--> + +## [JavaScript Lint 0.3.0 Released](http://www.javascriptlint.com/news/022) +_Fri, 03 Nov 2006 20:32:42 +0000_ + +This version has also been released for Intel Macs. + +__Enhancements:__ + +* Add support for JScript's function extensions, such as `function window.onload() {}` and `function window::onload()`. (This is disabled by default.) +* Add a `/*jsl:pass*/` control comment to suppress warnings about empty statementss. +* Add a `/*jsl:declare*/` control comment to suppress warnings about undeclared identifiers. +* Warn against trailing comments in array initializers. +* Warn against assignments to function calls (for example, `alert() = 10`). +* Warn against calls to `parseInt` without a radix parameter. +* Warn against implicit type conversion when comparing against `true` or `false`. +* Clarify the warning against `with` statements. + +__Bug Fixes:__ + +* Fix syntax error on nested comments. +* Fix duplicate case warning. +* Fix insuppressible increment/decrement warning. +* Fix incorrect warning against invalid `/*jsl:fallthru*/` comment. +* Fix undeclared identifiers in `with` statements. + +_Update:_ Corrected post title. Property changes on: trunk/www/news/022 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/023 =================================================================== --- trunk/www/news/023 (rev 0) +++ trunk/www/news/023 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,11 @@ +<!-- +@template=__template__ +@title=News +--> + +## [IDE Integration](http://www.javascriptlint.com/news/023) +_Sat, 29 Sep 2007 22:08:21 +0000_ + +The [documentation page](http://www.javascriptlint.com/docs/running_from_your_ide.htm) now contains instructions for integrating JavaScript Lint with TextMate, vim, and emacs. + +Improvements to the documentation are welcome. Property changes on: trunk/www/news/023 ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/www/news/index.htm =================================================================== --- trunk/www/news/index.htm (rev 0) +++ trunk/www/news/index.htm 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,31 @@ +<!-- +@template=__template__ +@title=News +--> + +Project News +============ + +<!--@include 022--> +<!--@include 021--> +<!--@include 020--> +<!--@include 019--> +<!--@include 018--> +<!--@include 017--> +<!--@include 016--> +<!--@include 015--> +<!--@include 014--> +<!--@include 013--> +<!--@include 012--> +<!--@include 011--> +<!--@include 010--> +<!--@include 009--> +<!--@include 008--> +<!--@include 007--> +<!--@include 006--> +<!--@include 005--> +<!--@include 004--> +<!--@include 003--> +<!--@include 002--> +<!--@include 001--> + Property changes on: trunk/www/news/index.htm ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/www/news.php =================================================================== --- trunk/www/news.php 2009-10-07 18:44:42 UTC (rev 266) +++ trunk/www/news.php 2009-10-07 19:32:04 UTC (rev 267) @@ -1,247 +1,3 @@ -<!-- -@template=__template__ -@title=News ---> - -Project News -============ - -## [IDE Integration](http://www.javascriptlint.com/news.php?id=23) -_Sat, 29 Sep 2007 22:08:21 +0000_ - -The [documentation page](http://www.javascriptlint.com/docs/running_from_your_ide.htm) now contains instructions for integrating JavaScript Lint with TextMate, vim, and emacs. - -Improvements to the documentation are welcome. - - -## [JavaScript Lint 0.3.0 Released](http://www.javascriptlint.com/news.php?id=22) -_Fri, 03 Nov 2006 20:32:42 +0000_ - -This version has also been released for Intel Macs. - -__Enhancements:__ - -* Add support for JScript's function extensions, such as `function window.onload() {}` and `function window::onload()`. (This is disabled by default.) -* Add a `/*jsl:pass*/` control comment to suppress warnings about empty statementss. -* Add a `/*jsl:declare*/` control comment to suppress warnings about undeclared identifiers. -* Warn against trailing comments in array initializers. -* Warn against assignments to function calls (for example, `alert() = 10`). -* Warn against calls to `parseInt` without a radix parameter. -* Warn against implicit type conversion when comparing against `true` or `false`. -* Clarify the warning against `with` statements. - -__Bug Fixes:__ - -* Fix syntax error on nested comments. -* Fix duplicate case warning. -* Fix insuppressible increment/decrement warning. -* Fix incorrect warning against invalid `/*jsl:fallthru*/` comment. -* Fix undeclared identifiers in `with` statements. - -_Update:_ Corrected post title. - - -## [JavaScript Lint SourceForge Project](http://www.javascriptlint.com/news.php?id=21) -_Fri, 26 May 2006 05:15:10 +0000_ - -JavaScript Lint now has its own [SourceForge project](http://sourceforge.net/projects/javascriptlint) with [discussion forums](http://sourceforge.net/forum/?group_id=168518), [bug/feature trackers](http://sourceforge.net/tracker/?group_id=168518), and a publicly-available [Subversion repository](http://sourceforge.net/svn/?group_id=168518). - - -## [JavaScript Lint 0.2.6 Released](http://www.javascriptlint.com/news.php?id=20) -_Sat, 29 Apr 2006 15:07:13 +0000_ - -JavaScript Lint now has a `/*jsl:ignoreall*\` keyword to allow entire files to easily be ignored. Additionally, it no longer complains about blank JavaScript files. - -Available from the [download page](http://www.javascriptlint.com/download.htm). - - -## [JavaScript Lint 0.2.5 Released](http://www.javascriptlint.com/news.php?id=19) -_Sat, 08 Apr 2006 04:29:38 +0000_ - -To facilitate integration into other applications, the output format can now be passed on the command line and the results can be encoded. The source package contains source files that can be used to easily [integrate JavaScript Lint into a Windows program](http://www.javascriptlint.com/docs/running_from_your_windows_program.htm). - -The [documentation](http://www.javascriptlint.com/docs/) on the website has been updated. - -The "Unicode (UTF-8 with signature) - Codepage 65001" encoding is now supported for configuration files. - -Available from the [download page](http://www.javascriptlint.com/download.htm). - - -## [JavaScript Lint 0.2.4 Released](http://www.javascriptlint.com/news.php?id=18) -_Sat, 11 Mar 2006 02:55:51 +0000_ - -JavaScript within HTML files can now contain `</script>` in string literals and comments. - -When referencing an external script, the _script_ start and end tags no longer need to be on the same line. - -JavaScript files using "Unicode (UTF-8 with signature) - Codepage 65001" encoding, such as those created in Microsoft Visual Studio, no longer generate errors. - -Available from the [download page](http://www.javascriptlint.com/download.htm). - - -## [JavaScript Lint 0.2.3 Released](http://www.javascriptlint.com/news.php?id=17) -_Thu, 16 Feb 2006 01:11:07 +0000_ - -Syntax errors in imported scripts were not being reported. -Available from the [download page](http://www.javascriptlint.com/download.htm). - - -## [JavaScript Lint 0.2.2 Released](http://www.javascriptlint.com/news.php?id=16) -_Tue, 24 Jan 2006 14:16:24 +0000_ - -This release includes a __FILENAME__ keyword for the output format. - -Available from the [download page](http://www.javascriptlint.com/download.htm). - - -## [JavaScript Lint 0.2.1 Released](http://www.javascriptlint.com/news.php?id=15) -_Mon, 09 Jan 2006 14:18:24 +0000_ - -This release includes a configuration setting to completely disable legacy control comments. - -Available from the [download page](http://www.javascriptlint.com/download.htm). - - -## [JavaScript Lint 0.2.0 Released](http://www.javascriptlint.com/news.php?id=14) -_Wed, 04 Jan 2006 02:20:01 +0000_ - -This release includes cumulative changes through version 0.1m. - -This release has a command-line parameter to disable the file listing in the output. - -Available from the [download page](http://www.javascriptlint.com/download.htm). - - -## [JavaScript Lint 0.1m Released](http://www.javascriptlint.com/news.php?id=13) -_Tue, 03 Jan 2006 17:31:25 +0000_ - -This release fixes a bug with the "undeclared identifier" warnings when using the import control comment. - -Available from the [download page](http://www.javascriptlint.com/download.htm). - - -## [JavaScript Lint 0.1l Released](http://www.javascriptlint.com/news.php?id=12) -_Mon, 02 Jan 2006 22:05:25 +0000_ - -This release includes a new warning for useless comparisons (for example, x == x). - -This release also improves the use of the _fallthru_ control comment when used in the final case in a switch statement. The "undeclared identifier" fix in the 0.1k release is now applied to both global and local variables declarations. - -Available from the [download page](http://www.javascriptlint.com/download.htm). - - -## [JavaScript Lint 0.1k Released](http://www.javascriptlint.com/news.php?id=11) -_Sat, 24 Dec 2005 18:56:35 +0000_ - -This release includes a number changes. - -__Enhancements:__ - -* JavaScript Lint warns if the default case is not at the end of the switch statement. - -* Control comments can now use the `/*jsl:keyword*/` syntax in addition to the `/*@keyword@*/` syntax. The new syntax is recommended for interoperability with JScript conditional compilation, although the traditional syntax is still supported. - -* The "missing break" warning can be disabled for the last case in a switch statement. The presence of this _break_ is merely stylistic preference. - -* The "missing semicolon" warning can be disabled when anonymous functions are assigned to variables and properties (such as function prototypes). Code such as the following can optionally be allowed: - -> - function Coord() { - this.x = function() { - return 1; - } - } - Coord.prototype.y = function() { - return 0; - } - -__Bug Fixes:__ - -* The "undeclared identifier" warning for variables has been updated to reflect the ECMA specification. The following code no longer issues a warning: - > - function getX() { return x; } - var x; - -* Scripts with circular _import_ directives no longer incorrectly report undeclared identifiers. - -Available from the [download page](http://www.javascriptlint.com/download.htm). - - -## [JavaScript Lint 0.1j Released](http://www.javascriptlint.com/news.php?id=10) -_Mon, 05 Dec 2005 20:19:35 +0000_ - -This release fixes a bug in the "duplicate case" warning for numbers. Certain numbers were incorrectly reported as duplicates. (This bug is more likely to affect JavaScript programmers using big-endian processors.) - -The [Online Lint](http://www.javascriptlint.com/online_lint.php) has also been updated to use a local CGI, making the script much more responsive. PHP source code for the Online Lint is included in the source package. - -Available from the [download page](http://www.javascriptlint.com/download.htm). - - -## [JavaScript Lint 0.1i Released](http://www.javascriptlint.com/news.php?id=9) -_Wed, 16 Nov 2005 14:28:54 +0000_ - -This release has a more specific warning for _else_ statements that may be intended for one of multiple _if_ statements (it previously warned that nested statements should use curly braces to resolve ambiguity): - -> - `if (i)` - `if (j) func1();` - `else func2();` - -The warning against duplicate case statements now correctly handles case statements with string literals. - -This release fixes a bug that caused a "Bus error" on Mac OS X and a segmentation fault on Solaris 5.9; JavaScript Lint has now been compiled and run on those operating systems. If Mac users are interested in precompiled binaries, I will consider making them available for download on the website. - -Available from the [download page](http://www.javascriptlint.com/download.htm). - - -## [JavaScript Lint 0.1h Released](http://www.javascriptlint.com/news.php?id=8) -_Tue, 25 Oct 2005 19:16:04 +0000_ - -This release upgrades the SpiderMonkey JavaScript engine from a release candidate to the latest stable branch (version 1.5). -Available from the [download page](http://www.javascriptlint.com/download.htm). - - -## [JavaScript Lint 0.1g Released](http://www.javascriptlint.com/news.php?id=7) -_Sat, 08 Oct 2005 16:37:29 +0000_ - -This release includes a warning if the default case is missing from switch, a warning if a case is duplicated within a switch, better intelligence when checking for missing break statements, and a `/*@fallthru*@/` control comment (must always come at the very end of a case). - -Available from the [download page](http://www.javascriptlint.com/download.htm). - - -## [JavaScript Lint Source Package Available](http://www.javascriptlint.com/news.php?id=6) -_Sat, 01 Oct 2005 17:06:22 +0000_ - -JavaScript Lint source is now [available for download](http://www.javascriptlint.com/download.htm) as a single package. - - -## [JavaScript Lint 0.1f Released](http://www.javascriptlint.com/download.htm) -_Sat, 10 Sep 2005 14:59:43 +0000_ - -This release adds a separate warning for nested statements that don't use curly braces (nested _if_, _for_, _while_, etc.), a warning for useless assignments (x = x), and a configuration option to enable option-explicit across all files. - - -## [JavaScript Lint 0.1e Released](http://www.javascriptlint.com/download.htm) -_Tue, 31 Aug 2005 02:40:49 +0000_ - -This release fixes a crash triggered by the following statement: _for(i = 0; i < 5; )_. (The Linux binary is not currently available for this release.) - - -## [JavaScript Lint 0.1d Released](http://www.javascriptlint.com/download.htm) -_Tue, 30 Aug 2005 22:28:35 +0000_ - -This release fixes a crash caused by an incorrectly formed control comment. - - -## [JavaScript Lint 0.1c Released](http://www.javascriptlint.com/download.htm) -_Tue, 30 Aug 2005 18:54:06 +0000_ - -This release corrects problems with the wildcard feature. - - -## [JavaScript Lint 0.1b Released](http://www.javascriptlint.com/download.htm) -_Tue, 30 Aug 2005 15:37:08 +0000_ - -This release fixes a crash caused by certain syntax errors. For example: _if (a !=== b)_. - - +<?php +// ?: Header("Location: /news/" . str_pad(int($_GET['id']), 3, "0")); +?> Added: trunk/www/news.rss =================================================================== --- trunk/www/news.rss (rev 0) +++ trunk/www/news.rss 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,8 @@ +<!-- +@output=rss +@title=JavaScript Lint Project News +@link=http://www.javascriptlint.com/ +@desc=JavaScript Lint Project News +--> + +<!--@include /news/--> Property changes on: trunk/www/news.rss ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/www/rss.php =================================================================== --- trunk/www/rss.php 2009-10-07 18:44:42 UTC (rev 266) +++ trunk/www/rss.php 2009-10-07 19:32:04 UTC (rev 267) @@ -0,0 +1,3 @@ +<?php +// Header('Location: /news.rss'); +?> Modified: trunk/www.py =================================================================== --- trunk/www.py 2009-10-07 18:44:42 UTC (rev 266) +++ trunk/www.py 2009-10-07 19:32:04 UTC (rev 267) @@ -1,6 +1,7 @@ #!/usr/bin/python # vim: ts=4 sw=4 expandtab import BaseHTTPServer +import md5 import re import os import sys @@ -15,30 +16,169 @@ ('/download.htm', 'Download'), ('/online_lint.php', 'The Online Lint'), ('/docs/', 'Documentation'), - ('/news.php', 'News'), + ('/news/', 'News'), ('/contact_support.htm', 'Contact'), ] -def _resolve_url(url): +def _markdown2doc(source): + class _PostProcessor(markdown.Postprocessor): + def run(self, doc): + self.doc = doc + return doc + postprocessor = _PostProcessor() + md = markdown.Markdown() + md.postprocessors.append(postprocessor) + md.convert(source) + return postprocessor.doc + +def _resolve_url(url, parentpath): + root = DOC_ROOT + if not url.startswith('/'): + if parentpath: + root = os.path.dirname(parentpath) + assert (root + os.sep).startswith(DOC_ROOT + os.sep) + else: + raise ValueError, 'Tried resolving relative URL: %s' % url + urls = [ url.rstrip('/') + '/index.htm', url ] for url in urls: - path = os.path.join(DOC_ROOT, url.lstrip('/')) - if path.startswith(DOC_ROOT + os.sep) and os.path.isfile(path): + path = os.path.join(root, url.lstrip('/')) + if path.startswith(root + os.sep) and os.path.isfile(path): return path def _get_nav(path): nav = [] for url, name in NAV: - navpath = _resolve_url(url) + navpath = _resolve_url(url, None) if navpath and navpath == path: nav.append('* <a class="active">%s</a>' % name) else: nav.append('* [%s](%s)' % (name, url)) return markdown.markdown('\n'.join(nav)) +def _remove_comments(source): + return re.sub('<!--[^>]*-->', '', source) + +def _gen_rss(source, title, link, desc): + def removeblanktextnodes(node): + for i in range(len(node.childNodes)-1, -1, -1): + child = node.childNodes[i] + if child.type == 'text': + if not child.value: + node.removeChild(child) + else: + removeblanktextnodes(child) + text = _remove_comments(source) + doc = _markdown2doc(text) + + oldDocElement = doc.documentElement + removeblanktextnodes(oldDocElement) + + rss = doc.createElement("rss") + rss.setAttribute('version', '2.0') + doc.appendChild(rss) + + channel = doc.createElement("channel") + rss.appendChild(channel) + if not title: + raise ValueError, 'Missing @title= setting.' + if not link: + raise ValueError, 'Missing @link= setting.' + if not desc: + raise ValueError, 'Missing @desc= setting.' + channel.appendChild(doc.createElement('title', textNode=title)) + channel.appendChild(doc.createElement('link', textNode=link)) + channel.appendChild(doc.createElement('desc', textNode=desc)) + + guids = [] + + item = None + item_desc = None + + for child in oldDocElement.childNodes: + if child.type != "element": + if child.value.strip(): + raise ValueError, 'Expected outer-level element, not text.' + continue + + if child.nodeName == 'h1': + pass + elif child.nodeName == "h2": + link = len(child.childNodes) == 1 and child.childNodes[0] + if not link or link.type != 'element' or link.nodeName != 'a': + raise ValueError, 'Each heading must be a link.' + + titlenode = len(link.childNodes) == 1 and link.childNodes[0] + if not titlenode or titlenode.type != 'text': + raise ValueError, 'Each heading link must contain a ' + \ + 'single text node.' + heading = titlenode.value.strip() + + assert 'href' in link.attributes + href = link.attribute_values['href'] + + if href in guids: + raise ValueError, "Duplicate link: %s" % href + guids.append(href) + + item = doc.createElement("item") + channel.appendChild(item) + item.appendChild(doc.createElement("link", href)) + item.appendChild(doc.createElement("title", heading)) + item.appendChild(doc.createElement("guid", guid)) + item_desc = None + + elif child.nodeName in ["p", "ul", "blockquote"] : + if not item_desc: + # The first paragraph is <p><em>pubDate</em></p> + em = len(child.childNodes) == 1 and child.childNodes[0] + if not em or em.type != 'element' or em.nodeName != 'em': + raise ValueError, 'The first paragraph must contain ' + \ + 'only an <em>.' + + emchild = len(em.childNodes) == 1 and em.childNodes[0] + if not emchild or emchild.type != 'text': + raise ValueError, "The first paragraph's em must " + \ + "contain only text." + + # TODO: Validate canonical date format. + + item.appendChild(doc.createElement('pubDate', emchild.value)) + item_desc = doc.createElement("description") + item.appendChild(item_desc) + else: + cdata = doc.createCDATA(child.toxml()) + item_desc.appendChild(cdata) + + else: + raise ValueError, 'Unsupported node type: %s' % child.nodeName + return doc.toxml() + +def _preprocess(path): + def _include(match): + # When including a file, update global settings and replace + # with contents. + includepath = _resolve_url(match.group(1).strip(), path) + if not includepath: + raise ValueError, 'Unmatched URL: %s' % match.group(1) + settings, contents = _preprocess(includepath) + childsettings.update(settings) + return contents + + source = open(path).read() + + # Process includes. + childsettings = {} + source = re.sub('<!--@include ([^>]*)-->', _include, source) + + # The settings defined in the outer file will rule. + settings = dict(re.findall(r'^@(\w+)=(.*)$', source, re.MULTILINE)) + source = _remove_comments(source) + return settings, source + def _transform_file(path): source = open(path).read() if path.endswith('.css'): @@ -47,9 +187,14 @@ return 'image/gif', source elif path.endswith('.png'): return 'image/png', source - elif path.endswith('.htm') or path.endswith('.php'): - settings = dict(re.findall(r'^@(\w+)=(.*)$', source, re.MULTILINE)) - + elif path.endswith('.rss'): + settings, source = _preprocess(path) + return 'text/xml', _gen_rss(source, settings.get('title'), + settings.get('link'), + settings.get('desc')) + elif path.endswith('.htm') or path.endswith('.php') or \ + not '.' in os.path.basename(path): + settings, source = _preprocess(path) page = markdown.markdown(source) if 'template' in settings: # TODO: encode keywords @@ -65,7 +210,7 @@ class _Handler(BaseHTTPServer.BaseHTTPRequestHandler): def do_GET(self): - path = _resolve_url(self.path) + path = _resolve_url(self.path, None) if path: try: self._send_response(*_transform_file(path)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-07 18:44:53
|
Revision: 266 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=266&view=rev Author: matthiasmiller Date: 2009-10-07 18:44:42 +0000 (Wed, 07 Oct 2009) Log Message: ----------- www: add sourceforge icon Modified Paths: -------------- trunk/www/__template__ Modified: trunk/www/__template__ =================================================================== --- trunk/www/__template__ 2009-10-06 20:27:02 UTC (rev 265) +++ trunk/www/__template__ 2009-10-07 18:44:42 UTC (rev 266) @@ -9,8 +9,14 @@ </div> <div id="nav"> %(nav)s - <p align="center"><a href="/rss.php"> + + <p align="center"><br/><a href="/rss.php"> <img border="0" src="/static/feed-icon-32x32.png" width="32" height="32"></a></p> + + <p align="center"><br/><a href="http://sourceforge.net/projects/javascriptlint"> + <img src="http://sflogo.sourceforge.net/sflogo.php?group_id=168518&type=1" + width="88" height="31" border="0" alt="SourceForge.net Logo"><br> + <font size="1">SourceForge Project</font></a></p> </div> <div id="body"> %(body)s This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-06 20:27:13
|
Revision: 265 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=265&view=rev Author: matthiasmiller Date: 2009-10-06 20:27:02 +0000 (Tue, 06 Oct 2009) Log Message: ----------- www: uploading raw news data; need RSS integration Modified Paths: -------------- trunk/www/news.php Modified: trunk/www/news.php =================================================================== --- trunk/www/news.php 2009-10-06 17:02:05 UTC (rev 264) +++ trunk/www/news.php 2009-10-06 20:27:02 UTC (rev 265) @@ -1,7 +1,247 @@ <!-- @template=__template__ -@title=Contact +@title=News --> -News -======= +Project News +============ + +## [IDE Integration](http://www.javascriptlint.com/news.php?id=23) +_Sat, 29 Sep 2007 22:08:21 +0000_ + +The [documentation page](http://www.javascriptlint.com/docs/running_from_your_ide.htm) now contains instructions for integrating JavaScript Lint with TextMate, vim, and emacs. + +Improvements to the documentation are welcome. + + +## [JavaScript Lint 0.3.0 Released](http://www.javascriptlint.com/news.php?id=22) +_Fri, 03 Nov 2006 20:32:42 +0000_ + +This version has also been released for Intel Macs. + +__Enhancements:__ + +* Add support for JScript's function extensions, such as `function window.onload() {}` and `function window::onload()`. (This is disabled by default.) +* Add a `/*jsl:pass*/` control comment to suppress warnings about empty statementss. +* Add a `/*jsl:declare*/` control comment to suppress warnings about undeclared identifiers. +* Warn against trailing comments in array initializers. +* Warn against assignments to function calls (for example, `alert() = 10`). +* Warn against calls to `parseInt` without a radix parameter. +* Warn against implicit type conversion when comparing against `true` or `false`. +* Clarify the warning against `with` statements. + +__Bug Fixes:__ + +* Fix syntax error on nested comments. +* Fix duplicate case warning. +* Fix insuppressible increment/decrement warning. +* Fix incorrect warning against invalid `/*jsl:fallthru*/` comment. +* Fix undeclared identifiers in `with` statements. + +_Update:_ Corrected post title. + + +## [JavaScript Lint SourceForge Project](http://www.javascriptlint.com/news.php?id=21) +_Fri, 26 May 2006 05:15:10 +0000_ + +JavaScript Lint now has its own [SourceForge project](http://sourceforge.net/projects/javascriptlint) with [discussion forums](http://sourceforge.net/forum/?group_id=168518), [bug/feature trackers](http://sourceforge.net/tracker/?group_id=168518), and a publicly-available [Subversion repository](http://sourceforge.net/svn/?group_id=168518). + + +## [JavaScript Lint 0.2.6 Released](http://www.javascriptlint.com/news.php?id=20) +_Sat, 29 Apr 2006 15:07:13 +0000_ + +JavaScript Lint now has a `/*jsl:ignoreall*\` keyword to allow entire files to easily be ignored. Additionally, it no longer complains about blank JavaScript files. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + +## [JavaScript Lint 0.2.5 Released](http://www.javascriptlint.com/news.php?id=19) +_Sat, 08 Apr 2006 04:29:38 +0000_ + +To facilitate integration into other applications, the output format can now be passed on the command line and the results can be encoded. The source package contains source files that can be used to easily [integrate JavaScript Lint into a Windows program](http://www.javascriptlint.com/docs/running_from_your_windows_program.htm). + +The [documentation](http://www.javascriptlint.com/docs/) on the website has been updated. + +The "Unicode (UTF-8 with signature) - Codepage 65001" encoding is now supported for configuration files. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + +## [JavaScript Lint 0.2.4 Released](http://www.javascriptlint.com/news.php?id=18) +_Sat, 11 Mar 2006 02:55:51 +0000_ + +JavaScript within HTML files can now contain `</script>` in string literals and comments. + +When referencing an external script, the _script_ start and end tags no longer need to be on the same line. + +JavaScript files using "Unicode (UTF-8 with signature) - Codepage 65001" encoding, such as those created in Microsoft Visual Studio, no longer generate errors. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + +## [JavaScript Lint 0.2.3 Released](http://www.javascriptlint.com/news.php?id=17) +_Thu, 16 Feb 2006 01:11:07 +0000_ + +Syntax errors in imported scripts were not being reported. +Available from the [download page](http://www.javascriptlint.com/download.htm). + + +## [JavaScript Lint 0.2.2 Released](http://www.javascriptlint.com/news.php?id=16) +_Tue, 24 Jan 2006 14:16:24 +0000_ + +This release includes a __FILENAME__ keyword for the output format. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + +## [JavaScript Lint 0.2.1 Released](http://www.javascriptlint.com/news.php?id=15) +_Mon, 09 Jan 2006 14:18:24 +0000_ + +This release includes a configuration setting to completely disable legacy control comments. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + +## [JavaScript Lint 0.2.0 Released](http://www.javascriptlint.com/news.php?id=14) +_Wed, 04 Jan 2006 02:20:01 +0000_ + +This release includes cumulative changes through version 0.1m. + +This release has a command-line parameter to disable the file listing in the output. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + +## [JavaScript Lint 0.1m Released](http://www.javascriptlint.com/news.php?id=13) +_Tue, 03 Jan 2006 17:31:25 +0000_ + +This release fixes a bug with the "undeclared identifier" warnings when using the import control comment. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + +## [JavaScript Lint 0.1l Released](http://www.javascriptlint.com/news.php?id=12) +_Mon, 02 Jan 2006 22:05:25 +0000_ + +This release includes a new warning for useless comparisons (for example, x == x). + +This release also improves the use of the _fallthru_ control comment when used in the final case in a switch statement. The "undeclared identifier" fix in the 0.1k release is now applied to both global and local variables declarations. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + +## [JavaScript Lint 0.1k Released](http://www.javascriptlint.com/news.php?id=11) +_Sat, 24 Dec 2005 18:56:35 +0000_ + +This release includes a number changes. + +__Enhancements:__ + +* JavaScript Lint warns if the default case is not at the end of the switch statement. + +* Control comments can now use the `/*jsl:keyword*/` syntax in addition to the `/*@keyword@*/` syntax. The new syntax is recommended for interoperability with JScript conditional compilation, although the traditional syntax is still supported. + +* The "missing break" warning can be disabled for the last case in a switch statement. The presence of this _break_ is merely stylistic preference. + +* The "missing semicolon" warning can be disabled when anonymous functions are assigned to variables and properties (such as function prototypes). Code such as the following can optionally be allowed: + +> + function Coord() { + this.x = function() { + return 1; + } + } + Coord.prototype.y = function() { + return 0; + } + +__Bug Fixes:__ + +* The "undeclared identifier" warning for variables has been updated to reflect the ECMA specification. The following code no longer issues a warning: + > + function getX() { return x; } + var x; + +* Scripts with circular _import_ directives no longer incorrectly report undeclared identifiers. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + +## [JavaScript Lint 0.1j Released](http://www.javascriptlint.com/news.php?id=10) +_Mon, 05 Dec 2005 20:19:35 +0000_ + +This release fixes a bug in the "duplicate case" warning for numbers. Certain numbers were incorrectly reported as duplicates. (This bug is more likely to affect JavaScript programmers using big-endian processors.) + +The [Online Lint](http://www.javascriptlint.com/online_lint.php) has also been updated to use a local CGI, making the script much more responsive. PHP source code for the Online Lint is included in the source package. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + +## [JavaScript Lint 0.1i Released](http://www.javascriptlint.com/news.php?id=9) +_Wed, 16 Nov 2005 14:28:54 +0000_ + +This release has a more specific warning for _else_ statements that may be intended for one of multiple _if_ statements (it previously warned that nested statements should use curly braces to resolve ambiguity): + +> + `if (i)` + `if (j) func1();` + `else func2();` + +The warning against duplicate case statements now correctly handles case statements with string literals. + +This release fixes a bug that caused a "Bus error" on Mac OS X and a segmentation fault on Solaris 5.9; JavaScript Lint has now been compiled and run on those operating systems. If Mac users are interested in precompiled binaries, I will consider making them available for download on the website. + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + +## [JavaScript Lint 0.1h Released](http://www.javascriptlint.com/news.php?id=8) +_Tue, 25 Oct 2005 19:16:04 +0000_ + +This release upgrades the SpiderMonkey JavaScript engine from a release candidate to the latest stable branch (version 1.5). +Available from the [download page](http://www.javascriptlint.com/download.htm). + + +## [JavaScript Lint 0.1g Released](http://www.javascriptlint.com/news.php?id=7) +_Sat, 08 Oct 2005 16:37:29 +0000_ + +This release includes a warning if the default case is missing from switch, a warning if a case is duplicated within a switch, better intelligence when checking for missing break statements, and a `/*@fallthru*@/` control comment (must always come at the very end of a case). + +Available from the [download page](http://www.javascriptlint.com/download.htm). + + +## [JavaScript Lint Source Package Available](http://www.javascriptlint.com/news.php?id=6) +_Sat, 01 Oct 2005 17:06:22 +0000_ + +JavaScript Lint source is now [available for download](http://www.javascriptlint.com/download.htm) as a single package. + + +## [JavaScript Lint 0.1f Released](http://www.javascriptlint.com/download.htm) +_Sat, 10 Sep 2005 14:59:43 +0000_ + +This release adds a separate warning for nested statements that don't use curly braces (nested _if_, _for_, _while_, etc.), a warning for useless assignments (x = x), and a configuration option to enable option-explicit across all files. + + +## [JavaScript Lint 0.1e Released](http://www.javascriptlint.com/download.htm) +_Tue, 31 Aug 2005 02:40:49 +0000_ + +This release fixes a crash triggered by the following statement: _for(i = 0; i < 5; )_. (The Linux binary is not currently available for this release.) + + +## [JavaScript Lint 0.1d Released](http://www.javascriptlint.com/download.htm) +_Tue, 30 Aug 2005 22:28:35 +0000_ + +This release fixes a crash caused by an incorrectly formed control comment. + + +## [JavaScript Lint 0.1c Released](http://www.javascriptlint.com/download.htm) +_Tue, 30 Aug 2005 18:54:06 +0000_ + +This release corrects problems with the wildcard feature. + + +## [JavaScript Lint 0.1b Released](http://www.javascriptlint.com/download.htm) +_Tue, 30 Aug 2005 15:37:08 +0000_ + +This release fixes a crash caused by certain syntax errors. For example: _if (a !=== b)_. + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-06 17:02:14
|
Revision: 264 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=264&view=rev Author: matthiasmiller Date: 2009-10-06 17:02:05 +0000 (Tue, 06 Oct 2009) Log Message: ----------- www: change template path to be specified in each file Modified Paths: -------------- trunk/www/contact_support.htm trunk/www/docs/index.htm trunk/www/docs/running_from_the_command_line.htm trunk/www/docs/running_from_windows_explorer.htm trunk/www/docs/running_from_your_ide.htm trunk/www/docs/running_from_your_php_website.htm trunk/www/docs/running_from_your_windows_program.htm trunk/www/download.htm trunk/www/index.htm trunk/www/news.php trunk/www/online_lint.php trunk/www.py Modified: trunk/www/contact_support.htm =================================================================== --- trunk/www/contact_support.htm 2009-10-06 16:54:26 UTC (rev 263) +++ trunk/www/contact_support.htm 2009-10-06 17:02:05 UTC (rev 264) @@ -1,4 +1,5 @@ <!-- +@template=__template__ @title=Contact --> Modified: trunk/www/docs/index.htm =================================================================== --- trunk/www/docs/index.htm 2009-10-06 16:54:26 UTC (rev 263) +++ trunk/www/docs/index.htm 2009-10-06 17:02:05 UTC (rev 264) @@ -1,4 +1,5 @@ <!-- +@template=__template__ @title=Documentation --> Modified: trunk/www/docs/running_from_the_command_line.htm =================================================================== --- trunk/www/docs/running_from_the_command_line.htm 2009-10-06 16:54:26 UTC (rev 263) +++ trunk/www/docs/running_from_the_command_line.htm 2009-10-06 17:02:05 UTC (rev 264) @@ -1,4 +1,5 @@ <!-- +@template=__template__ @title=Running from the Command Line --> Modified: trunk/www/docs/running_from_windows_explorer.htm =================================================================== --- trunk/www/docs/running_from_windows_explorer.htm 2009-10-06 16:54:26 UTC (rev 263) +++ trunk/www/docs/running_from_windows_explorer.htm 2009-10-06 17:02:05 UTC (rev 264) @@ -1,4 +1,5 @@ <!-- +@template=__template__ @title=Running from Windows Explorer --> Modified: trunk/www/docs/running_from_your_ide.htm =================================================================== --- trunk/www/docs/running_from_your_ide.htm 2009-10-06 16:54:26 UTC (rev 263) +++ trunk/www/docs/running_from_your_ide.htm 2009-10-06 17:02:05 UTC (rev 264) @@ -1,4 +1,5 @@ <!-- +@template=__template__ @title=Running from your IDE --> Modified: trunk/www/docs/running_from_your_php_website.htm =================================================================== --- trunk/www/docs/running_from_your_php_website.htm 2009-10-06 16:54:26 UTC (rev 263) +++ trunk/www/docs/running_from_your_php_website.htm 2009-10-06 17:02:05 UTC (rev 264) @@ -1,4 +1,5 @@ <!-- +@template=__template__ @title=Running from Your PHP Website --> Modified: trunk/www/docs/running_from_your_windows_program.htm =================================================================== --- trunk/www/docs/running_from_your_windows_program.htm 2009-10-06 16:54:26 UTC (rev 263) +++ trunk/www/docs/running_from_your_windows_program.htm 2009-10-06 17:02:05 UTC (rev 264) @@ -1,4 +1,5 @@ <!-- +@template=__template__ @title=Running from Your Windows Program --> Modified: trunk/www/download.htm =================================================================== --- trunk/www/download.htm 2009-10-06 16:54:26 UTC (rev 263) +++ trunk/www/download.htm 2009-10-06 17:02:05 UTC (rev 264) @@ -1,4 +1,5 @@ <!-- +@template=__template__ @title=Download --> Modified: trunk/www/index.htm =================================================================== --- trunk/www/index.htm 2009-10-06 16:54:26 UTC (rev 263) +++ trunk/www/index.htm 2009-10-06 17:02:05 UTC (rev 264) @@ -1,4 +1,5 @@ <!-- +@template=__template__ @title=JavaScript Lint --> Modified: trunk/www/news.php =================================================================== --- trunk/www/news.php 2009-10-06 16:54:26 UTC (rev 263) +++ trunk/www/news.php 2009-10-06 17:02:05 UTC (rev 264) @@ -1,4 +1,5 @@ <!-- +@template=__template__ @title=Contact --> Modified: trunk/www/online_lint.php =================================================================== --- trunk/www/online_lint.php 2009-10-06 16:54:26 UTC (rev 263) +++ trunk/www/online_lint.php 2009-10-06 17:02:05 UTC (rev 264) @@ -1,4 +1,5 @@ <!-- +@template=__template__ @title=The Online Lint --> Modified: trunk/www.py =================================================================== --- trunk/www.py 2009-10-06 16:54:26 UTC (rev 263) +++ trunk/www.py 2009-10-06 17:02:05 UTC (rev 264) @@ -48,13 +48,17 @@ elif path.endswith('.png'): return 'image/png', source elif path.endswith('.htm') or path.endswith('.php'): - body = markdown.markdown(source) - keywords = re.findall(r'^@(\w+)=(.*)$', source, re.MULTILINE) - # TODO: encode - keywords = dict(keywords) - keywords['body'] = body - keywords['nav'] = _get_nav(path) - page = open(TEMPLATE_PATH).read() % keywords + settings = dict(re.findall(r'^@(\w+)=(.*)$', source, re.MULTILINE)) + + page = markdown.markdown(source) + if 'template' in settings: + # TODO: encode keywords + keywords = dict(settings) + del keywords['template'] + keywords['body'] = page + keywords['nav'] = _get_nav(path) + template_path = os.path.join(DOC_ROOT, settings['template']) + page = open(template_path).read() % keywords return 'text/html', page else: raise ValueError, 'Invalid file type: %s' % path This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2009-10-06 16:54:39
|
Revision: 263 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=263&view=rev Author: matthiasmiller Date: 2009-10-06 16:54:26 +0000 (Tue, 06 Oct 2009) Log Message: ----------- www: bring in more of the website Modified Paths: -------------- trunk/www/__template__ trunk/www/docs/running_from_the_command_line.htm trunk/www/docs/running_from_windows_explorer.htm trunk/www/docs/running_from_your_ide.htm trunk/www/docs/running_from_your_php_website.htm trunk/www/docs/running_from_your_windows_program.htm trunk/www.py Added Paths: ----------- trunk/www/contact_support.htm trunk/www/news.php trunk/www/rss.php Modified: trunk/www/__template__ =================================================================== --- trunk/www/__template__ 2009-10-06 16:05:47 UTC (rev 262) +++ trunk/www/__template__ 2009-10-06 16:54:26 UTC (rev 263) @@ -9,7 +9,7 @@ </div> <div id="nav"> %(nav)s - <p align="center"><a href="rss.php"> + <p align="center"><a href="/rss.php"> <img border="0" src="/static/feed-icon-32x32.png" width="32" height="32"></a></p> </div> <div id="body"> Added: trunk/www/contact_support.htm =================================================================== --- trunk/www/contact_support.htm (rev 0) +++ trunk/www/contact_support.htm 2009-10-06 16:54:26 UTC (rev 263) @@ -0,0 +1,9 @@ +<!-- +@title=Contact +--> + +Contact +======= + +If you have a bug report, feature request, support question, please visit the project [forum](http://sourceforge.net/forum/?group_id=168518) and [tracker](http://sourceforge.net/tracker/?group_id=168518) or send an e-mail to Matthias Miller at Info\<at\>JavaScriptLint.com. + Property changes on: trunk/www/contact_support.htm ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/www/docs/running_from_the_command_line.htm =================================================================== --- trunk/www/docs/running_from_the_command_line.htm 2009-10-06 16:05:47 UTC (rev 262) +++ trunk/www/docs/running_from_the_command_line.htm 2009-10-06 16:54:26 UTC (rev 263) @@ -0,0 +1,14 @@ +<!-- +@title=Running from the Command Line +--> + +Running from the Command Line +============================= + +Running JavaScript Lint from the command line allows integration with build and source control systems. It also allows batching lint jobs. + +You can run JavaScript Lint in two modes: using built-in default settings or using settings from a configuration file. For the latter, the name of the configuration file is passed on the command line. The sample configuration file (jsl.default.conf) documents how to enable or disable warnings. + +The names of the files to process can be specified on the command line, in the configuration file, or both. The sample configuration file demonstrates how to use wildcards and recursion to specify which files to lint. + +Run jsl without parameters for usage. Modified: trunk/www/docs/running_from_windows_explorer.htm =================================================================== --- trunk/www/docs/running_from_windows_explorer.htm 2009-10-06 16:05:47 UTC (rev 262) +++ trunk/www/docs/running_from_windows_explorer.htm 2009-10-06 16:54:26 UTC (rev 263) @@ -0,0 +1,14 @@ +<!-- +@title=Running from Windows Explorer +--> + +Running from Windows Explorer +============================= + +The easiest way to run JavaScript lint is by adding it to the right-click menu on .htm and .js files. To do so, open Windows Explorer and choose Tools | Folder Options | File Types. Select the .js file type. Click Advanced, then click New. Enter these settings (paths will vary): + +__Action__: Lint + +__Application used to perform action__: `c:\path\to\jsl.exe -conf c:\path\to\configuration\file -process "%1" -pauseatend` + +Repeat these steps for all the file types that you wish to lint (e.g. .htm, .hta, and .wsf). Modified: trunk/www/docs/running_from_your_ide.htm =================================================================== --- trunk/www/docs/running_from_your_ide.htm 2009-10-06 16:05:47 UTC (rev 262) +++ trunk/www/docs/running_from_your_ide.htm 2009-10-06 16:54:26 UTC (rev 263) @@ -0,0 +1,112 @@ +<!-- +@title=Running from your IDE +--> + +Running from your IDE +===================== + +Visual Studio +------------- + +> If you use Microsoft Visual Studio to edit JavaScript or HTML, you may want to integrate this tool into Visual Studio. This will let you lint the file that is currently open. You can double-click on error messages or use keyboard shortcuts to look at the line of code that triggered a warning. + +> In Visual Studio 2003/2005, go to Tools, External Tools... and create a tool with these settings: + +> > __Command__: `c:\path\to\jsl.exe` +> > __Arguments__: `-conf c:\path\to\configuration\file -process $(ItemPath)` +> > __Initial directory__: +> > [x] Use output window; [_] Prompt for arguments + +> In Visual C++ 6.0, go to Tools, Customize, Tools and create a new tool with the following settings. + +> > __Command__: `c:\path\to\jsl.exe` +> > __Arguments__: `-conf c:\path\to\configuration\file -process $(FilePath)` +> > __Initial directory__: +> > [x] Use output window; [_] Prompt for arguments + +> If you wish to disable warnings, you can simply modify configuration file that is passed through the command line. + +> You may also want to create a second tool to lint all of your JavaScript files. To do this, you can create a copy of the configuration and specify specific folders to lint. (Instructions are included in the default configuration file.) + + +TextMate +-------- + +> See [JavaScript Tools TextMate Bundle](http://www.andrewdupont.net/2006/10/01/javascript-tools-textmate-bundle/). + + +SciTE +----- + +> You can also integrate JavaScript Lint into [SciTE](http://scintilla.sourceforge.net/SciTE.html). Open `~/.SciteUser.properties` (choose Options, Open User Options File). Add the following to the following lines: + +> > `file.patterns.js=*.js;*.es` +> > `command.compile.$(file.patterns.js)=/path/to/jsl conf /path/to/configuration/file process $(FileNameExt)` + +> You will also need to change your JavaScript Lint configuration so that SciTE will correctly place a yellow dot at the beginning of the line corresponding to the current error [see screenshot](../images/jsl-SciTE-screenshot.png). Change the `output-format` setting to: + +> > `+output-format __FILE__:__LINE__: __ERROR__` + +> Like Visual Studio, you can press F4 to go to the next error. + + +vim +--- + +> See [Integrating JavaScript Lint with vim](http://blogs.linux.ie/kenguest/2007/03/18/integrating-javascript-lint-with-vim/ "Integrating JavaScript lint with vim"). + +vim (Cygwin) +------------ + +> This configuration is for vim on Cygwin. There may be some differences with vim directly on Windows. + +1. Copy jsl.exe to /usr/bin +1. Copy jsl.default.conf to /etc/jsl.conf< +1. Edit /etc/jsl.conf: + 1. Comment out the line containing "+process" + 1. Comment out the line containing "+pauseatend" + 1. Set the line containing "+context" to "-context" +1. Add one of the following configurations to vimrc: + * To process the current file: + + `autocmd FileType javascript set makeprg=jsl\ -nologo\ -nofilelisting\ -nosummary\ -nocontext\ -conf\ '/cygwin/etc/jsl.conf'\ -process\ %` + `autocmd FileType javascript set errorformat=%f(%l):\ %m^M` + + * To process ALL files in the directory instead of just the current file: + + `autocmd FileType javascript set makeprg=jsl\ -nologo\ -nofilelisting\ -nosummary\ <autocmd FileType javascript set makeprg=jsl\ -nologo\ -nofilelisting\ -nosummary\ -nocontext\ -conf\ '/cygwin/etc/jsl.conf'\ -process\ '*.js'` + `autocmd FileType javascript set errorformat=%f(%l):\ %m^M` + + * If you want to process ALL files recursively, use these lines instead: + + `autocmd FileType javascript set makeprg=jsl\ -nologo\ -nofilelisting\ -nosummary\ -nocontext\ -conf\ '/cygwin/etc/jsl.conf'\ -process\ '*.js'\ -recurse` + `autocmd FileType javascript set errorformat=%f(%l):\ %m^M` + +> _Note that ^M should be a control character! To enter it, Press {Ctrl-V}{Ctrl-M}. If this doesn't work for you, just leave out ^M. Note also that if using method 2 or 3 and vim on cygwin, you will probably get vim errors about "unable to open swap file...". I have no way around this, but if you are ok with not having a swap file in vim (no recovery on crash), then that's fine._ + +emacs +----- + +> To integrate JavaScript Lint to emacs, add the following to your emacs init file (~/.emacs). It assumes you are using a javascript-mode with a hook support. You can use [Karl Landström's mode](http://www.brgeight.se/downloads/emacs/javascript.el). + +> > + ;; javascript lint + (defun jslint-thisfile () + (interactive) + (compile (format "jsl -process %s" (buffer-file-name)))) +> > + (add-hook 'javascript-mode-hook + '(lambda () + (local-set-key [f8] 'jslint-thisfile))) + +> Just press 'F8' and it will execute JavaScript Lint in the current buffer. + +Other IDEs +---------- + +Many IDEs can launch a third-party tool and show the results in a window in the IDE. If the tool correctly formats its output, the IDE will read the file +names and line numbers from the tool and provide a way of finding the corresponding location in the code. + +If you use an IDE other than Visual Studio, you may need to customize the format of JavaScript Lint's outputted error messages. The sample configuration +file (jsl.default.conf) demonstrates this feature. + Modified: trunk/www/docs/running_from_your_php_website.htm =================================================================== --- trunk/www/docs/running_from_your_php_website.htm 2009-10-06 16:05:47 UTC (rev 262) +++ trunk/www/docs/running_from_your_php_website.htm 2009-10-06 16:54:26 UTC (rev 263) @@ -0,0 +1,19 @@ +<!-- +@title=Running from Your PHP Website +--> + +Running from Your PHP Website +============================= + +The JavaScript Lint source package (available from the [download page](/download.htm)) includes a `_jsl_online.php` file that allows PHP websites to integrate with JavaScript Lint. This script is used to power [the online lint](/online_lint.php). + +The following example usage is included in the PHP script: + +> + require_once("_jsl_online.php"); + $engine = new JSLEngine('.priv/jsl', '.priv/jsl.server.conf'); + $result = $engine->Lint($code); + if ($result === true) + OutputLintHTML($engine); + else + echo '<b>' . htmlentities($result) . '</b>'; Modified: trunk/www/docs/running_from_your_windows_program.htm =================================================================== --- trunk/www/docs/running_from_your_windows_program.htm 2009-10-06 16:05:47 UTC (rev 262) +++ trunk/www/docs/running_from_your_windows_program.htm 2009-10-06 16:54:26 UTC (rev 263) @@ -0,0 +1,38 @@ +<!-- +@title=Running from Your Windows Program +--> + +Running from Your Windows Program +================================= + +It is difficult for Windows programs to interact with console applications. For that reason, the JavaScript Lint source package (available from the [download](/download.htm) page) includes a C++ source file JavaScriptLintAPI.cpp to help Windows programmers integrate with JavaScript Lint. + +The following code demonstrates how to lint a file: + +> + using namespace std; +> + JavaScriptLint jsl("c:\\path\\to\\jsl.exe", "c:\\path\\to\\configuration\\file"); +> + string error; + vector<JSLMessage> messages; + if (jsl.LintFile("c:\\path\\to\\script.js", messages, error)) + { + for (vector<JSLMessage>::const_iterator msg = messages.begin(); msg != messages.end(); msg++) + { + // process messages + AfxMessageBox(msg->filename.c_str()); + } + } + else + { + // process error + } + +Additionally, the LintString function can be used to lint code in memory: + +> + // ... + if (jsl.LintString("var x = x;", messages, error)) + // ... + Added: trunk/www/news.php =================================================================== --- trunk/www/news.php (rev 0) +++ trunk/www/news.php 2009-10-06 16:54:26 UTC (rev 263) @@ -0,0 +1,6 @@ +<!-- +@title=Contact +--> + +News +======= Property changes on: trunk/www/news.php ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/www/rss.php ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/www.py =================================================================== --- trunk/www.py 2009-10-06 16:05:47 UTC (rev 262) +++ trunk/www.py 2009-10-06 16:54:26 UTC (rev 263) @@ -63,7 +63,11 @@ def do_GET(self): path = _resolve_url(self.path) if path: - self._send_response(*_transform_file(path)) + try: + self._send_response(*_transform_file(path)) + except Exception: + self.send_error(500, "TRACEBACK") + raise else: self.send_error(404, "File not found") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |