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
Jérome Perrin
gitlab-ce
Commits
166a2d7a
Commit
166a2d7a
authored
Nov 22, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it clear that this is an acceptable use
parent
89f29395
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
doc/development/module_with_instance_variables.md
doc/development/module_with_instance_variables.md
+8
-5
No files found.
doc/development/module_with_instance_variables.md
View file @
166a2d7a
...
...
@@ -77,8 +77,7 @@ we could easily add to the cop, we should do it.
### How to rewrite and avoid disabling this cop
Even if we could just disable the cop, we should avoid doing so. Some code
could be easily rewritten in simple form. Here's an example. Consider this
acceptable method:
could be easily rewritten in simple form. Consider this acceptable method:
```
ruby
module
Gitlab
...
...
@@ -92,8 +91,12 @@ module Gitlab
end
```
It's still offending because it's not just
`||=`
, but we could split this
method into two:
This method is totally fine because it's already self-contained. No other
methods should be using
`@emoji_unicode_versions_by_name`
and we're good.
However it's still offending the cop because it's not just
`||=`
, and the
cop is not smart enough to judge that this is fine.
On the other hand, we could split this method into two:
```
ruby
module
Gitlab
...
...
@@ -112,7 +115,7 @@ module Gitlab
end
```
Now the cop won't complain. Here's a
nother
bad example which we could rewrite:
Now the cop won't complain. Here's a bad example which we could rewrite:
```
ruby
module
SpamCheckService
...
...
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