Skip to content

Instantly share code, notes, and snippets.

@jonatas
Created August 21, 2018 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonatas/86847d41fd4e1659e1fc41bc6ba2877a to your computer and use it in GitHub Desktop.
Save jonatas/86847d41fd4e1659e1fc41bc6ba2877a to your computer and use it in GitHub Desktop.
require '../../fast/lib/fast'
changed_files = `git diff --name-only $(git merge-base origin/master HEAD) --diff-filter=AMCR -- '*_spec.rb'`.lines.map(&:chomp)
changed_files.each do |file|
ast = begin
Fast.ast_from_file(file)
rescue
next
end
results = Fast.search(ast, '(block (send nil context (str _)))')
next unless results
results.each do |node|
message = Fast.capture(node, '(send nil context (str $_))')
next if message.nil?
next if %w[when with without].include?(message.split.first)
require 'pry'; binding.pry
end
print '.'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment