[javascriptlint-commit] SF.net SVN: javascriptlint:[240] trunk
Status: Beta
Brought to you by:
matthiasmiller
From: <mat...@us...> - 2009-03-04 06:47:49
|
Revision: 240 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=240&view=rev Author: matthiasmiller Date: 2009-03-04 06:47:42 +0000 (Wed, 04 Mar 2009) Log Message: ----------- start improving error descriptions Modified Paths: -------------- trunk/jsl.py trunk/pyjsl/lint.py trunk/test.py Modified: trunk/jsl.py =================================================================== --- trunk/jsl.py 2009-03-04 01:41:05 UTC (rev 239) +++ trunk/jsl.py 2009-03-04 06:47:42 UTC (rev 240) @@ -55,9 +55,9 @@ pyjsl.jsparse.dump_tree(script) def _lint(paths, conf): - def lint_error(path, line, col, errname): + def lint_error(path, line, col, errname, errdesc): _lint_results['warnings'] = _lint_results['warnings'] + 1 - print '%s(%i): %s' % (path, line+1, errname) + print '%s(%i): %s' % (path, line+1, errdesc) pyjsl.lint.lint_files(paths, lint_error, conf=conf) def _resolve_paths(path, recurse): Modified: trunk/pyjsl/lint.py =================================================================== --- trunk/pyjsl/lint.py 2009-03-04 01:41:05 UTC (rev 239) +++ trunk/pyjsl/lint.py 2009-03-04 06:47:42 UTC (rev 240) @@ -382,12 +382,14 @@ pos = node.end_pos() else: pos = node.start_pos() - _report(pos, errname, True) + errdesc = warnings.warnings[errname] + _report(pos, errname, errdesc, True) def report_native(pos, errname): - _report(pos, errname, False) + # TODO: Format the error. + _report(pos, errname, errname, False) - def _report(pos, errname, require_key): + def _report(pos, errname, errdesc, require_key): try: if not conf[errname]: return @@ -399,7 +401,7 @@ if pos >= start and pos <= end: return - return lint_error(pos.line, pos.col, errname) + return lint_error(pos.line, pos.col, errname, errdesc) for scriptpos, script in script_parts: ignores = [] Modified: trunk/test.py =================================================================== --- trunk/test.py 2009-03-04 01:41:05 UTC (rev 239) +++ trunk/test.py 2009-03-04 06:47:42 UTC (rev 240) @@ -44,7 +44,7 @@ unexpected_warnings = [] conf = _get_conf(script) - def lint_error(path, line, col, errname): + def lint_error(path, line, col, errname, errdesc): warning = (line, errname) # Bad hack to fix line numbers on ambiguous else statements This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |