From 2daa208af60bd88f7672e2210996e474959466f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0smail=20Akbudak?= Date: Wed, 3 Jan 2018 10:00:43 +0300 Subject: [PATCH] KBP-175 #time 3h add usefull pronto runners --- cybele.gemspec | 4 ++++ lib/cybele/helpers/pronto.rb | 6 ++++++ spec/support/paperclip_test_helper.rb | 2 +- spec/support/pronto_test_helpers.rb | 11 +++++++++++ templates/Gemfile.erb | 17 +++++++++++++++-- templates/pronto/.haml-lint.yml.erb | 3 +++ templates/pronto/config.reek.erb | 6 ++++++ 7 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 templates/pronto/.haml-lint.yml.erb create mode 100644 templates/pronto/config.reek.erb diff --git a/cybele.gemspec b/cybele.gemspec index a4f82d3..f19c766 100644 --- a/cybele.gemspec +++ b/cybele.gemspec @@ -28,6 +28,10 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'pronto', '~> 0.9.5' spec.add_development_dependency 'pronto-flay', '~> 0.9.0' spec.add_development_dependency 'pronto-rubocop', '~> 0.9.0' + spec.add_development_dependency 'pronto-fasterer', '~> 0.9.0' + spec.add_development_dependency 'pronto-reek', '~> 0.9.0' + spec.add_development_dependency 'pronto-poper', '~> 0.9.0' + spec.add_development_dependency 'pronto-spell', '~> 0.9.0' spec.add_development_dependency 'rspec', '~> 3.5' spec.add_development_dependency 'thor', '~> 0.19.4' diff --git a/lib/cybele/helpers/pronto.rb b/lib/cybele/helpers/pronto.rb index 9a80238..d2af448 100644 --- a/lib/cybele/helpers/pronto.rb +++ b/lib/cybele/helpers/pronto.rb @@ -11,6 +11,12 @@ def configure_pronto template 'pronto/example.pronto.yml.erb', '.pronto.yml', force: true + template 'pronto/.haml-lint.yml.erb', + '.haml-lint.yml', + force: true + template 'pronto/config.reek.erb', + 'config.reek', + force: true template 'pronto/.rubocop.yml.erb', '.rubocop.yml', force: true diff --git a/spec/support/paperclip_test_helper.rb b/spec/support/paperclip_test_helper.rb index 38b6807..dbcd010 100644 --- a/spec/support/paperclip_test_helper.rb +++ b/spec/support/paperclip_test_helper.rb @@ -3,7 +3,7 @@ module PaperclipTestHelper def paperclip_test gemfile_file = content('Gemfile') - expect(gemfile_file).to match(/^gem "paperclip"/) + expect(gemfile_file).to match(/^gem 'paperclip'/) expect(gemfile_file).to match(/^gem 'aws-sdk'/) env_sample_file_test diff --git a/spec/support/pronto_test_helpers.rb b/spec/support/pronto_test_helpers.rb index de91eab..55a3a6c 100644 --- a/spec/support/pronto_test_helpers.rb +++ b/spec/support/pronto_test_helpers.rb @@ -12,13 +12,24 @@ def pronto_test def file_exist_test gemfile_file = content('Gemfile') expect(gemfile_file).to match("gem 'pronto'") + expect(gemfile_file).to match("gem 'pronto-brakeman'") + expect(gemfile_file).to match("gem 'pronto-fasterer'") expect(gemfile_file).to match("gem 'pronto-flay'") + expect(gemfile_file).to match("gem 'pronto-haml'") + expect(gemfile_file).to match("gem 'pronto-jscs'") + expect(gemfile_file).to match("gem 'pronto-poper'") + expect(gemfile_file).to match("gem 'pronto-rails_best_practices'") + expect(gemfile_file).to match("gem 'pronto-reek'") expect(gemfile_file).to match("gem 'pronto-rubocop'") + expect(gemfile_file).to match("gem 'pronto-scss'") + expect(gemfile_file).to match("gem 'pronto-spell'") end def file_content_test # rubocop:disable Metrics/AbcSize expect(File).to exist(file_project_path('example.pronto.yml')) expect(File).to exist(file_project_path('.pronto.yml')) + expect(File).to exist(file_project_path('.haml-lint.yml')) + expect(File).to exist(file_project_path('config.reek')) expect(File).to exist(file_project_path('.rubocop.yml')) expect(File).to exist(file_project_path('bin/rubo')) end diff --git a/templates/Gemfile.erb b/templates/Gemfile.erb index 9a10cbd..f00551d 100644 --- a/templates/Gemfile.erb +++ b/templates/Gemfile.erb @@ -34,9 +34,22 @@ group :development, :test do gem 'colorize', '~> 0.8.1' gem 'guard', '~> 2.14', '>= 2.14.1' gem 'mailtrap', '~> 0.2.1' +end + +# Pronto runners +group :development do gem 'pronto', '~> 0.9.5' - gem 'pronto-flay', '~> 0.9.0', require: false - gem 'pronto-rubocop', '~> 0.9.0', require: false + gem 'pronto-brakeman', require: false + gem 'pronto-fasterer', require: false + gem 'pronto-flay', require: false + gem 'pronto-haml', require: false + gem 'pronto-jscs', require: false + gem 'pronto-poper', require: false + gem 'pronto-rails_best_practices', require: false + gem 'pronto-reek', require: false + gem 'pronto-rubocop', require: false + gem 'pronto-scss', require: false + gem 'pronto-spell', require: false end # A set of common locale data and translations to internationalize and/or localize your Rails applications. diff --git a/templates/pronto/.haml-lint.yml.erb b/templates/pronto/.haml-lint.yml.erb new file mode 100644 index 0000000..6b1993d --- /dev/null +++ b/templates/pronto/.haml-lint.yml.erb @@ -0,0 +1,3 @@ +linters: + LineLength: + max: 100 \ No newline at end of file diff --git a/templates/pronto/config.reek.erb b/templates/pronto/config.reek.erb new file mode 100644 index 0000000..da9f14a --- /dev/null +++ b/templates/pronto/config.reek.erb @@ -0,0 +1,6 @@ +IrresponsibleModule: + enabled: false + +"lib/modules": + IrresponsibleModule: + enabled: true \ No newline at end of file