diff --git a/.circleci/config.yml b/.circleci/config.yml index f08618a..8eeb046 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,6 +11,7 @@ jobs: - run: | apk add libc-dev gcc make git sqlite sqlite-dev sqlite-libs bundler install + - run: rubocop -A - run: bundle exec rake test rubocop sqlint xcop deploy: machine: true diff --git a/.rultor.yml b/.rultor.yml index dc328b1..953b4c0 100755 --- a/.rultor.yml +++ b/.rultor.yml @@ -16,6 +16,7 @@ release: sed -i "s/0\.0\.0/${tag}/g" lib/lazylead/version.rb sed -i "s/0\.0\.0/${tag}/g" lazylead.gemspec bundle install --no-color + rubocop -A bundle exec rake --trace test rubocop sqlint xcop git add lib/lazylead/version.rb lazylead.gemspec git commit -m "version set to ${tag}" @@ -28,4 +29,5 @@ merge: squash: true script: |- bundle install + rubocop -A bundle exec rake test rubocop sqlint xcop diff --git a/lib/lazylead/task/echo.rb b/lib/lazylead/task/echo.rb index a02db93..fed310f 100644 --- a/lib/lazylead/task/echo.rb +++ b/lib/lazylead/task/echo.rb @@ -53,7 +53,7 @@ def initialize(log = Log.new, path = "test/resources/echo.txt") end def run(_, _, _) - File.open(@path, "w") { |f| f.write Time.now } + File.write(@path, Time.now) end end end diff --git a/lib/lazylead/task/loading.rb b/lib/lazylead/task/loading.rb index 57207e9..9aa31fe 100644 --- a/lib/lazylead/task/loading.rb +++ b/lib/lazylead/task/loading.rb @@ -38,8 +38,7 @@ def initialize(log = Log.new) def run(sys, postman, opts) assignments = sys.issues(opts["jql"], opts.jira_defaults) .group_by(&:assignee) - .map { |user, tasks| [user.id, Teammate.new(user, tasks)] } - .to_h + .to_h { |user, tasks| [user.id, Teammate.new(user, tasks)] } opts.slice("team", ",") .map { |m| m.split(":") } .each { |id, name| assignments[id] = Free.new(id, name) unless assignments.key? id } diff --git a/lib/lazylead/task/propagate_down.rb b/lib/lazylead/task/propagate_down.rb index 7b0941f..782ede6 100644 --- a/lib/lazylead/task/propagate_down.rb +++ b/lib/lazylead/task/propagate_down.rb @@ -87,9 +87,9 @@ def fetch # Fill pre-defined fields for sub-tasks from parent ticket # and post comment to ticket with clarification. def propagate - expected = @fields.collect { |f| [f, @issue.fields[f]] }.to_h + expected = @fields.to_h { |f| [f, @issue.fields[f]] } @subtasks.each do |subtask| - actual = @fields.collect { |f| [f, subtask.fields[f]] }.to_h + actual = @fields.to_h { |f| [f, subtask.fields[f]] } diff = diff(expected, actual) next if diff.empty? subtask.save(fields: diff)