Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
0932578f6584
Commit
0932578f
authored
Feb 21, 2017
by
Douwe Maan
Browse files
Enable Style/MutableConstant
parent
ad222f96ec59
Changes
118
Hide whitespace changes
Inline
Side-by-side
.rubocop.yml
View file @
0932578f
...
...
@@ -308,6 +308,9 @@
Style/MultilineTernaryOperator
:
Enabled
:
true
Style/MutableConstant
:
Enabled
:
true
# Favor unless over if for negative conditions (or control flow or).
Style/NegatedIf
:
Enabled
:
true
...
...
.rubocop_todo.yml
View file @
0932578f
...
...
@@ -471,11 +471,6 @@
-
'
app/models/project_wiki.rb'
-
'
lib/gitlab/workhorse.rb'
# Offense count: 187
# Cop supports --auto-correct.
Style/MutableConstant
:
Enabled
:
false
# Offense count: 8
# Cop supports --auto-correct.
Style/NestedParenthesizedCalls
:
...
...
app/controllers/admin/system_info_controller.rb
View file @
0932578f
...
...
@@ -3,7 +3,7 @@
'nobrowse'
,
'read-only'
,
'ro'
]
]
.
freeze
EXCLUDED_MOUNT_TYPES
=
[
'autofs'
,
...
...
@@ -27,7 +27,7 @@
'tmpfs'
,
'tracefs'
,
'vfat'
]
]
.
freeze
def
show
@cpus
=
Vmstat
.
cpu
rescue
nil
...
...
app/controllers/concerns/service_params.rb
View file @
0932578f
...
...
@@ -59,6 +59,6 @@
:user_key
,
:username
,
:webhook
]
]
.
freeze
# Parameters to ignore if no value is specified
...
...
@@ -63,6 +63,6 @@
# Parameters to ignore if no value is specified
FILTER_BLANK_PARAMS
=
[
:password
]
FILTER_BLANK_PARAMS
=
[
:password
]
.
freeze
def
service_params
dynamic_params
=
@service
.
event_channel_names
+
@service
.
event_names
...
...
app/controllers/jwt_controller.rb
View file @
0932578f
...
...
@@ -5,7 +5,7 @@
SERVICES
=
{
Auth
::
ContainerRegistryAuthenticationService
::
AUDIENCE
=>
Auth
::
ContainerRegistryAuthenticationService
,
}
}
.
freeze
def
auth
service
=
SERVICES
[
params
[
:service
]]
...
...
app/finders/issuable_finder.rb
View file @
0932578f
...
...
@@ -19,7 +19,7 @@
# iids: integer[]
#
class
IssuableFinder
NONE
=
'0'
NONE
=
'0'
.
freeze
attr_accessor
:current_user
,
:params
...
...
app/finders/todos_finder.rb
View file @
0932578f
...
...
@@ -13,7 +13,7 @@
#
class
TodosFinder
NONE
=
'0'
NONE
=
'0'
.
freeze
attr_accessor
:current_user
,
:params
...
...
app/helpers/issuables_helper.rb
View file @
0932578f
...
...
@@ -198,7 +198,7 @@
@counts
[
issuable_type
][
state
]
end
IRRELEVANT_PARAMS_FOR_CACHE_KEY
=
%i[utf8 sort page]
IRRELEVANT_PARAMS_FOR_CACHE_KEY
=
%i[utf8 sort page]
.
freeze
private_constant
:IRRELEVANT_PARAMS_FOR_CACHE_KEY
def
issuables_state_counter_cache_key
(
issuable_type
,
state
)
...
...
app/models/application_setting.rb
View file @
0932578f
...
...
@@ -5,7 +5,7 @@
add_authentication_token_field
:runners_registration_token
add_authentication_token_field
:health_check_access_token
CACHE_KEY
=
'application_setting.last'
CACHE_KEY
=
'application_setting.last'
.
freeze
DOMAIN_LIST_SEPARATOR
=
%r{
\s
*[,;]
\s
* # comma or semicolon, optionally surrounded by whitespace
| # or
\s
# any whitespace character
...
...
app/models/ci/runner.rb
View file @
0932578f
...
...
@@ -4,8 +4,8 @@
RUNNER_QUEUE_EXPIRY_TIME
=
60
.
minutes
LAST_CONTACT_TIME
=
1
.
hour
.
ago
AVAILABLE_SCOPES
=
%w[specific shared active paused online]
FORM_EDITABLE
=
%i[description tag_list active run_untagged locked]
AVAILABLE_SCOPES
=
%w[specific shared active paused online]
.
freeze
FORM_EDITABLE
=
%i[description tag_list active run_untagged locked]
.
freeze
has_many
:builds
has_many
:runner_projects
,
dependent: :destroy
...
...
app/models/commit.rb
View file @
0932578f
...
...
@@ -22,7 +22,7 @@
DIFF_HARD_LIMIT_LINES
=
50000
# The SHA can be between 7 and 40 hex characters.
COMMIT_SHA_PATTERN
=
'\h{7,40}'
COMMIT_SHA_PATTERN
=
'\h{7,40}'
.
freeze
class
<<
self
def
decorate
(
commits
,
project
)
...
...
app/models/concerns/cache_markdown_field.rb
View file @
0932578f
...
...
@@ -45,7 +45,7 @@
Project
Release
Snippet
]
]
.
freeze
def
self
.
caching_classes
CACHING_CLASSES
.
map
(
&
:constantize
)
...
...
app/models/concerns/has_status.rb
View file @
0932578f
module
HasStatus
extend
ActiveSupport
::
Concern
DEFAULT_STATUS
=
'created'
AVAILABLE_STATUSES
=
%w[created pending running success failed canceled skipped]
STARTED_STATUSES
=
%w[running success failed skipped]
ACTIVE_STATUSES
=
%w[pending running]
COMPLETED_STATUSES
=
%w[success failed canceled skipped]
ORDERED_STATUSES
=
%w[failed pending running canceled success skipped]
DEFAULT_STATUS
=
'created'
.
freeze
AVAILABLE_STATUSES
=
%w[created pending running success failed canceled skipped]
.
freeze
STARTED_STATUSES
=
%w[running success failed skipped]
.
freeze
ACTIVE_STATUSES
=
%w[pending running]
.
freeze
COMPLETED_STATUSES
=
%w[success failed canceled skipped]
.
freeze
ORDERED_STATUSES
=
%w[failed pending running canceled success skipped]
.
freeze
class_methods
do
def
status_sql
...
...
app/models/label.rb
View file @
0932578f
...
...
@@ -11,7 +11,7 @@
cache_markdown_field
:description
,
pipeline: :single_line
DEFAULT_COLOR
=
'#428BCA'
DEFAULT_COLOR
=
'#428BCA'
.
freeze
default_value_for
:color
,
DEFAULT_COLOR
...
...
app/models/members/group_member.rb
View file @
0932578f
class
GroupMember
<
Member
SOURCE_TYPE
=
'Namespace'
SOURCE_TYPE
=
'Namespace'
.
freeze
belongs_to
:group
,
foreign_key:
'source_id'
...
...
app/models/members/project_member.rb
View file @
0932578f
class
ProjectMember
<
Member
SOURCE_TYPE
=
'Project'
SOURCE_TYPE
=
'Project'
.
freeze
include
Gitlab
::
ShellAdapter
...
...
app/models/merge_request_diff.rb
View file @
0932578f
...
...
@@ -7,7 +7,7 @@
COMMITS_SAFE_SIZE
=
100
# Valid types of serialized diffs allowed by Gitlab::Git::Diff
VALID_CLASSES
=
[
Hash
,
Rugged
::
Patch
,
Rugged
::
Diff
::
Delta
]
VALID_CLASSES
=
[
Hash
,
Rugged
::
Patch
,
Rugged
::
Diff
::
Delta
]
.
freeze
belongs_to
:merge_request
...
...
app/models/notification_setting.rb
View file @
0932578f
...
...
@@ -35,7 +35,7 @@
:merge_merge_request
,
:failed_pipeline
,
:success_pipeline
]
]
.
freeze
EXCLUDED_WATCHER_EVENTS
=
[
:success_pipeline
...
...
@@ -39,7 +39,7 @@
EXCLUDED_WATCHER_EVENTS
=
[
:success_pipeline
]
]
.
freeze
store
:events
,
accessors:
EMAIL_EVENTS
,
coder:
JSON
...
...
app/models/project.rb
View file @
0932578f
...
...
@@ -22,7 +22,7 @@
class
BoardLimitExceeded
<
StandardError
;
end
NUMBER_OF_PERMITTED_BOARDS
=
1
UNKNOWN_IMPORT_URL
=
'http://unknown.git'
UNKNOWN_IMPORT_URL
=
'http://unknown.git'
.
freeze
cache_markdown_field
:description
,
pipeline: :description
...
...
app/models/project_feature.rb
View file @
0932578f
...
...
@@ -18,7 +18,7 @@
PRIVATE
=
10
ENABLED
=
20
FEATURES
=
%i(issues merge_requests wiki snippets builds repository)
FEATURES
=
%i(issues merge_requests wiki snippets builds repository)
.
freeze
class
<<
self
def
access_level_attribute
(
feature
)
...
...
Prev
1
2
3
4
5
6
Next
Write
Preview
Supports
Markdown
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