Created
August 21, 2018 19:40
-
-
Save jonatas/86847d41fd4e1659e1fc41bc6ba2877a to your computer and use it in GitHub Desktop.
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
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