Search code examples
validationvimscripting-language

Code Validation Tools for Scripting Languages


I spent some two hours trying to understand why the JavaScript file I am including in my Facebook application is not showing when I view the source of my page. Then guess what the problem turned out to be? I forget to add the final closing bracket of a statement, and as Facebook processes the scripts before adding them (to avoid having unexpected errors in Facebook platform), it didn't attach this script because it has a syntax error!! That is, a whole JavaScript was not added because of a missing bracket!

So to save my time in the future I want to get some syntax validation tools for the scripting languages I am using: PHP, Python, JavaScript, MySQL (although not really a scripting language). Can anybody help me with that? It would be great if they are Vim plugins as I use it heavily.

Feel free to share validation tools for other programming languages, I don't want to keep this post for me only.


Solution

  • It's tagged with VIM so I would suggeest to look at jslint.vim.

    I use it (with a few fixes for Windows XP) with VIM 7.3.

    Other nice (and much easier to setup on Windows) tool is syntastic.vim. According to documentation it works for eruby, haml, html, javascript, php, python, ruby and sass.