-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
1,784 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.DS_Store | ||
JSHint.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"predef": [], | ||
"node": true, | ||
"es5": true, | ||
"bitwise": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"forin": true, | ||
"immed": true, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"noempty": true, | ||
"nonew": true, | ||
"plusplus": true, | ||
"undef": true, | ||
"strict": true, | ||
"trailing": true, | ||
"globalstrict": true, | ||
"nonstandard": true, | ||
"white": true, | ||
"indent": 2, | ||
"onevar": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[{ | ||
"id": "jshint", | ||
"caption": "JSHint", | ||
"command": "jshint" | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[{ | ||
"id": "jshint", | ||
"caption": "JSHint", | ||
"command": "jshint" | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[{ | ||
"keys": ["ctrl+j"], "command": "jshint" | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import sublime, sublime_plugin | ||
|
||
class JshintCommand(sublime_plugin.WindowCommand): | ||
def run(self): | ||
self.window.run_command('set_build_system', { | ||
'file': 'Packages/JSHint/JSHint.sublime-build' | ||
}) | ||
self.window.run_command('build') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"selector": "source.js", | ||
|
||
"cmd": ["jshint", "$file", "--reporter", "$packages/JSHint/reporter.js"], | ||
|
||
"file_regex": "file:(.+)\\]", | ||
"line_regex": "(\\d+),(\\d+)", | ||
|
||
"osx": { | ||
"path": "/user/local/share/npm/bin:/usr/local/bin:/opt/local/bin" | ||
}, | ||
|
||
"windows": { | ||
"cmd": ["jshint.cmd", "$file", "--reporter", "$packages\\JSHint\\reporter.js"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[{ | ||
"caption": "Tools", | ||
"mnemonic": "t", | ||
"id": "tools", | ||
"children": [{ | ||
"id": "jshint", | ||
"caption": "JSHint", | ||
"command": "jshint" | ||
}] | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#JSHint for Sublime Text 2 | ||
|
||
The best JavaScript syntax checker: [JSHint](http://www.jshint.com/) for the best text editor: [Sublime Text 2](http://www.sublimetext.com/2) | ||
|
||
**Prerequisites:** [jshint](https://github.com/jshint/jshint) and [Sublime Package Control](http://wbond.net/sublime_packages/package_control/installation) | ||
|
||
**Mac OS X:** Installing node with homebrew or macports is assumed. The path to jshint is hardcoded in this plugin as `/usr/local/bin:/opt/local/bin`. There is no reliable way to get the path from your environment. | ||
|
||
**Linux:** Make sure jshint is in your environment path. | ||
|
||
**Windows:** Installing node with the Windows Installer from nodejs.org is assumed. **Known Bug:** Sublime Text 2 for Windows doesn't show the console output. As a temporary hack, you can output to a file. See issue #23. | ||
|
||
##Install node-jshint with npm | ||
|
||
npm install -g jshint | ||
|
||
##Install JSHint with Package Control in Sublime Text 2 | ||
|
||
1. `command`-`shift`-`P` *or* `control`-`shift`-`P` in Linux/Windows* | ||
2. type `install p`, select `Package Control: Install Package` | ||
3. type `jshint`, select `JSHint` | ||
|
||
**Note:** Without Sublime Package Control, you could manually clone to Packages directory as 'JSHint', exactly. | ||
|
||
##Run JSHint on an active JavaScript file in Sublime Text 2 | ||
|
||
- `control`-`J` *or Tools/Contextual menus or the Command Palette* | ||
- `F4` jump to next error row/column | ||
- `shift`-`F4` jump to previous error row-column | ||
|
||
**Note:** The `control`-`J` shortcut changes the Build System on the current file to JSHint, then Builds to run JSHint on the file and output any errors for jumping to within the file. You could alternatively set the Build System to Automatic and `command`-`B`/`control`-`B`/`F7`, but only on files that end with .js. | ||
|
||
##Run JSHint on save | ||
|
||
Install [SublimeOnSaveBuild](https://github.com/alexnj/SublimeOnSaveBuild) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"url": "https://github.com/uipoet/sublime-jshint", "version": "2012.12.17.23.52.03", "description": "JSHint any JavaScript file in Sublime Text 2"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
|
||
reporter: function (errors, results, done) { | ||
|
||
var | ||
errorString = 'Error', | ||
warningString = 'Warning', | ||
file = results[0].file, | ||
errorLength, warningLength, globals, orphans; | ||
|
||
function numberWang(wangaNumb) { | ||
var | ||
thatsNumberWang = 8 - wangaNumb, | ||
stayNumberWang = '', i; | ||
|
||
for (i = 0; i < thatsNumberWang; i += 1) { | ||
stayNumberWang += ' '; | ||
} | ||
|
||
return stayNumberWang; | ||
} | ||
var buffer = ''; | ||
console.log = function(){ | ||
var args = Array.prototype.slice.call(arguments); | ||
buffer += args.join(''); | ||
buffer += '\n'; | ||
} | ||
console.log('[JSHint file:', file + ']'); | ||
|
||
results.forEach(function (result) { | ||
|
||
globals = result.implieds; | ||
orphans = result.unused; | ||
|
||
warningLength = (globals ? globals.length : 0) + (orphans ? orphans.length : 0); | ||
|
||
if (warningLength > 1) { | ||
warningString += 's'; | ||
} | ||
|
||
}); | ||
|
||
if (errors) { | ||
errorLength = errors.length; | ||
|
||
if (errorLength > 0) { | ||
if (errorLength > 1) { | ||
errorString += 's'; | ||
} | ||
|
||
console.log(' ', errorLength, errorString + ':'); | ||
|
||
errors.forEach(function (result) { | ||
var error = result.error; | ||
|
||
console.log(numberWang((error.line.toString() + error.character.toString()).length), error.line + ',' + error.character + ':', error.reason); | ||
}); | ||
} | ||
} | ||
|
||
if (warningLength > 0) { | ||
console.log(' ', warningLength, warningString + ':'); | ||
|
||
if (globals) { | ||
globals.forEach(function (global) { | ||
for (var line in global.line){ | ||
console.log(numberWang(global.line[line].toString().length + 1), global.line[line] + ',1: \'' + global.name + '\' is an implied global variable.'); | ||
} | ||
}); | ||
} | ||
|
||
if (orphans) { | ||
orphans.forEach(function (orphan) { | ||
console.log(numberWang(orphan.line.toString().length + 1), orphan.line + ',1: \'' + orphan.name + '\' is an unused variable.'); | ||
}); | ||
} | ||
} | ||
process.stdout.write(buffer); | ||
setTimeout('',3000); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.cache | ||
*.pyc | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[ | ||
{ "caption": "-" }, | ||
{ | ||
"caption": "RubyTest", | ||
"children": | ||
[ | ||
{ "caption": "Run single test / scenario / spec", "command": "run_single_ruby_test" }, | ||
{ "caption": "Run all tests / feature / full spec", "command": "run_all_ruby_test" }, | ||
{ "caption": "Run last test(s) / feature / spec", "command": "run_last_ruby_test" }, | ||
{ "caption": "-" }, | ||
{ "caption": "Show test panel", "command": "show_test_panel" }, | ||
{ "caption": "-" }, | ||
{ "caption": "Verify ruby syntax", "command": "verify_ruby_file" }, | ||
{ "caption": "-" }, | ||
{ "caption": "Refactoring", "children": [ | ||
{ "caption": "Extract Local Variable", "command": "ruby_extract_variable" } | ||
]}, | ||
{ "caption": "-" }, | ||
{ "caption": "Switch Between Code and Test", "command": "switch_between_code_and_test", "args": {"split_view": false} } | ||
] | ||
} | ||
] |
15 changes: 15 additions & 0 deletions
15
Backup/20121228141834/RubyTest/Default (Linux).sublime-keymap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[ | ||
{ "keys": ["ctrl+shift+r"], "command": "run_single_ruby_test" }, // single test | ||
{ "keys": ["ctrl+shift+t"], "command": "run_all_ruby_test" }, // test file | ||
{ "keys": ["ctrl+shift+e"], "command": "run_last_ruby_test" }, // test file | ||
|
||
{ "keys": ["ctrl+shift+x"], "command": "show_test_panel" }, // show test panel | ||
|
||
{ "keys": ["alt+shift+v"], "command": "verify_ruby_file" }, // verify ruby syntax | ||
{ "keys": ["ctrl+period"], "command": "switch_between_code_and_test", "args": {"split_view": false}, "context" : [ | ||
{ "key": "selector", "operator": "equal", "operand": "source.ruby", "match_all": true } | ||
]}, // switch between code and test in single view | ||
{ "keys": ["ctrl+shift+period"], "command": "switch_between_code_and_test", "args": {"split_view": true}, "context" : [ | ||
{ "key": "selector", "operator": "equal", "operand": "source.ruby", "match_all": true } | ||
]} // switch between code and test in split view | ||
] |
11 changes: 11 additions & 0 deletions
11
Backup/20121228141834/RubyTest/Default (OSX).sublime-keymap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[ | ||
{ "keys": ["super+shift+r"], "command": "run_single_ruby_test" }, // single test | ||
{ "keys": ["super+shift+t"], "command": "run_all_ruby_test" }, // test file | ||
{ "keys": ["super+shift+e"], "command": "run_last_ruby_test" }, // test file | ||
|
||
{ "keys": ["super+shift+x"], "command": "show_test_panel" }, // show test panel | ||
|
||
{ "keys": ["alt+shift+v"], "command": "verify_ruby_file" }, // verify ruby syntax | ||
{ "keys": ["super+period"], "command": "switch_between_code_and_test", "args": {"split_view": false} }, // switch between code and test in single mode | ||
{ "keys": ["super+ctrl+period"], "command": "switch_between_code_and_test", "args": {"split_view": true} } // switch between code and test in split view | ||
] |
15 changes: 15 additions & 0 deletions
15
Backup/20121228141834/RubyTest/Default (Windows).sublime-keymap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[ | ||
{ "keys": ["ctrl+shift+r"], "command": "run_single_ruby_test" }, // single test | ||
{ "keys": ["ctrl+shift+t"], "command": "run_all_ruby_test" }, // test file | ||
{ "keys": ["ctrl+shift+e"], "command": "run_last_ruby_test" }, // test file | ||
|
||
{ "keys": ["ctrl+shift+x"], "command": "show_test_panel" }, // show test panel | ||
|
||
{ "keys": ["alt+shift+v"], "command": "verify_ruby_file" }, // verify ruby syntax | ||
{ "keys": ["ctrl+period"], "command": "switch_between_code_and_test", "args": {"split_view": false}, "context" : [ | ||
{ "key": "selector", "operator": "equal", "operand": "source.ruby", "match_all": true } | ||
]}, // switch between code and test in single view | ||
{ "keys": ["ctrl+shift+period"], "command": "switch_between_code_and_test", "args": {"split_view": true}, "context" : [ | ||
{ "key": "selector", "operator": "equal", "operand": "source.ruby", "match_all": true } | ||
]} // switch between code and test in split view | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[ | ||
{ "caption": "RubyTest: Run Single Test", "command": "run_single_ruby_test" }, | ||
{ "caption": "RubyTest: Run All Ruby Tests", "command": "run_all_ruby_test" }, | ||
{ "caption": "RubyTest: Run Last Ruby Test", "command": "run_last_ruby_test" }, | ||
{ "caption": "RubyTest: Show Test Panel", "command": "show_test_panel" }, | ||
{ "caption": "RubyTest: Verify Syntax", "command": "verify_ruby_file" }, | ||
{ "caption": "RubyTest: Generate Rails Migration", "command": "ruby_rails_generate", "args" : {"type" : "migration"} }, | ||
{ "caption": "RubyTest: Generate Rails Model", "command": "ruby_rails_generate", "args" : {"type" : "model"} }, | ||
{ "caption": "RubyTest: Generate Rails Controller", "command": "ruby_rails_generate", "args" : {"type" : "controller"} }, | ||
{ "caption": "RubyTest: Extract Local Variable", "command": "ruby_extract_variable" }, | ||
{ "caption": "RubyTest: Switch between code and test", "command": "switch_between_code_and_test", "args": {"split_view": false} } | ||
] |
Oops, something went wrong.