Add flay: tool to find duplicate code
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
6748dd2fd0
commit
98c954ee81
5 changed files with 23 additions and 0 deletions
1
.flayignore
Normal file
1
.flayignore
Normal file
|
@ -0,0 +1 @@
|
|||
*.erb
|
|
@ -81,3 +81,11 @@ flog:
|
|||
- ruby
|
||||
- mysql
|
||||
allow_failure: true
|
||||
|
||||
flay:
|
||||
script:
|
||||
- bundle exec rake flay
|
||||
tags:
|
||||
- ruby
|
||||
- mysql
|
||||
allow_failure: true
|
||||
|
|
1
Gemfile
1
Gemfile
|
@ -260,6 +260,7 @@ group :development, :test do
|
|||
gem 'coveralls', '~> 0.8.2', require: false
|
||||
gem 'simplecov', '~> 0.10.0', require: false
|
||||
gem 'flog', require: false
|
||||
gem 'flay', require: false
|
||||
|
||||
gem 'benchmark-ips', require: false
|
||||
end
|
||||
|
|
|
@ -194,6 +194,9 @@ GEM
|
|||
ffi (1.9.10)
|
||||
fission (0.5.0)
|
||||
CFPropertyList (~> 2.2)
|
||||
flay (2.6.1)
|
||||
ruby_parser (~> 3.0)
|
||||
sexp_processor (~> 4.0)
|
||||
flog (4.3.2)
|
||||
ruby_parser (~> 3.1, > 3.1.0)
|
||||
sexp_processor (~> 4.4)
|
||||
|
@ -824,6 +827,7 @@ DEPENDENCIES
|
|||
enumerize (~> 0.7.0)
|
||||
factory_girl_rails (~> 4.3.0)
|
||||
ffaker (~> 2.0.0)
|
||||
flay
|
||||
flog
|
||||
fog (~> 1.25.0)
|
||||
font-awesome-rails (~> 4.2)
|
||||
|
|
9
lib/tasks/flay.rake
Normal file
9
lib/tasks/flay.rake
Normal file
|
@ -0,0 +1,9 @@
|
|||
desc 'Code duplication analyze via flay'
|
||||
task :flay do
|
||||
output = %x(bundle exec flay app/ lib/gitlab/)
|
||||
|
||||
if output.include? "Similar code found"
|
||||
puts output
|
||||
exit 1
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue