BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
1c5106fa
Unverified
Commit
1c5106fa
authored
May 28, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow comment after if/unless clause
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
2b8eb727
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
line_break_around_conditional_block.rb
rubocop/cop/line_break_around_conditional_block.rb
+1
-1
line_break_around_conditional_block_spec.rb
spec/rubocop/cop/line_break_around_conditional_block_spec.rb
+12
-0
No files found.
rubocop/cop/line_break_around_conditional_block.rb
View file @
1c5106fa
...
...
@@ -95,7 +95,7 @@ module RuboCop
end
def
end_clause_line?
(
line
)
line
=~
/^\s*(rescue|else|elsif|when)/
line
=~
/^\s*(
#|
rescue|else|elsif|when)/
end
def
begin_line?
(
line
)
...
...
spec/rubocop/cop/line_break_around_conditional_block_spec.rb
View file @
1c5106fa
...
...
@@ -256,6 +256,18 @@ describe RuboCop::Cop::LineBreakAroundConditionalBlock do
expect
(
cop
.
offenses
).
to
be_empty
end
it
"doesn't flag violation for
#{
conditional
}
followed by a comment"
do
source
=
<<~
RUBY
#{
conditional
}
condition
do_something
end
# a short comment
RUBY
inspect_source
(
source
)
expect
(
cop
.
offenses
).
to
be_empty
end
it
"doesn't flag violation for
#{
conditional
}
followed by an end"
do
source
=
<<~
RUBY
class Foo
...
...
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