gitlab-org--gitlab-foss/lib/tasks/flay.rake
Zeger-Jan van de Weg a248e7adf3
Fix flay not detecting identical code
Previously the script checked only for 'Similar code', but flay will
tell users when IDENTICAL code is detected too. This should create a
commit will create a failing pipeline, and to check that it does this
commit is pushed.

Fixes #42628
2018-01-31 14:07:47 +01:00

9 lines
253 B
Ruby

desc 'Code duplication analyze via flay'
task :flay do
output = `bundle exec flay --mass 35 app/ lib/gitlab/ 2> #{File::NULL}`
if output.include?("Similar code found") || output.include?("IDENTICAL code found")
puts output
exit 1
end
end