Class: Quandl::Utility::ThorTasks::Lint
- Inherits:
-
Thor
- Object
- Thor
- Quandl::Utility::ThorTasks::Lint
- Includes:
- Thor::Actions
- Defined in:
- lib/quandl/utility/thor_tasks/lint.rb
Overview
Linting Tasks
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
13 14 15 |
# File 'lib/quandl/utility/thor_tasks/lint.rb', line 13 def self.source_root File.('../../../../../support/templates', __FILE__) end |
Instance Method Details
#cookbook ⇒ Object
18 19 20 |
# File 'lib/quandl/utility/thor_tasks/lint.rb', line 18 def cookbook invoke 'foodcritic:lint' end |
#init_ruby ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/quandl/utility/thor_tasks/lint.rb', line 44 def init_ruby return unless yes?('Do you want to setup Rubocop linting?', :yellow) # Get directory and file for base rubocop dir = [:default_directory] file_path = File.join(dir, '.rubocop.yml') # Create empty directory if it does not exist empty_directory(dir) # Create base rubocop with common rules. Let Thor handle conflicts. template('quandl.rubocop.yml', file_path) # Create project template. Let Thor handle conflicts @base_directory = dir template('project.rubocop.yml.erb', '.rubocop.yml') end |
#ruby ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/quandl/utility/thor_tasks/lint.rb', line 28 def ruby result = RuboCop::CLI.new.run([:paths]) if result == 0 say('No Rubocop warnings', :green) else exit(result) end end |