Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save clarabstract/2705139 to your computer and use it in GitHub Desktop.

Select an option

Save clarabstract/2705139 to your computer and use it in GitHub Desktop.
Validate python file, and go to first error
<?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>changed</key>
<dict>
<key>command</key>
<string>#!/usr/bin/env ruby
flake_bin = ENV['TM_FLAKE8_BIN'] || '/usr/local/bin/flake8'
ignore = if ENV['TM_FLAKE8_IGNORE'] then "--ignore=#{ENV['TM_FLAKE8_IGNORE']}"
else '' end
errors = `#{flake_bin} #{ignore} #{ENV['TM_FILEPATH']}`
if errors and not errors.empty?
match, file, line, dummy, col, error = *(errors).lines.first.match(/^([^:]+):(\d+):((\d+):)? (.*)$/)
`mate -l #{line}:#{col} #{file}`
puts error
end
</string>
<key>inputFormat</key>
<string>text</string>
<key>name</key>
<string>Validate and go to error</string>
<key>outputCaret</key>
<string>afterOutput</string>
<key>outputFormat</key>
<string>html</string>
<key>outputLocation</key>
<string>toolTip</string>
<key>semanticClass</key>
<string>callback.document.did-save</string>
<key>version</key>
<integer>2</integer>
</dict>
<key>deleted</key>
<array>
<string>output</string>
</array>
<key>isDelta</key>
<true/>
<key>uuid</key>
<string>44C9C59C-89F9-11D9-9326-000D93B6E43C</string>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment