mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-23 00:15:58 +01:00
Started to flesh out rubocop settings for this project. Added rakefile tasks to do so. Updated first script to make it compliant.
This commit is contained in:
@@ -74,19 +74,30 @@ end
|
||||
namespace :style do
|
||||
desc "Check style"
|
||||
task :check do
|
||||
`rubocop ../`
|
||||
report execute("rubocop ../ --config .rubocop.yml", true)
|
||||
report "Style Checked."
|
||||
end
|
||||
|
||||
namespace :check do
|
||||
Dir['../**/*.rb'].each do |f|
|
||||
task File.basename(f, '.rb').to_sym do
|
||||
report execute("rubocop #{f} --color --config .rubocop.yml", true)
|
||||
report "Style Checked."
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
desc "Attempt to Autocorrect style"
|
||||
task :auto do
|
||||
`rubocop ../ --auto-correct`
|
||||
File.delete(".rubocop_todo.yml")
|
||||
execute("rubocop ../ --auto-correct --config .rubocop.yml")
|
||||
report "Autocorrected What We Could."
|
||||
end
|
||||
|
||||
desc "Update style todo list"
|
||||
task :todo do
|
||||
`rubocop ../ --auto-gen-config`
|
||||
File.delete(".rubocop_todo.yml")
|
||||
execute("rubocop ../ --auto-gen-config --config .rubocop.yml")
|
||||
report "Updated Style TODO List."
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user