1
0
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:
Mark VanderVoord
2017-03-28 15:48:28 -04:00
parent 23f9c16aaa
commit 3e0a7121fb
4 changed files with 105 additions and 99 deletions

View File

@@ -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