Browse files

filter out annoying warnings on cucumber steps

This patch filters out annoying warnings about "ambiguous first argument" that occur on typically formatted Cucumber step definitions like the following:

Given /^I am logged in$/ do

These are particularly annoying since the cursor gets moved to the first occurence of the warning every time you save.
  • Loading branch information...
Gabriel Gilder
Gabriel Gilder committed Dec 5, 2011
1 parent 74683ec commit f932a159e21bb833994267f0f19095ad73edb205
Showing with 6 additions and 0 deletions.
  1. +6 −0 Commands/Validate and Save.tmCommand
@@ -15,6 +15,12 @@ if compiler_ruby.length == 0
result = `#{compiler_ruby} -wc "$TM_FILEPATH" 2>&1`
+scopes = ENV['TM_SCOPE'].split
+if scopes.include? 'source.ruby.rspec.cucumber.steps'
+ result.gsub!(/^.+warning: ambiguous first argument; put parentheses or even spaces$/, '')
if result =~ /:(\d+):/
print result
TextMate.go_to :line => $1

0 comments on commit f932a15

Please sign in to comment.