Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7dac1fa9
Commit
7dac1fa9
authored
Sep 03, 2020
by
Rajendra Kadam
Committed by
Rémy Coutable
Sep 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Style/EmptyLambdaParameter cop
This MR fixes the cop for files
parent
146c43c9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
18 deletions
+16
-18
.rubocop_todo.yml
.rubocop_todo.yml
+0
-7
app/models/ci/build.rb
app/models/ci/build.rb
+10
-10
app/models/ci/runner.rb
app/models/ci/runner.rb
+1
-1
changelogs/unreleased/empty-lambda-cop.yml
changelogs/unreleased/empty-lambda-cop.yml
+5
-0
No files found.
.rubocop_todo.yml
View file @
7dac1fa9
...
...
@@ -548,13 +548,6 @@ Style/EachWithObject:
Style/EmptyElse
:
Enabled
:
false
# Offense count: 11
# Cop supports --auto-correct.
Style/EmptyLambdaParameter
:
Exclude
:
-
'
app/models/ci/build.rb'
-
'
app/models/ci/runner.rb'
# Offense count: 170
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
...
...
app/models/ci/build.rb
View file @
7dac1fa9
...
...
@@ -90,9 +90,9 @@ module Ci
Ci
::
BuildMetadata
.
scoped_build
.
with_interruptible
.
select
(
:id
))
end
scope
:unstarted
,
->
()
{
where
(
runner_id:
nil
)
}
scope
:ignore_failures
,
->
()
{
where
(
allow_failure:
false
)
}
scope
:with_downloadable_artifacts
,
->
()
do
scope
:unstarted
,
->
{
where
(
runner_id:
nil
)
}
scope
:ignore_failures
,
->
{
where
(
allow_failure:
false
)
}
scope
:with_downloadable_artifacts
,
->
do
where
(
'EXISTS (?)'
,
Ci
::
JobArtifact
.
select
(
1
)
.
where
(
'ci_builds.id = ci_job_artifacts.job_id'
)
...
...
@@ -104,11 +104,11 @@ module Ci
where
(
'EXISTS (?)'
,
::
Ci
::
JobArtifact
.
select
(
1
).
where
(
'ci_builds.id = ci_job_artifacts.job_id'
).
merge
(
query
))
end
scope
:with_archived_trace
,
->
()
do
scope
:with_archived_trace
,
->
do
with_existing_job_artifacts
(
Ci
::
JobArtifact
.
trace
)
end
scope
:without_archived_trace
,
->
()
do
scope
:without_archived_trace
,
->
do
where
(
'NOT EXISTS (?)'
,
Ci
::
JobArtifact
.
select
(
1
).
where
(
'ci_builds.id = ci_job_artifacts.job_id'
).
trace
)
end
...
...
@@ -139,11 +139,11 @@ module Ci
.
includes
(
:metadata
,
:job_artifacts_metadata
)
end
scope
:with_artifacts_not_expired
,
->
()
{
with_downloadable_artifacts
.
where
(
'artifacts_expire_at IS NULL OR artifacts_expire_at > ?'
,
Time
.
current
)
}
scope
:with_expired_artifacts
,
->
()
{
with_downloadable_artifacts
.
where
(
'artifacts_expire_at < ?'
,
Time
.
current
)
}
scope
:last_month
,
->
()
{
where
(
'created_at > ?'
,
Date
.
today
-
1
.
month
)
}
scope
:manual_actions
,
->
()
{
where
(
when: :manual
,
status:
COMPLETED_STATUSES
+
%i[manual]
)
}
scope
:scheduled_actions
,
->
()
{
where
(
when: :delayed
,
status:
COMPLETED_STATUSES
+
%i[scheduled]
)
}
scope
:with_artifacts_not_expired
,
->
{
with_downloadable_artifacts
.
where
(
'artifacts_expire_at IS NULL OR artifacts_expire_at > ?'
,
Time
.
current
)
}
scope
:with_expired_artifacts
,
->
{
with_downloadable_artifacts
.
where
(
'artifacts_expire_at < ?'
,
Time
.
current
)
}
scope
:last_month
,
->
{
where
(
'created_at > ?'
,
Date
.
today
-
1
.
month
)
}
scope
:manual_actions
,
->
{
where
(
when: :manual
,
status:
COMPLETED_STATUSES
+
%i[manual]
)
}
scope
:scheduled_actions
,
->
{
where
(
when: :delayed
,
status:
COMPLETED_STATUSES
+
%i[scheduled]
)
}
scope
:ref_protected
,
->
{
where
(
protected:
true
)
}
scope
:with_live_trace
,
->
{
where
(
'EXISTS (?)'
,
Ci
::
BuildTraceChunk
.
where
(
'ci_builds.id = ci_build_trace_chunks.build_id'
).
select
(
1
))
}
scope
:with_stale_live_trace
,
->
{
with_live_trace
.
finished_before
(
12
.
hours
.
ago
)
}
...
...
app/models/ci/runner.rb
View file @
7dac1fa9
...
...
@@ -52,7 +52,7 @@ module Ci
has_many
:runner_namespaces
,
inverse_of: :runner
has_many
:groups
,
through: :runner_namespaces
has_one
:last_build
,
->
()
{
order
(
'id DESC'
)
},
class_name:
'Ci::Build'
has_one
:last_build
,
->
{
order
(
'id DESC'
)
},
class_name:
'Ci::Build'
before_save
:ensure_token
...
...
changelogs/unreleased/empty-lambda-cop.yml
0 → 100644
View file @
7dac1fa9
---
title
:
Fix Style/EmptyLambdaParameter cop
merge_request
:
41248
author
:
Rajendra Kadam
type
:
fixed
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment