Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Uses CoffeeScript's lint option to syntax check. Ignores warnings since they're pretty pedantic, e.g. "parseInt missing radix parameter"
- Loading branch information
Showing
6 changed files
with
45 additions
and
1 deletion.
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,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>beforeRunningCommand</key> | ||
<string>saveActiveFile</string> | ||
<key>command</key> | ||
<string>#!/usr/bin/env ruby | ||
require ENV['TM_BUNDLE_SUPPORT'] + "/lib/validate_on_save" | ||
VOS::Validate.coffeescript</string> | ||
<key>input</key> | ||
<string>document</string> | ||
<key>keyEquivalent</key> | ||
<string>@s</string> | ||
<key>name</key> | ||
<string>Validate CoffeeScript</string> | ||
<key>output</key> | ||
<string>showAsTooltip</string> | ||
<key>scope</key> | ||
<string>source.coffee</string> | ||
<key>uuid</key> | ||
<string>84CF05E4-3567-4AF2-BEB9-05F533B2F3E3</string> | ||
</dict> | ||
</plist> |
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
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
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
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 @@ | ||
class VOS | ||
class Validate | ||
def self.coffeescript | ||
binary = ENV['TM_COFFEESCRIPT'] ||= "coffee" | ||
filepath = ENV['TM_FILEPATH'] | ||
VOS.output({ | ||
:info => "Running syntax check with CoffeeScript lint\n", | ||
:result => `"#{binary}" --lint #{filepath} 2>&1`.sub(/^Error.*\.coffee, /, ''), | ||
:match_ok => /0 error\(s\)\, /i, # ignore warnings | ||
:match_line => /line (\d+)/i, | ||
:lang => "CoffeeScript" | ||
}) | ||
end | ||
end | ||
end |
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