diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2018-08-27 18:31:01 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2018-09-11 18:32:00 +0300 |
commit | 2039c8280db1646845c33d6c5a74e5f23ca6f4de (patch) | |
tree | e2b3cd3012d9711cda7c6afb962ae4228d59521a /app/workers/process_commit_worker.rb | |
parent | 91c40973dc620430b173ea2df968587d2a708dff (diff) |
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
Diffstat (limited to 'app/workers/process_commit_worker.rb')
-rw-r--r-- | app/workers/process_commit_worker.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/workers/process_commit_worker.rb b/app/workers/process_commit_worker.rb index c9f6df9b56d..7b167c95c29 100644 --- a/app/workers/process_commit_worker.rb +++ b/app/workers/process_commit_worker.rb @@ -14,6 +14,7 @@ class ProcessCommitWorker # commit_hash - Hash containing commit details to use for constructing a # Commit object without having to use the Git repository. # default - The data was pushed to the default branch. + # rubocop: disable CodeReuse/ActiveRecord def perform(project_id, user_id, commit_hash, default = false) project = Project.find_by(id: project_id) @@ -30,6 +31,7 @@ class ProcessCommitWorker process_commit_message(project, commit, user, author, default) update_issue_metrics(commit, author) end + # rubocop: enable CodeReuse/ActiveRecord def process_commit_message(project, commit, user, author, default = false) # Ignore closing references from GitLab-generated commit messages. @@ -50,6 +52,7 @@ class ProcessCommitWorker end end + # rubocop: disable CodeReuse/ActiveRecord def update_issue_metrics(commit, author) mentioned_issues = commit.all_references(author).issues @@ -58,6 +61,7 @@ class ProcessCommitWorker Issue::Metrics.where(issue_id: mentioned_issues.map(&:id), first_mentioned_in_commit_at: nil) .update_all(first_mentioned_in_commit_at: commit.committed_date) end + # rubocop: enable CodeReuse/ActiveRecord def build_commit(project, hash) date_suffix = '_date' |