Skip to content

Commit

Permalink
#551: auto-apply rubocop fixes after upgrade to rubocop-performance 1…
Browse files Browse the repository at this point in the history
….13.1
  • Loading branch information
dgroup committed Jan 17, 2022
1 parent a95b60a commit bccbe10
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .rultor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -28,4 +29,5 @@ merge:
squash: true
script: |-
bundle install
rubocop -A
bundle exec rake test rubocop sqlint xcop
2 changes: 1 addition & 1 deletion lib/lazylead/task/echo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions lib/lazylead/task/loading.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
4 changes: 2 additions & 2 deletions lib/lazylead/task/propagate_down.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bccbe10

Please sign in to comment.