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
c7bac53f
Commit
c7bac53f
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/SingleLineMethods cop
parent
146c43c9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
155 additions
and
57 deletions
+155
-57
.rubocop_todo.yml
.rubocop_todo.yml
+0
-7
changelogs/unreleased/single-line-cop.yml
changelogs/unreleased/single-line-cop.yml
+5
-0
lib/gitlab/ci/ansi2html.rb
lib/gitlab/ci/ansi2html.rb
+150
-50
No files found.
.rubocop_todo.yml
View file @
c7bac53f
...
...
@@ -702,13 +702,6 @@ Style/RescueModifier:
Style/RescueStandardError
:
Enabled
:
false
# Offense count: 50
# Cop supports --auto-correct.
# Configuration parameters: AllowIfMethodIsEmpty.
Style/SingleLineMethods
:
Exclude
:
-
'
lib/gitlab/ci/ansi2html.rb'
# Offense count: 102
# Cop supports --auto-correct.
# Configuration parameters: .
...
...
changelogs/unreleased/single-line-cop.yml
0 → 100644
View file @
c7bac53f
---
title
:
Fix Style/SingleLineMethods cop
merge_request
:
41247
author
:
Rajendra Kadam
type
:
fixed
lib/gitlab/ci/ansi2html.rb
View file @
c7bac53f
...
...
@@ -31,105 +31,205 @@ module Gitlab
end
class
Converter
def
on_0
(
_
)
reset
end
def
on_0
(
_
)
reset
end
def
on_1
(
_
)
enable
(
STYLE_SWITCHES
[
:bold
])
end
def
on_1
(
_
)
enable
(
STYLE_SWITCHES
[
:bold
])
end
def
on_3
(
_
)
enable
(
STYLE_SWITCHES
[
:italic
])
end
def
on_3
(
_
)
enable
(
STYLE_SWITCHES
[
:italic
])
end
def
on_4
(
_
)
enable
(
STYLE_SWITCHES
[
:underline
])
end
def
on_4
(
_
)
enable
(
STYLE_SWITCHES
[
:underline
])
end
def
on_8
(
_
)
enable
(
STYLE_SWITCHES
[
:conceal
])
end
def
on_8
(
_
)
enable
(
STYLE_SWITCHES
[
:conceal
])
end
def
on_9
(
_
)
enable
(
STYLE_SWITCHES
[
:cross
])
end
def
on_9
(
_
)
enable
(
STYLE_SWITCHES
[
:cross
])
end
def
on_21
(
_
)
disable
(
STYLE_SWITCHES
[
:bold
])
end
def
on_21
(
_
)
disable
(
STYLE_SWITCHES
[
:bold
])
end
def
on_22
(
_
)
disable
(
STYLE_SWITCHES
[
:bold
])
end
def
on_22
(
_
)
disable
(
STYLE_SWITCHES
[
:bold
])
end
def
on_23
(
_
)
disable
(
STYLE_SWITCHES
[
:italic
])
end
def
on_23
(
_
)
disable
(
STYLE_SWITCHES
[
:italic
])
end
def
on_24
(
_
)
disable
(
STYLE_SWITCHES
[
:underline
])
end
def
on_24
(
_
)
disable
(
STYLE_SWITCHES
[
:underline
])
end
def
on_28
(
_
)
disable
(
STYLE_SWITCHES
[
:conceal
])
end
def
on_28
(
_
)
disable
(
STYLE_SWITCHES
[
:conceal
])
end
def
on_29
(
_
)
disable
(
STYLE_SWITCHES
[
:cross
])
end
def
on_29
(
_
)
disable
(
STYLE_SWITCHES
[
:cross
])
end
def
on_30
(
_
)
set_fg_color
(
0
)
end
def
on_30
(
_
)
set_fg_color
(
0
)
end
def
on_31
(
_
)
set_fg_color
(
1
)
end
def
on_31
(
_
)
set_fg_color
(
1
)
end
def
on_32
(
_
)
set_fg_color
(
2
)
end
def
on_32
(
_
)
set_fg_color
(
2
)
end
def
on_33
(
_
)
set_fg_color
(
3
)
end
def
on_33
(
_
)
set_fg_color
(
3
)
end
def
on_34
(
_
)
set_fg_color
(
4
)
end
def
on_34
(
_
)
set_fg_color
(
4
)
end
def
on_35
(
_
)
set_fg_color
(
5
)
end
def
on_35
(
_
)
set_fg_color
(
5
)
end
def
on_36
(
_
)
set_fg_color
(
6
)
end
def
on_36
(
_
)
set_fg_color
(
6
)
end
def
on_37
(
_
)
set_fg_color
(
7
)
end
def
on_37
(
_
)
set_fg_color
(
7
)
end
def
on_38
(
stack
)
set_fg_color_256
(
stack
)
end
def
on_38
(
stack
)
set_fg_color_256
(
stack
)
end
def
on_39
(
_
)
set_fg_color
(
9
)
end
def
on_39
(
_
)
set_fg_color
(
9
)
end
def
on_40
(
_
)
set_bg_color
(
0
)
end
def
on_40
(
_
)
set_bg_color
(
0
)
end
def
on_41
(
_
)
set_bg_color
(
1
)
end
def
on_41
(
_
)
set_bg_color
(
1
)
end
def
on_42
(
_
)
set_bg_color
(
2
)
end
def
on_42
(
_
)
set_bg_color
(
2
)
end
def
on_43
(
_
)
set_bg_color
(
3
)
end
def
on_43
(
_
)
set_bg_color
(
3
)
end
def
on_44
(
_
)
set_bg_color
(
4
)
end
def
on_44
(
_
)
set_bg_color
(
4
)
end
def
on_45
(
_
)
set_bg_color
(
5
)
end
def
on_45
(
_
)
set_bg_color
(
5
)
end
def
on_46
(
_
)
set_bg_color
(
6
)
end
def
on_46
(
_
)
set_bg_color
(
6
)
end
def
on_47
(
_
)
set_bg_color
(
7
)
end
def
on_47
(
_
)
set_bg_color
(
7
)
end
def
on_48
(
stack
)
set_bg_color_256
(
stack
)
end
def
on_48
(
stack
)
set_bg_color_256
(
stack
)
end
def
on_49
(
_
)
set_bg_color
(
9
)
end
def
on_49
(
_
)
set_bg_color
(
9
)
end
def
on_90
(
_
)
set_fg_color
(
0
,
'l'
)
end
def
on_90
(
_
)
set_fg_color
(
0
,
'l'
)
end
def
on_91
(
_
)
set_fg_color
(
1
,
'l'
)
end
def
on_91
(
_
)
set_fg_color
(
1
,
'l'
)
end
def
on_92
(
_
)
set_fg_color
(
2
,
'l'
)
end
def
on_92
(
_
)
set_fg_color
(
2
,
'l'
)
end
def
on_93
(
_
)
set_fg_color
(
3
,
'l'
)
end
def
on_93
(
_
)
set_fg_color
(
3
,
'l'
)
end
def
on_94
(
_
)
set_fg_color
(
4
,
'l'
)
end
def
on_94
(
_
)
set_fg_color
(
4
,
'l'
)
end
def
on_95
(
_
)
set_fg_color
(
5
,
'l'
)
end
def
on_95
(
_
)
set_fg_color
(
5
,
'l'
)
end
def
on_96
(
_
)
set_fg_color
(
6
,
'l'
)
end
def
on_96
(
_
)
set_fg_color
(
6
,
'l'
)
end
def
on_97
(
_
)
set_fg_color
(
7
,
'l'
)
end
def
on_97
(
_
)
set_fg_color
(
7
,
'l'
)
end
def
on_99
(
_
)
set_fg_color
(
9
,
'l'
)
end
def
on_99
(
_
)
set_fg_color
(
9
,
'l'
)
end
def
on_100
(
_
)
set_bg_color
(
0
,
'l'
)
end
def
on_100
(
_
)
set_bg_color
(
0
,
'l'
)
end
def
on_101
(
_
)
set_bg_color
(
1
,
'l'
)
end
def
on_101
(
_
)
set_bg_color
(
1
,
'l'
)
end
def
on_102
(
_
)
set_bg_color
(
2
,
'l'
)
end
def
on_102
(
_
)
set_bg_color
(
2
,
'l'
)
end
def
on_103
(
_
)
set_bg_color
(
3
,
'l'
)
end
def
on_103
(
_
)
set_bg_color
(
3
,
'l'
)
end
def
on_104
(
_
)
set_bg_color
(
4
,
'l'
)
end
def
on_104
(
_
)
set_bg_color
(
4
,
'l'
)
end
def
on_105
(
_
)
set_bg_color
(
5
,
'l'
)
end
def
on_105
(
_
)
set_bg_color
(
5
,
'l'
)
end
def
on_106
(
_
)
set_bg_color
(
6
,
'l'
)
end
def
on_106
(
_
)
set_bg_color
(
6
,
'l'
)
end
def
on_107
(
_
)
set_bg_color
(
7
,
'l'
)
end
def
on_107
(
_
)
set_bg_color
(
7
,
'l'
)
end
def
on_109
(
_
)
set_bg_color
(
9
,
'l'
)
end
def
on_109
(
_
)
set_bg_color
(
9
,
'l'
)
end
attr_accessor
:offset
,
:n_open_tags
,
:fg_color
,
:bg_color
,
:style_mask
,
:sections
,
:lineno_in_section
...
...
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