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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
4a37cd0d
Commit
4a37cd0d
authored
Aug 28, 2018
by
Jacopo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor renames for clarity
parent
e3e74662
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
rubocop/cop/prefer_class_methods_over_module.rb
rubocop/cop/prefer_class_methods_over_module.rb
+2
-2
spec/rubocop/cop/prefer_class_methods_over_module_spec.rb
spec/rubocop/cop/prefer_class_methods_over_module_spec.rb
+1
-1
No files found.
rubocop/cop/prefer_class_methods_over_module.rb
View file @
4a37cd0d
...
...
@@ -36,7 +36,7 @@ module RuboCop
PATTERN
def
on_module
(
node
)
add_offense
(
node
)
if
node
.
defined_module_name
==
'ClassMethods'
&&
extends_activesupport_concern?
(
node
)
add_offense
(
node
)
if
node
.
defined_module_name
==
'ClassMethods'
&&
module_
extends_activesupport_concern?
(
node
)
end
def
autocorrect
(
node
)
...
...
@@ -47,7 +47,7 @@ module RuboCop
private
def
extends_activesupport_concern?
(
node
)
def
module_
extends_activesupport_concern?
(
node
)
container_module
=
container_module_of
(
node
)
return
false
unless
container_module
...
...
spec/rubocop/cop/prefer_class_methods_over_module_spec.rb
View file @
4a37cd0d
...
...
@@ -93,6 +93,6 @@ describe RuboCop::Cop::PreferClassMethodsOverModule do
end
end
RUBY
expect
(
autocorrected
).
to
eq
l
(
expected_source
)
expect
(
autocorrected
).
to
eq
(
expected_source
)
end
end
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