Module: Typocop

Defined in:
lib/typocop.rb,
lib/typocop/cli.rb,
lib/typocop/cop.rb,
lib/typocop/cops.rb,
lib/typocop/repo.rb,
lib/typocop/patch.rb,
lib/typocop/client.rb,
lib/typocop/comment.rb,
lib/typocop/version.rb,
lib/typocop/settings.rb

Defined Under Namespace

Classes: CLI, Client, Comment, Cop, Cops, Patch, Repo, Settings

Constant Summary collapse

VERSION =
'0.1.4'

Class Method Summary collapse

Class Method Details

.execute(settings) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/typocop.rb', line 20

def self.execute(settings)
  repo = Repo.new
  paths = repo.patch_additions.map(&:path)

  return unless paths.any?

  excludes = settings.excludes
  skips = settings.skips
  typo_checker = TypoChecker::Checker.new(paths: paths, excludes: excludes, skips: skips, stdoutput: false)
  found_typos = typo_checker.scan_repo('.')

  puts 'No typos found' if found_typos.empty?

  cops = Cops.new(found_typos)
  client = Client.new(repo)
  client.execute(cops.cops)
end