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
ba3ba743
Commit
ba3ba743
authored
Mar 10, 2022
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make RuboCop's TodoFormatter entry a class not a struct
parent
2d04ea02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
rubocop/formatter/todo_formatter.rb
rubocop/formatter/todo_formatter.rb
+8
-5
No files found.
rubocop/formatter/todo_formatter.rb
View file @
ba3ba743
...
...
@@ -21,16 +21,19 @@ module RuboCop
# via `Enabled: false` in .rubocop_todo.yml or .rubocop_todo/.
MAX_OFFENSE_COUNT
=
15
Todo
=
Struct
.
new
(
:cop_name
,
:files
,
:offense_count
)
do
def
initialize
(
cop_name
)
super
(
cop_name
,
Set
.
new
,
0
)
class
Todo
attr_reader
:cop_name
,
:files
,
:offense_count
def
initialize
(
cop_name
)
@cop_name
=
cop_name
@files
=
Set
.
new
@offense_count
=
0
@cop_class
=
RuboCop
::
Cop
::
Registry
.
global
.
find_by_cop_name
(
cop_name
)
end
def
record
(
file
,
offense_count
)
files
<<
file
self
.
offense_count
+=
offense_count
@
files
<<
file
@
offense_count
+=
offense_count
end
def
autocorrectable?
...
...
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