[javascriptlint-commit] SF.net SVN: javascriptlint:[263] trunk
Status: Beta
Brought to you by:
matthiasmiller
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. |