Class: GithubFormatter

Inherits:
RuboCop::Formatter::BaseFormatter
  • Object
show all
Defined in:
lib/ducalis/github_formatter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#allObject (readonly)

Returns the value of attribute all.



4
5
6
# File 'lib/ducalis/github_formatter.rb', line 4

def all
  @all
end

Instance Method Details

#file_finished(_file, offenses) ⇒ Object



10
11
12
13
# File 'lib/ducalis/github_formatter.rb', line 10

def file_finished(_file, offenses)
  print '.'
  @all << offenses unless offenses.empty?
end

#finished(_inspected_files) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/ducalis/github_formatter.rb', line 15

def finished(_inspected_files)
  print "\n"
  Ducalis::Commentators::Github.new(
    GitAccess.instance.repo,
    GitAccess.instance.id
  ).call(@all.flatten)
end

#started(_target_files) ⇒ Object



6
7
8
# File 'lib/ducalis/github_formatter.rb', line 6

def started(_target_files)
  @all = []
end