Skip to content

Commit

Permalink
filter out annoying warnings on cucumber steps
Browse files Browse the repository at this point in the history
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
  pending
end

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 committed Dec 5, 2011
1 parent 74683ec commit f932a15
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Commands/Validate and Save.tmCommand
Expand Up @@ -15,6 +15,12 @@ if compiler_ruby.length == 0
end
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$/, '')
end
if result =~ /:(\d+):/
print result
TextMate.go_to :line => $1
Expand Down

0 comments on commit f932a15

Please sign in to comment.